PHP Класс WP_REST_Post_Types_Controller, wordpress

Наследование: extends WP_REST_Controller
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( ) Constructor.
get_collection_params ( ) : array Retrieves the query params for collections.
get_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response Retrieves a specific post type.
get_item_schema ( ) : array Retrieves the post type's schema, conforming to JSON Schema.
get_items ( WP_REST_Request $request ) : WP_Error | WP_REST_Response Retrieves all public post types.
get_items_permissions_check ( WP_REST_Request $request ) : WP_Error | true Checks whether a given request has permission to read types.
prepare_item_for_response ( stdClass $post_type, WP_REST_Request $request ) : WP_REST_Response Prepares a post type object for serialization.
register_routes ( ) Registers the routes for the objects of the controller.

Описание методов

__construct() публичный Метод

Constructor.
С версии: 4.7.0
public __construct ( )

get_collection_params() публичный Метод

Retrieves the query params for collections.
С версии: 4.7.0
public get_collection_params ( ) : array
Результат array Collection parameters.

get_item() публичный Метод

Retrieves a specific post type.
С версии: 4.7.0
public get_item ( WP_REST_Request $request ) : WP_Error | WP_REST_Response
$request WP_REST_Request Full details about the request.
Результат WP_Error | WP_REST_Response Response object on success, or WP_Error object on failure.

get_item_schema() публичный Метод

Retrieves the post type's schema, conforming to JSON Schema.
С версии: 4.7.0
public get_item_schema ( ) : array
Результат array Item schema data.

get_items() публичный Метод

Retrieves all public post types.
С версии: 4.7.0
public get_items ( WP_REST_Request $request ) : WP_Error | WP_REST_Response
$request WP_REST_Request Full details about the request.
Результат WP_Error | WP_REST_Response Response object on success, or WP_Error object on failure.

get_items_permissions_check() публичный Метод

Checks whether a given request has permission to read types.
С версии: 4.7.0
public get_items_permissions_check ( WP_REST_Request $request ) : WP_Error | true
$request WP_REST_Request Full details about the request.
Результат WP_Error | true True if the request has read access, WP_Error object otherwise.

prepare_item_for_response() публичный Метод

Prepares a post type object for serialization.
С версии: 4.7.0
public prepare_item_for_response ( stdClass $post_type, WP_REST_Request $request ) : WP_REST_Response
$post_type stdClass Post type data.
$request WP_REST_Request Full details about the request.
Результат WP_REST_Response Response object.

register_routes() публичный Метод

Registers the routes for the objects of the controller.
См. также: register_rest_route()
С версии: 4.7.0
public register_routes ( )