Ticket #23062: 23062.diff
| File 23062.diff, 4.1 KB (added by nacin, 5 months ago) |
|---|
-
wp-includes/functions.php
2821 2821 // Allow plugin to filter the output error trigger 2822 2822 if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) { 2823 2823 if ( ! is_null($replacement) ) 2824 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );2824 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ), _wp_debug_error_type() ); 2825 2825 else 2826 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );2826 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ), _wp_debug_error_type() ); 2827 2827 } 2828 2828 } 2829 2829 … … 2861 2861 if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) { 2862 2862 $message = empty( $message ) ? '' : ' ' . $message; 2863 2863 if ( ! is_null( $replacement ) ) 2864 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message );2864 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) . $message, _wp_debug_error_type() ); 2865 2865 else 2866 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) . $message );2866 trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) . $message, _wp_debug_error_type() ); 2867 2867 } 2868 2868 } 2869 2869 /** … … 2905 2905 // Allow plugin to filter the output error trigger 2906 2906 if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) { 2907 2907 if ( ! is_null( $message ) ) 2908 trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );2908 trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ), _wp_debug_error_type() ); 2909 2909 else 2910 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 ) );2910 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 ), _wp_debug_error_type() ); 2911 2911 } 2912 2912 } 2913 2913 … … 2941 2941 if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) { 2942 2942 $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version ); 2943 2943 $message .= ' ' . __( 'Please see <a href="http://codex.wordpress.org/Debugging_in_WordPress">Debugging in WordPress</a> for more information.' ); 2944 trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ) );2944 trigger_error( sprintf( __( '%1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), $function, $message, $version ), _wp_debug_error_type() ); 2945 2945 } 2946 2946 } 2947 2947 2948 2948 /** 2949 * Returns the error type that should be used for deprecated and wrong behavior. 2950 * 2951 * Normally, E_USER_NOTICE is issued. E_USER_WARNING is issued for development builds (up to RC1). 2952 * 2953 * @subpackage Debug 2954 * @since 3.6.0 2955 * @access private 2956 */ 2957 function _wp_debug_error_type() { 2958 static $error_type = null; 2959 if ( isset( $error_type ) ) 2960 return $error_type; 2961 2962 include ABSPATH . WPINC . '/version.php'; 2963 $error_type = E_USER_NOTICE; 2964 if ( strpos( $wp_version, '-' ) && ( strpos( $wp_version, '-alpha' ) || strpos( $wp_version, '-beta' ) || strpos( $wp_version, '-RC1' ) ) ) 2965 $error_type = E_USER_WARNING; 2966 return $error_type; 2967 } 2968 2969 /** 2949 2970 * Is the server running earlier than 1.5.0 version of lighttpd? 2950 2971 * 2951 2972 * @since 2.5.0
