Property | Type | Description | |
---|---|---|---|
$meta | WP_REST_Term_Meta_Fields | Instance of a term meta fields object. | |
$sort_column | string | Column to have the terms be sorted by. | |
$taxonomy | string | Taxonomy key. | |
$total_terms | integer | Number of terms that were found. |
Method | Description | |
---|---|---|
__construct ( string $taxonomy ) | Constructor. | |
create_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | Creates a single term in a taxonomy. | |
create_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | Checks if a request has access to create a term. | |
delete_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | Deletes a single term from a taxonomy. | |
delete_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | Checks if a request has access to delete the specified term. | |
get_collection_params ( ) : array | Retrieves the query params for collections. | |
get_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | Gets a single term from a taxonomy. | |
get_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | Checks if a request has access to read the specified term. | |
get_item_schema ( ) : array | Retrieves the term's schema, conforming to JSON Schema. | |
get_items ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | Retrieves terms associated with a taxonomy. | |
get_items_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | Checks if a request has access to read terms in the specified taxonomy. | |
prepare_item_for_database ( WP_REST_Request $request ) : object | Prepares a single term for create or update. | |
prepare_item_for_response ( obj $item, WP_REST_Request $request ) : WP_REST_Response | Prepares a single term output for response. | |
register_routes ( ) | Registers the routes for the objects of the controller. | |
update_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | Updates a single term from a taxonomy. | |
update_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | Checks if a request has access to update the specified term. |
Method | Description | |
---|---|---|
check_is_taxonomy_allowed ( string $taxonomy ) : boolean | Checks that the taxonomy is valid. | |
prepare_links ( object $term ) : array | Prepares links for the request. |
public __construct ( string $taxonomy ) | ||
$taxonomy | string | Taxonomy key. |
protected check_is_taxonomy_allowed ( string $taxonomy ) : boolean | ||
$taxonomy | string | Taxonomy to check. |
return | boolean | Whether the taxonomy is allowed for REST management. |
public create_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | WP_REST_Response | WP_Error | Response object on success, or WP_Error object on failure. |
public create_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | boolean | WP_Error | True if the request has access to create items, false or WP_Error object otherwise. |
public delete_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | WP_REST_Response | WP_Error | Response object on success, or WP_Error object on failure. |
public delete_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | boolean | WP_Error | True if the request has access to delete the item, otherwise false or WP_Error object. |
public get_collection_params ( ) : array | ||
return | array | Collection parameters. |
public get_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | WP_REST_Response | WP_Error | Response object on success, or WP_Error object on failure. |
public get_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | boolean | WP_Error | True if the request has read access for the item, otherwise false or WP_Error object. |
public get_item_schema ( ) : array | ||
return | array | Item schema data. |
public get_items ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | WP_REST_Response | WP_Error | Response object on success, or WP_Error object on failure. |
public get_items_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | boolean | WP_Error | True if the request has read access, otherwise false or WP_Error object. |
public prepare_item_for_database ( WP_REST_Request $request ) : object | ||
$request | WP_REST_Request | Request object. |
return | object | $prepared_term Term object. |
public prepare_item_for_response ( obj $item, WP_REST_Request $request ) : WP_REST_Response | ||
$item | obj | Term object. |
$request | WP_REST_Request | Request object. |
return | WP_REST_Response | $response Response object. |
protected prepare_links ( object $term ) : array | ||
$term | object | Term object. |
return | array | Links for the given term. |
public register_routes ( ) |
public update_item ( WP_REST_Request $request ) : WP_REST_Response | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | WP_REST_Response | WP_Error | Response object on success, or WP_Error object on failure. |
public update_item_permissions_check ( WP_REST_Request $request ) : boolean | WP_Error | ||
$request | WP_REST_Request | Full details about the request. |
return | boolean | WP_Error | True if the request has access to update the item, false or WP_Error object otherwise. |
protected WP_REST_Term_Meta_Fields $meta | ||
return | WP_REST_Term_Meta_Fields |
protected string $sort_column | ||
return | string |
protected int $total_terms | ||
return | integer |