W3cubDocs

/WordPress

rest_handle_deprecated_argument( string $function, string $message, string $version )

Handles _deprecated_argument() errors.

Parameters

$function

(string) (Required) The function that was called.

$message

(string) (Required) A message regarding the change.

$version

(string) (Required) Version.

Source

File: wp-includes/rest-api.php

function rest_handle_deprecated_argument( $function, $message, $version ) {
	if ( ! WP_DEBUG || headers_sent() ) {
		return;
	}
	if ( $message ) {
		/* translators: 1: Function name, 2: WordPress version number, 3: Error message. */
		$string = sprintf( __( '%1$s (since %2$s; %3$s)' ), $function, $version, $message );
	} else {
		/* translators: 1: Function name, 2: WordPress version number. */
		$string = sprintf( __( '%1$s (since %2$s; no alternative available)' ), $function, $version );
	}

	header( sprintf( 'X-WP-DeprecatedParam: %s', $string ) );
}

Changelog

Version Description
4.4.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/rest_handle_deprecated_argument