rest_jsonp_enabled filter-hookWP 4.4.0

Filters whether JSONP is enabled for the REST API.

Usage

add_filter( 'rest_jsonp_enabled', 'wp_kama_rest_jsonp_enabled_filter' );

/**
 * Function for `rest_jsonp_enabled` filter-hook.
 * 
 * @param bool $jsonp_enabled Whether JSONP is enabled.
 *
 * @return bool
 */
function wp_kama_rest_jsonp_enabled_filter( $jsonp_enabled ){

	// filter...
	return $jsonp_enabled;
}
$jsonp_enabled(true|false)
Whether JSONP is enabled.
Default: true

Changelog

Since 4.4.0 Introduced.

Where the hook is called

WP_REST_Server::serve_request()
rest_jsonp_enabled
wp_is_jsonp_request()
rest_jsonp_enabled
wp-includes/rest-api/class-wp-rest-server.php 274
$jsonp_enabled = apply_filters( 'rest_jsonp_enabled', true );
wp-includes/load.php 1682
$jsonp_enabled = apply_filters( 'rest_jsonp_enabled', true );

Where the hook is used in WordPress

Usage not found.