Make WordPress Core


Ignore:
Timestamp:
01/09/2010 10:03:55 AM (16 years ago)
Author:
westi
Message:

Add missing version numbers to _deprecated_argument() calls.
Remove deprecated argument from xfn_check() calls.
Pass version number to deprecated_file_included, deprecated_function_run and deprecated_argument_run actions.
Fixes #11386 props nacin.

File:
1 edited

Legend:

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

    r12669 r12680  
    11711171function wp_get_http( $url, $file_path = false, $deprecated = false ) {
    11721172    if ( !empty( $deprecated ) )
    1173         _deprecated_argument( __FUNCTION__, '0.0' );
     1173        _deprecated_argument( __FUNCTION__, '2.7' );
    11741174
    11751175    @set_time_limit( 60 );
     
    12161216function wp_get_http_headers( $url, $deprecated = false ) {
    12171217    if ( !empty( $deprecated ) )
    1218         _deprecated_argument( __FUNCTION__, '0.0' );
     1218        _deprecated_argument( __FUNCTION__, '2.7' );
    12191219
    12201220    $response = wp_remote_head( $url );
     
    21542154 *
    21552155 * @param string $name
    2156  * @param null $deprecated Not used. Set to null.
     2156 * @param null $deprecated Never used. Set to null.
    21572157 * @param mixed $bits File content
    21582158 * @param string $time Optional. Time formatted in 'yyyy/mm'.
     
    21612161function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
    21622162    if ( !empty( $deprecated ) )
    2163         _deprecated_argument( __FUNCTION__, '0.0' );
     2163        _deprecated_argument( __FUNCTION__, '2.0' );
    21642164
    21652165    if ( empty( $name ) )
     
    29622962 *
    29632963 * @package WordPress
    2964  * @package Debug
     2964 * @subpackage Debug
    29652965 * @since 2.5.0
    29662966 * @access private
    29672967 *
    2968  * @uses do_action() Calls 'deprecated_function_run' and passes the function name and what to use instead.
    2969  * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
     2968 * @uses do_action() Calls 'deprecated_function_run' and passes the function name, what to use instead,
     2969 *   and the version the function was deprecated in.
     2970 * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do
     2971 *   trigger or false to not trigger error.
    29702972 *
    29712973 * @param string $function The function that was called
     
    29732975 * @param string $replacement Optional. The function that should have been called
    29742976 */
    2975 function _deprecated_function($function, $version, $replacement=null) {
    2976 
    2977     do_action('deprecated_function_run', $function, $replacement);
     2977function _deprecated_function( $function, $version, $replacement=null ) {
     2978
     2979    do_action( 'deprecated_function_run', $function, $replacement, $version );
    29782980
    29792981    // Allow plugin to filter the output error trigger
    2980     if( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true )) {
    2981         if( !is_null($replacement) )
     2982    if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
     2983        if ( ! is_null($replacement) )
    29822984            trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
    29832985        else
     
    29983000 *
    29993001 * @package WordPress
    3000  * @package Debug
     3002 * @subpackage Debug
    30013003 * @since 2.5.0
    30023004 * @access private
    30033005 *
    3004  * @uses do_action() Calls 'deprecated_file_included' and passes the file name and what to use instead.
    3005  * @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
     3006 * @uses do_action() Calls 'deprecated_file_included' and passes the file name, what to use instead,
     3007 *   and the version in which the file was deprecated.
     3008 * @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do
     3009 *   trigger or false to not trigger error.
    30063010 *
    30073011 * @param string $file The file that was included
     
    30093013 * @param string $replacement Optional. The file that should have been included based on ABSPATH
    30103014 */
    3011 function _deprecated_file($file, $version, $replacement=null) {
    3012 
    3013     do_action('deprecated_file_included', $file, $replacement);
     3015function _deprecated_file( $file, $version, $replacement = null ) {
     3016
     3017    do_action( 'deprecated_file_included', $file, $replacement, $version );
    30143018
    30153019    // Allow plugin to filter the output error trigger
    3016     if( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
    3017         if( !is_null($replacement) )
     3020    if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
     3021        if ( ! is_null( $replacement ) )
    30183022            trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) );
    30193023        else
     
    30303034 * <code>
    30313035 * if ( !empty($deprecated) )
    3032  *  _deprecated_argument( __FUNCTION__, '0.0' );
     3036 *  _deprecated_argument( __FUNCTION__, '3.0' );
    30333037 * </code>
    30343038 *
     
    30403044 *
    30413045 * @package WordPress
    3042  * @package Debug
     3046 * @subpackage Debug
    30433047 * @since 3.0.0
    30443048 * @access private
    30453049 *
    3046  * @uses do_action() Calls 'deprecated_argument_run' and passes the function name and what to use instead.
    3047  * @uses apply_filters() Calls 'deprecated_argument_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
     3050 * @uses do_action() Calls 'deprecated_argument_run' and passes the function name, a message on the change,
     3051 *   and the version in which the argument was deprecated.
     3052 * @uses apply_filters() Calls 'deprecated_argument_trigger_error' and expects boolean value of true to do
     3053 *   trigger or false to not trigger error.
    30483054 *
    30493055 * @param string $function The function that was called
     
    30513057 * @param string $message Optional. A message regarding the change.
    30523058 */
    3053 function _deprecated_argument($function, $version, $message = null) {
    3054 
    3055     do_action('deprecated_argument_run', $function, $message);
     3059function _deprecated_argument( $function, $version, $message = null ) {
     3060
     3061    do_action( 'deprecated_argument_run', $function, $message );
    30563062
    30573063    // Allow plugin to filter the output error trigger
    3058     if( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
    3059         if( !is_null($message) )
     3064    if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
     3065        if ( ! is_null( $message ) )
    30603066            trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
    30613067        else
Note: See TracChangeset for help on using the changeset viewer.