Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: rest_jsonp_enabled

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
266           $enabled = apply_filters( 'rest_enabled', true );
267
268           /**
269            * Filters whether jsonp is enabled.
270            *
271            * @since 4.4.0
272            *
273            * @param bool $jsonp_enabled Whether jsonp is enabled. Default true.
274            */
275           $jsonp_enabled = apply_filters( 'rest_jsonp_enabled', true );
276
277           $jsonp_callback = null;
278
279           if ( ! $enabled ) {
280                echo $this->json_error( 'rest_disabled', __( 'The REST API is disabled on this site.' ), 404 );
281                return false;
282           }
283           if ( isset( $_GET['_jsonp'] ) ) {
284                if ( ! $jsonp_enabled ) {