WP_REST_Global_Styles_Revisions_Controller::__construct()publicWP 6.3.0

Constructor.

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

Хуков нет.

Возвращает

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

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

$WP_REST_Global_Styles_Revisions_Controller = new WP_REST_Global_Styles_Revisions_Controller();
$WP_REST_Global_Styles_Revisions_Controller->__construct( $parent_post_type );
$parent_post_type(строка)
Post type of the parent.
По умолчанию: 'wp_global_styles'

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

С версии 6.3.0 Введена.
С версии 6.6.0 Extends class from WP_REST_Revisions_Controller.

Код WP_REST_Global_Styles_Revisions_Controller::__construct() WP 6.7.1

public function __construct( $parent_post_type = 'wp_global_styles' ) {
	parent::__construct( $parent_post_type );
	$post_type_object  = get_post_type_object( $parent_post_type );
	$parent_controller = $post_type_object->get_rest_controller();

	if ( ! $parent_controller ) {
		$parent_controller = new WP_REST_Global_Styles_Controller( $parent_post_type );
	}

	$this->parent_controller = $parent_controller;
	$this->rest_base         = 'revisions';
	$this->parent_base       = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;
	$this->namespace         = ! empty( $post_type_object->rest_namespace ) ? $post_type_object->rest_namespace : 'wp/v2';
}