[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

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  #[AllowDynamicProperties]
  10  final class WP_User_Request {
  11      /**
  12       * Request ID.
  13       *
  14       * @since 4.9.6
  15       * @var int
  16       */
  17      public $ID = 0;
  18  
  19      /**
  20       * User ID.
  21       *
  22       * @since 4.9.6
  23       * @var string
  24       * @phpstan-var numeric-string
  25       */
  26      public $user_id = '0';
  27  
  28      /**
  29       * User email.
  30       *
  31       * @since 4.9.6
  32       * @var string
  33       */
  34      public $email = '';
  35  
  36      /**
  37       * Action name.
  38       *
  39       * @since 4.9.6
  40       * @var string
  41       */
  42      public $action_name = '';
  43  
  44      /**
  45       * Current status.
  46       *
  47       * @since 4.9.6
  48       * @var string
  49       */
  50      public $status = '';
  51  
  52      /**
  53       * Timestamp this request was created.
  54       *
  55       * @since 4.9.6
  56       * @var int|null
  57       */
  58      public $created_timestamp = null;
  59  
  60      /**
  61       * Timestamp this request was last modified.
  62       *
  63       * @since 4.9.6
  64       * @var int|null
  65       */
  66      public $modified_timestamp = null;
  67  
  68      /**
  69       * Timestamp this request was confirmed.
  70       *
  71       * @since 4.9.6
  72       * @var int|null
  73       */
  74      public $confirmed_timestamp = null;
  75  
  76      /**
  77       * Timestamp this request was completed.
  78       *
  79       * @since 4.9.6
  80       * @var int|null
  81       */
  82      public $completed_timestamp = null;
  83  
  84      /**
  85       * Misc data assigned to this request.
  86       *
  87       * @since 4.9.6
  88       * @var array
  89       */
  90      public $request_data = array();
  91  
  92      /**
  93       * Key used to confirm this request.
  94       *
  95       * @since 4.9.6
  96       * @since 6.8.0 The key is now hashed using wp_fast_hash() instead of phpass.
  97       *
  98       * @var string
  99       */
 100      public $confirm_key = '';
 101  
 102      /**
 103       * Constructor.
 104       *
 105       * @since 4.9.6
 106       *
 107       * @param WP_Post|object $post Post object.
 108       */
 109  	public function __construct( $post ) {
 110          $this->ID                  = $post->ID;
 111          $this->user_id             = $post->post_author;
 112          $this->email               = $post->post_title;
 113          $this->action_name         = $post->post_name;
 114          $this->status              = $post->post_status;
 115          $this->created_timestamp   = strtotime( $post->post_date_gmt );
 116          $this->modified_timestamp  = strtotime( $post->post_modified_gmt );
 117          $this->confirmed_timestamp = (int) get_post_meta( $post->ID, '_wp_user_request_confirmed_timestamp', true );
 118          $this->completed_timestamp = (int) get_post_meta( $post->ID, '_wp_user_request_completed_timestamp', true );
 119          $this->request_data        = json_decode( $post->post_content, true );
 120          $this->confirm_key         = $post->post_password;
 121      }
 122  }


Generated : Sun Jun 14 08:20:09 2026 Cross-referenced by PHPXref