WP_User_Request::__construct()publicWP 4.9.6

Constructor.

Метод класса: WP_User_Request{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$WP_User_Request = new WP_User_Request();
$WP_User_Request->__construct( $post );
$post(WP_Post|объект) (обязательный)
Post object.

Список изменений

С версии 4.9.6 Введена.

Код WP_User_Request::__construct() WP 6.5.2

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;
}