wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_is_jsonp_request › WordPress Function

Seit5.2.0
Veraltetn/v
wp_is_jsonp_request ( Keine Parameter )
Gibt zurück:
  • (bool) True if JSONP request, false otherwise.
Definiert in:
Codex:

Checks whether current request is a JSONP request, or is expecting a JSONP response.



Quellcode

function wp_is_jsonp_request() {
	if ( ! isset( $_GET['_jsonp'] ) ) {
		return false;
	}

	if ( ! function_exists( 'wp_check_jsonp_callback' ) ) {
		require_once ABSPATH . WPINC . '/functions.php';
	}

	$jsonp_callback = $_GET['_jsonp'];
	if ( ! wp_check_jsonp_callback( $jsonp_callback ) ) {
		return false;
	}

	/** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */
	$jsonp_enabled = apply_filters( 'rest_jsonp_enabled', true );

	return $jsonp_enabled;
}