PHP Class Papi_REST_API_Post, papi

Mostrar archivo Open project: wp-papi/papi

Protected Properties

Property Type Description
$store Papi_Post_Store The post store class.

Public Methods

Method Description
__construct ( ) REST API Post construct.
get_page_type ( array $data, string $field_name, WP_REST_Request $request ) : array Get page type.
get_post ( WP_Post $post ) : WP_Post Filter the post.
prepare_response ( WP_REST_Response $response ) : WP_REST_Response Prepare response.
setup_fields ( ) Setup REST API fields.

Protected Methods

Method Description
prepare_property_value ( string $slug, mixed $default = null ) : mixed Prepare property value.

Method Details

__construct() public method

REST API Post construct.
public __construct ( )

get_page_type() public method

Get page type.
public get_page_type ( array $data, string $field_name, WP_REST_Request $request ) : array
$data array
$field_name string
$request WP_REST_Request
return array

get_post() public method

Register all properties with register_meta and prepare response filter.
public get_post ( WP_Post $post ) : WP_Post
$post WP_Post
return WP_Post

prepare_property_value() protected method

Prepare property value.
protected prepare_property_value ( string $slug, mixed $default = null ) : mixed
$slug string
$default mixed
return mixed

prepare_response() public method

Prepare response.
public prepare_response ( WP_REST_Response $response ) : WP_REST_Response
$response WP_REST_Response
return WP_REST_Response

setup_fields() public method

Setup REST API fields.
public setup_fields ( )

Property Details

$store protected_oe property

The post store class.
protected Papi_Post_Store $store
return Papi_Post_Store