Class CMB2_REST_Controller_Fields
CMB2 objects/fields endpoint for WordPres REST API. Allows access to fields registered to a specific box.
- WP_REST_Controller
- CMB2_REST_Controller
- CMB2_REST_Controller_Boxes
- CMB2_REST_Controller_Fields
Category: WordPress_Plugin
License: GPL-2.0+
Author: CMB2 team
Since: 2.2.3
Link: https://cmb2.io
Todo: Add better documentation.
Todo: Research proper schema.
Located at includes/rest-api/CMB2_REST_Controller_Fields.php
Methods summary
public
|
|
public
WP_Error|boolean
|
#
get_items_permissions_check( WP_REST_Request $request )
Check if a given request has access to get fields. By default, no special permissions needed, but filtering return value. |
public
WP_Error|WP_REST_Response
|
|
public
WP_Error|boolean
|
#
get_item_permissions_check( WP_REST_Request $request )
Check if a given request has access to a field. By default, no special permissions needed, but filtering return value. |
public
WP_Error|boolean
|
#
get_item_permissions_check_filter( boolean $can_access = true )
Check by filter if a given request has access to a field. By default, no special permissions needed, but filtering return value. |
public
WP_Error|WP_REST_Response
|
|
public
WP_Error|boolean
|
#
update_item_permissions_check( WP_REST_Request $request )
Check if a given request has access to update a field value. By default, requires 'edit_others_posts' capability, but filtering return value. |
public
WP_Error|WP_REST_Response
|
|
public
WP_Error|boolean
|
#
delete_item_permissions_check( WP_REST_Request $request )
Check if a given request has access to delete a field value. By default, requires 'delete_others_posts' capability, but filtering return value. |
public
WP_Error|WP_REST_Response
|
|
public
WP_Error|WP_REST_Response
|
|
public
WP_Error|WP_REST_Response
|
|
public
array
|
|
protected
array
|
|
public
array
|
#
get_supporting_data(
Gets field supporting data (field id and value). |
protected
array
|
|
public
boolean
|
#
maybe_hook_registered_callback( string $filter, boolean $default_val )
Checks if the CMB2 box or field has any registered callback parameters for the given filter. |
public
|
#
maybe_unhook_registered_callback( string $filter )
Unhooks any CMB2 box or field registered callback parameters for the given filter. |
Methods inherited from CMB2_REST_Controller_Boxes
Methods inherited from CMB2_REST_Controller
get_cb_results()
,
get_intial_request_type()
,
get_intial_route()
,
get_item_schema()
,
get_query_string()
,
initiate_request()
,
initiate_rest_box()
,
initiate_rest_edit_box()
,
initiate_rest_read_box()
,
maybe_hook_callback_and_apply_filters()
,
prepare_item()
,
prepare_item_for_response()
Methods inherited from WP_REST_Controller
add_additional_fields_schema()
,
add_additional_fields_to_object()
,
create_item()
,
create_item_permissions_check()
,
filter_response_by_context()
,
get_additional_fields()
,
get_collection_params()
,
get_context_param()
,
get_endpoint_args_for_item_schema()
,
get_object_type()
,
get_post()
,
get_public_item_schema()
,
prepare_item_for_database()
,
prepare_response_for_collection()
,
update_additional_fields_for_object()
Properties summary
Properties inherited from CMB2_REST_Controller_Boxes
Properties inherited from CMB2_REST_Controller
$field
,
$namespace
,
$object_id
,
$object_type
,
$request
,
$request_type
,
$rest_box
,
$route
,
$server