Make WordPress Core


Ignore:
Timestamp:
12/30/2009 04:23:39 PM (15 years ago)
Author:
westi
Message:

Updates and improvements to _depreceated_argument. See #11386 props nacin.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r12581 r12584  
    571571 */
    572572function add_option( $name, $value = '', $deprecated = '', $autoload = 'yes' ) {
     573    if ( !empty( $deprecated ) )
     574        _deprecated_argument( __FUNCTION__, '2.3' );
     575
    573576    global $wpdb;
    574577
     
    12041207 */
    12051208function wp_get_http( $url, $file_path = false, $deprecated = false ) {
     1209    if ( !empty( $deprecated ) )
     1210        _deprecated_argument( __FUNCTION__, '0.0' );
     1211
    12061212    @set_time_limit( 60 );
    12071213
     
    12461252 */
    12471253function wp_get_http_headers( $url, $deprecated = false ) {
     1254    if ( !empty( $deprecated ) )
     1255        _deprecated_argument( __FUNCTION__, '0.0' );
     1256
    12481257    $response = wp_remote_head( $url );
    12491258
     
    21882197 */
    21892198function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
     2199    if ( !empty( $deprecated ) )
     2200        _deprecated_argument( __FUNCTION__, '0.0' );
     2201
    21902202    if ( empty( $name ) )
    21912203        return array( 'error' => __( 'Empty filename' ) );
     
    30403052 * <code>
    30413053 * if ( !empty($deprecated) )
    3042  *  _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     3054 *  _deprecated_argument( __FUNCTION__, '0.0' );
    30433055 * </code>
    30443056 *
     
    30543066 * @access private
    30553067 *
    3056  * @uses do_action() Calls 'deprecated_argument_run' and passes the function and argument names and what to use instead.
     3068 * @uses do_action() Calls 'deprecated_argument_run' and passes the function name and what to use instead.
    30573069 * @uses apply_filters() Calls 'deprecated_argument_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
    30583070 *
    30593071 * @param string $function The function that was called
    3060  * @param string $argument The name of the deprecated argument that was used
    3061  * @param string $version The version of WordPress that deprecated the function
     3072 * @param string $version The version of WordPress that deprecated the argument used
    30623073 * @param string $message Optional. A message regarding the change.
    30633074 */
    3064 function _deprecated_argument($function, $argument, $version, $message = null) {
    3065 
    3066     do_action('deprecated_argument_run', $function, $argument, $message);
     3075function _deprecated_argument($function, $version, $message = null) {
     3076
     3077    do_action('deprecated_argument_run', $function, $message);
    30673078
    30683079    // Allow plugin to filter the output error trigger
    30693080    if( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
    30703081        if( !is_null($message) )
    3071             trigger_error( sprintf( __('The %1$s argument of %2$s is <strong>deprecated</strong> since version %3$s! %4$s'), $function, $argument, $version, $message ) );
     3082            trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
    30723083        else
    3073             trigger_error( sprintf( __('The %1$s argument of %2$s is <strong>deprecated</strong> since version %3$s with no alternative available.'), $function, $argument, $version ) );
     3084            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 ) );
    30743085    }
    30753086}
Note: See TracChangeset for help on using the changeset viewer.