WordPress.org

Make WordPress Core

Ticket #23454: deprecated-function-enhancement.23454.diff

File deprecated-function-enhancement.23454.diff, 2.3 KB (added by mikejolley, 3 years ago)

Patch for #23454

  • wp-includes/functions.php

    diff --git wp-includes/functions.php wp-includes/functions.php
    index 5e0841c..6349ab8 100644
    function get_temp_dir() { 
    14371437/** 
    14381438 * Determine if a directory is writable. 
    14391439 * 
    1440  * This function is used to work around certain ACL issues  
     1440 * This function is used to work around certain ACL issues 
    14411441 * in PHP primarily affecting Windows Servers. 
    14421442 * 
    14431443 * @see win_is_writable() 
    function wp_is_writable( $path ) { 
    14571457/** 
    14581458 * Workaround for Windows bug in is_writable() function 
    14591459 * 
    1460  * PHP has issues with Windows ACL's for determine if a  
     1460 * PHP has issues with Windows ACL's for determine if a 
    14611461 * directory is writable or not, this works around them by 
    14621462 * checking the ability to open files rather than relying 
    14631463 * upon PHP to interprate the OS ACL. 
    function url_is_accessable_via_ssl($url) 
    28502850 * @param string $function The function that was called 
    28512851 * @param string $version The version of WordPress that deprecated the function 
    28522852 * @param string $replacement Optional. The function that should have been called 
     2853 * @param string $message Optional. A message regarding the change. 
    28532854 */ 
    2854 function _deprecated_function( $function, $version, $replacement = null ) { 
     2855function _deprecated_function( $function, $version, $replacement = null, $message = '' ) { 
    28552856 
    2856         do_action( 'deprecated_function_run', $function, $replacement, $version ); 
     2857        do_action( 'deprecated_function_run', $function, $replacement, $version, $message ); 
    28572858 
    28582859        // Allow plugin to filter the output error trigger 
    28592860        if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) { 
     2861                $message = empty( $message ) ? '' : ' ' . $message; 
    28602862                if ( ! is_null($replacement) ) 
    2861                         trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) ); 
     2863                        trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) . $message ); 
    28622864                else 
    2863                         trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) ); 
     2865                        trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) . $message ); 
    28642866        } 
    28652867} 
    28662868