Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: rest_namespace_index

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1089            *
1090            * This typically is just the route data for the namespace, but you can
1091            * add any data you'd like here.
1092            *
1093            * @since 4.4.0
1094            *
1095            * @param WP_REST_Response $response Response data.
1096            * @param WP_REST_Request  $request  Request data. The namespace is passed as the 'namespace' parameter.
1097            */
1098           return apply_filters( 'rest_namespace_index', $response, $request );
1099      }
1100
1101      /**
1102       * Retrieves the publicly-visible data for routes.
1103       *
1104       * @since 4.4.0
1105       *
1106       * @param array  $routes  Routes to get data for.
1107       * @param string $context Optional. Context for data. Accepts 'view' or 'help'. Default 'view'.