[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/ -> class-wp-user-request.php (source)

   1  <?php
   2  /**
   3   * WP_User_Request class.
   4   *
   5   * Represents user request data loaded from a WP_Post object.
   6   *
   7   * @since 4.9.6
   8   */
   9  final class WP_User_Request {
  10      /**
  11       * Request ID.
  12       *
  13       * @var int
  14       */
  15      public $ID = 0;
  16  
  17      /**
  18       * User ID.
  19       *
  20       * @var int
  21       */
  22      public $user_id = 0;
  23  
  24      /**
  25       * User email.
  26       *
  27       * @var int
  28       */
  29      public $email = '';
  30  
  31      /**
  32       * Action name.
  33       *
  34       * @var string
  35       */
  36      public $action_name = '';
  37  
  38      /**
  39       * Current status.
  40       *
  41       * @var string
  42       */
  43      public $status = '';
  44  
  45      /**
  46       * Timestamp this request was created.
  47       *
  48       * @var int|null
  49       */
  50      public $created_timestamp = null;
  51  
  52      /**
  53       * Timestamp this request was last modified.
  54       *
  55       * @var int|null
  56       */
  57      public $modified_timestamp = null;
  58  
  59      /**
  60       * Timestamp this request was confirmed.
  61       *
  62       * @var int
  63       */
  64      public $confirmed_timestamp = null;
  65  
  66      /**
  67       * Timestamp this request was completed.
  68       *
  69       * @var int
  70       */
  71      public $completed_timestamp = null;
  72  
  73      /**
  74       * Misc data assigned to this request.
  75       *
  76       * @var array
  77       */
  78      public $request_data = array();
  79  
  80      /**
  81       * Key used to confirm this request.
  82       *
  83       * @var string
  84       */
  85      public $confirm_key = '';
  86  
  87      /**
  88       * Constructor.
  89       *
  90       * @since 4.9.6
  91       *
  92       * @param WP_Post|object $post Post object.
  93       */
  94  	public function __construct( $post ) {
  95          $this->ID                  = $post->ID;
  96          $this->user_id             = $post->post_author;
  97          $this->email               = $post->post_title;
  98          $this->action_name         = $post->post_name;
  99          $this->status              = $post->post_status;
 100          $this->created_timestamp   = strtotime( $post->post_date_gmt );
 101          $this->modified_timestamp  = strtotime( $post->post_modified_gmt );
 102          $this->confirmed_timestamp = (int) get_post_meta( $post->ID, '_wp_user_request_confirmed_timestamp', true );
 103          $this->completed_timestamp = (int) get_post_meta( $post->ID, '_wp_user_request_completed_timestamp', true );
 104          $this->request_data        = json_decode( $post->post_content, true );
 105          $this->confirm_key         = $post->post_password;
 106      }
 107  }


Generated: Fri Oct 25 08:20:01 2019 Cross-referenced by PHPXref 0.7