Make WordPress Core

Ticket #34183: 34183.diff

File 34183.diff, 1.2 KB (added by flixos90, 9 years ago)

Added the three function arguments to the filter to allow catching specific warnings

  • src/wp-includes/functions.php

     
    37743774         * Filter whether to trigger an error for _doing_it_wrong() calls.
    37753775         *
    37763776         * @since 3.1.0
     3777         * @since 4.4.0 Added the `$function`, `$message` and `$version` arguments to allow catching specific warnings.
    37773778         *
    37783779         * @param bool $trigger Whether to trigger the error for _doing_it_wrong() calls. Default true.
     3780         * @param string $function The function that was called.
     3781         * @param string $message  A message explaining what has been done incorrectly.
     3782         * @param string $version  The version of WordPress where the message was added.
    37793783         */
    3780         if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
     3784        if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true, $function, $message, $version ) ) {
    37813785                if ( function_exists( '__' ) ) {
    37823786                        $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
    37833787                        $message .= ' ' . __( 'Please see <a href="https://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' );