rest_handle_deprecated_function

Advertisement

Summery Summery

Handles _deprecated_function() errors.

Syntax Syntax

rest_handle_deprecated_function( string $function, string $replacement, string $version )

Parameters Parameters

$function

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

$replacement

(string) (Required) The function that should have been called.

$version

(string) (Required) Version.

Source Source

File: wp-includes/rest-api.php

 *
 * This implements WP_REST_Response, allowing usage of `set_status`/`header`/etc
 * without needing to double-check the object. Will also allow WP_Error to indicate error
 * responses, so users should immediately check for this value.
 *
 * @since 4.4.0
 *
 * @param WP_REST_Response|WP_Error|WP_HTTP_Response|mixed $response Response to check.
 * @return WP_REST_Response|WP_Error If response generated an error, WP_Error, if response
 *                                   is already an instance, WP_REST_Response, otherwise
 *                                   returns a new WP_REST_Response instance.
 */
function rest_ensure_response( $response ) {
	if ( is_wp_error( $response ) ) {

Advertisement

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.