Make WordPress Core

Ticket #24778: 24778.patch

File 24778.patch, 4.0 KB (added by SergeyBiryukov, 12 years ago)
  • wp-includes/functions.php

     
    28642864
    28652865        // Allow plugin to filter the output error trigger
    28662866        if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
    2867                 if ( ! is_null($replacement) )
    2868                         trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
    2869                 else
    2870                         trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
     2867                if ( function_exists( '__' ) ) {
     2868                        if ( ! is_null( $replacement ) )
     2869                                trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
     2870                        else
     2871                                trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
     2872                } else {
     2873                        if ( ! is_null( $replacement ) )
     2874                                trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $function, $version, $replacement ) );
     2875                        else
     2876                                trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $function, $version ) );
     2877                }
    28712878        }
    28722879}
    28732880
     
    29042911        // Allow plugin to filter the output error trigger
    29052912        if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
    29062913                $message = empty( $message ) ? '' : ' ' . $message;
    2907                 if ( ! is_null( $replacement ) )
    2908                         trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message );
    2909                 else
    2910                         trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) . $message );
     2914                if ( function_exists( '__' ) ) {
     2915                        if ( ! is_null( $replacement ) )
     2916                                trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message );
     2917                        else
     2918                                trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) . $message );
     2919                } else {
     2920                        if ( ! is_null( $replacement ) )
     2921                                trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', $file, $version, $replacement ) . $message );
     2922                        else
     2923                                trigger_error( sprintf( '%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', $file, $version ) . $message );
     2924                }
    29112925        }
    29122926}
    29132927/**
     
    29482962
    29492963        // Allow plugin to filter the output error trigger
    29502964        if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
    2951                 if ( ! is_null( $message ) )
    2952                         trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
    2953                 else
    2954                         trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
     2965                if ( function_exists( '__' ) ) {
     2966                        if ( ! is_null( $message ) )
     2967                                trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
     2968                        else
     2969                                trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
     2970                } else {
     2971                        if ( ! is_null( $message ) )
     2972                                trigger_error( sprintf( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s', $function, $version, $message ) );
     2973                        else
     2974                                trigger_error( sprintf( '%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.', $function, $version ) );
     2975                }
    29552976        }
    29562977}
    29572978