[ Index ] |
PHP Cross Reference of WordPress |
[Source view] [Print] [Project Stats]
REST API: WP_REST_Menus_Controller class
File Size: | 568 lines (17 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
WP_REST_Menus_Controller:: (15 methods):
get_items_permissions_check()
get_item_permissions_check()
get_term()
check_has_read_only_access()
prepare_item_for_response()
prepare_links()
prepare_item_for_database()
create_item()
update_item()
delete_item()
get_menu_auto_add()
handle_auto_add()
get_menu_locations()
handle_locations()
get_item_schema()
Class: WP_REST_Menus_Controller - X-Ref
Core class used to managed menu terms associated via the REST API.get_items_permissions_check( $request ) X-Ref |
Checks if a request has access to read menus. param: WP_REST_Request $request Full details about the request. return: bool|WP_Error True if the request has read access, otherwise false or WP_Error object. since: 5.9.0 |
get_item_permissions_check( $request ) X-Ref |
Checks if a request has access to read or edit the specified menu. param: WP_REST_Request $request Full details about the request. return: bool|WP_Error True if the request has read access for the item, otherwise false or WP_Error object. since: 5.9.0 |
get_term( $id ) X-Ref |
Gets the term, if the ID is valid. param: int $id Supplied ID. return: WP_Term|WP_Error Term object if ID is valid, WP_Error otherwise. since: 5.9.0 |
check_has_read_only_access( $request ) X-Ref |
Checks whether the current user has read permission for the endpoint. This allows for any user that can `edit_theme_options` or edit any REST API available post type. param: WP_REST_Request $request Full details about the request. return: bool|WP_Error Whether the current user has permission. since: 5.9.0 |
prepare_item_for_response( $term, $request ) X-Ref |
Prepares a single term output for response. param: WP_Term $term Term object. param: WP_REST_Request $request Request object. return: WP_REST_Response Response object. since: 5.9.0 |
prepare_links( $term ) X-Ref |
Prepares links for the request. param: WP_Term $term Term object. return: array Links for the given term. since: 5.9.0 |
prepare_item_for_database( $request ) X-Ref |
Prepares a single term for create or update. param: WP_REST_Request $request Request object. return: object Prepared term data. since: 5.9.0 |
create_item( $request ) X-Ref |
Creates a single term in a taxonomy. param: WP_REST_Request $request Full details about the request. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 5.9.0 |
update_item( $request ) X-Ref |
Updates a single term from a taxonomy. param: WP_REST_Request $request Full details about the request. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 5.9.0 |
delete_item( $request ) X-Ref |
Deletes a single term from a taxonomy. param: WP_REST_Request $request Full details about the request. return: WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. since: 5.9.0 |
get_menu_auto_add( $menu_id ) X-Ref |
Returns the value of a menu's auto_add setting. param: int $menu_id The menu id to query. return: bool The value of auto_add. since: 5.9.0 |
handle_auto_add( $menu_id, $request ) X-Ref |
Updates the menu's auto add from a REST request. param: int $menu_id The menu id to update. param: WP_REST_Request $request Full details about the request. return: bool True if the auto add setting was successfully updated. since: 5.9.0 |
get_menu_locations( $menu_id ) X-Ref |
Returns the names of the locations assigned to the menu. param: int $menu_id The menu id. return: string[] The locations assigned to the menu. since: 5.9.0 |
handle_locations( $menu_id, $request ) X-Ref |
Updates the menu's locations from a REST request. param: int $menu_id The menu id to update. param: WP_REST_Request $request Full details about the request. return: true|WP_Error True on success, a WP_Error on an error updating any of the locations. since: 5.9.0 |
get_item_schema() X-Ref |
Retrieves the term's schema, conforming to JSON Schema. return: array Item schema data. since: 5.9.0 |
Generated: Fri Oct 4 01:00:02 2024 | Cross-referenced by PHPXref 0.7.1 |