[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/ -> MP_WP_User.class.php (source)

   1  <?php
   2  class MP_WP_User
   3  {
   4  	public static function get_id() 
   5      {
   6          $user = wp_get_current_user();
   7          return $user->ID;
   8      }
   9  
  10  	public static function get_email() 
  11      {
  12          $post_ = filter_input_array( INPUT_POST );
  13  
  14          switch ( true )
  15          {
  16              case ( isset( $post_['email'] ) ) :
  17                  return $post_['email'];
  18              break;
  19              default :
  20                  $u = self::get_id();
  21                  if ( $u )
  22                  {
  23                      $user = get_userdata( $u );
  24                      return $user->user_email;
  25                  }
  26                  else
  27                  {
  28                      if ( isset( $_COOKIE['comment_author_email_' . COOKIEHASH] ) ) return $_COOKIE['comment_author_email_' . COOKIEHASH];
  29                  }
  30              break;
  31          }
  32          return '';
  33      }
  34  
  35  	public static function get_unsubscribe_url()
  36      {
  37          $url = false;
  38          $email = self::get_email();
  39  
  40          if ( MailPress::is_email( $email ) )
  41          {
  42              $key = MP_User::get_key_by_email( $email );
  43              if ( $key ) $url = MP_User::get_unsubscribe_url( $key );
  44          }
  45          return $url;
  46      }
  47  }


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1