Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: rest_prepare_widget

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
731           /**
732            * Filters the REST API response for a widget.
733            *
734            * @since 5.8.0
735            *
736            * @param WP_REST_Response|WP_Error $response The response object, or WP_Error object on failure.
737            * @param array                     $widget   The registered widget data.
738            * @param WP_REST_Request           $request  Request used to generate the response.
739            */
740           return apply_filters( 'rest_prepare_widget', $response, $widget, $request );
741      }
742
743      /**
744       * Prepares links for the widget.
745       *
746       * @since 5.8.0
747       *
748       * @param array $prepared Widget.
749       * @return array Links for the given widget.