mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-24 10:09:47 +01:00
d0c1b77cda
- Move the (remaining) privacy tools related functions from `wp-admin/includes/file.php` to `wp-admin/includes/privacy-tools.php`. - Move the `WP_User_Request` class to a separate file. See #43895. Built from https://develop.svn.wordpress.org/trunk@45519 git-svn-id: http://core.svn.wordpress.org/trunk@45330 1a063a9b-81f0-0310-95a4-ce76da25c4cd
108 lines
1.9 KiB
PHP
108 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* WP_User_Request class.
|
|
*
|
|
* Represents user request data loaded from a WP_Post object.
|
|
*
|
|
* @since 4.9.6
|
|
*/
|
|
final class WP_User_Request {
|
|
/**
|
|
* Request ID.
|
|
*
|
|
* @var int
|
|
*/
|
|
public $ID = 0;
|
|
|
|
/**
|
|
* User ID.
|
|
*
|
|
* @var int
|
|
*/
|
|
public $user_id = 0;
|
|
|
|
/**
|
|
* User email.
|
|
*
|
|
* @var int
|
|
*/
|
|
public $email = '';
|
|
|
|
/**
|
|
* Action name.
|
|
*
|
|
* @var string
|
|
*/
|
|
public $action_name = '';
|
|
|
|
/**
|
|
* Current status.
|
|
*
|
|
* @var string
|
|
*/
|
|
public $status = '';
|
|
|
|
/**
|
|
* Timestamp this request was created.
|
|
*
|
|
* @var int|null
|
|
*/
|
|
public $created_timestamp = null;
|
|
|
|
/**
|
|
* Timestamp this request was last modified.
|
|
*
|
|
* @var int|null
|
|
*/
|
|
public $modified_timestamp = null;
|
|
|
|
/**
|
|
* Timestamp this request was confirmed.
|
|
*
|
|
* @var int
|
|
*/
|
|
public $confirmed_timestamp = null;
|
|
|
|
/**
|
|
* Timestamp this request was completed.
|
|
*
|
|
* @var int
|
|
*/
|
|
public $completed_timestamp = null;
|
|
|
|
/**
|
|
* Misc data assigned to this request.
|
|
*
|
|
* @var array
|
|
*/
|
|
public $request_data = array();
|
|
|
|
/**
|
|
* Key used to confirm this request.
|
|
*
|
|
* @var string
|
|
*/
|
|
public $confirm_key = '';
|
|
|
|
/**
|
|
* Constructor.
|
|
*
|
|
* @since 4.9.6
|
|
*
|
|
* @param WP_Post|object $post Post object.
|
|
*/
|
|
public function __construct( $post ) {
|
|
$this->ID = $post->ID;
|
|
$this->user_id = $post->post_author;
|
|
$this->email = $post->post_title;
|
|
$this->action_name = $post->post_name;
|
|
$this->status = $post->post_status;
|
|
$this->created_timestamp = strtotime( $post->post_date_gmt );
|
|
$this->modified_timestamp = strtotime( $post->post_modified_gmt );
|
|
$this->confirmed_timestamp = (int) get_post_meta( $post->ID, '_wp_user_request_confirmed_timestamp', true );
|
|
$this->completed_timestamp = (int) get_post_meta( $post->ID, '_wp_user_request_completed_timestamp', true );
|
|
$this->request_data = json_decode( $post->post_content, true );
|
|
$this->confirm_key = $post->post_password;
|
|
}
|
|
}
|