Filters whether the current user has read access to menu items via the REST API.
$read_only_accessbool$requestWP_REST_Request$thisWP_REST_Controllerwp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php:93WP_REST_Menu_Items_Controller::check_has_read_only_access()wp-includes/rest-api/endpoints/class-wp-rest-menu-locations-controller.php:154WP_REST_Menu_Locations_Controller::check_has_read_only_access()wp-includes/rest-api/endpoints/class-wp-rest-menus-controller.php:88WP_REST_Menus_Controller::check_has_read_only_access() * * @param bool $read_only_access Whether the current user has read access to menu items * via the REST API. * @param WP_REST_Request $request Full details about the request. * @param WP_REST_Controller $this The current instance of the controller. */ $read_only_access = apply_filters( 'rest_menu_read_access', false, $request, $this ); if ( $read_only_access ) { return true; } if ( current_user_can( 'edit_theme_options' ) ) { return true;Introduced in 6.8.0. 2 changes between 6.8.8 and 7.1.0.
Signature, return type and hooks compared across 4 parsed releases.
$controller added.verified against source$this removed.verified against source