rest_prepare_menu_location WordPress Filter Hook

The rest_prepare_menu_location hook is used to modify the response object before it is returned for a request. This hook allows you to add or remove data from the response object, or even change the response code.

apply_filters( 'rest_prepare_menu_location', WP_REST_Response $response, object $location, WP_REST_Request $request ) #

Filters menu location data returned from the REST API.


Parameters

$response

(WP_REST_Response)The response object.

$location

(object)The original location object.

$request

(WP_REST_Request)Request used to generate the response.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-menu-locations-controller.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.