rest_handle_doing_it_wrong() – Handles _doing_it_wrong errors.

Description

Handles _doing_it_wrong errors.

Usage

rest_handle_doing_it_wrong( $function, $message, $version );

Parameters

$function
( string ) required – The function that was called.
$message
( string ) required – A message explaining what has been done incorrectly.
$version
( string|null ) required – The version of WordPress where the message was added.

Returns

void

Source

File name: wordpress/wp-includes/rest-api.php
Lines:

1 to 17 of 17
function rest_handle_doing_it_wrong( $function, $message, $version ) {
  if ( ! WP_DEBUG || headers_sent() ) {
    return;
  }

  if ( $version ) {
    /* translators: Developer debugging message. 1: PHP function name, 2: WordPress version number, 3: Explanatory message. */
    $string = __( '%1$s (since %2$s; %3$s)' );
    $string = sprintf( $string, $function, $version, $message );
  } else {
    /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message. */
    $string = __( '%1$s (%2$s)' );
    $string = sprintf( $string, $function, $message );
  }

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

 View on GitHub View on Trac

Called by

    Invoked by

      Call hooks

      API Letters: ,,,,