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


Generated : Sat Dec 21 08:20:01 2024 Cross-referenced by PHPXref