WordPress.org

Make WordPress Core

Changeset 12680


Ignore:
Timestamp:
01/09/2010 10:03:55 AM (11 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.

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/image.php

    r12659 r12680  
    1818 * @param mixed $file Filename of the original image, Or attachment id.
    1919 * @param int $max_side Maximum length of a single side for the thumbnail.
    20  * @param mixed $deprecated Not used.
     20 * @param mixed $deprecated Never used.
    2121 * @return string Thumbnail path on success, Error string on failure.
    2222 */
    2323function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
    2424    if ( !empty( $deprecated ) )
    25         _deprecated_argument( __FUNCTION__, '0.0' );
     25        _deprecated_argument( __FUNCTION__, '1.2' );
    2626    $thumbpath = image_resize( $file, $max_side, $max_side );
    2727    return apply_filters( 'wp_create_thumbnail', $thumbpath );
  • trunk/wp-admin/includes/meta-boxes.php

    r12597 r12680  
    637637 * @param string $class
    638638 * @param string $value
    639  * @param mixed $deprecated Not used.
    640  */
    641 function xfn_check($class, $value = '', $deprecated = '') {
     639 * @param mixed $deprecated Never used.
     640 */
     641function xfn_check( $class, $value = '', $deprecated = '' ) {
    642642    global $link;
    643643
    644644    if ( !empty( $deprecated ) )
    645         _deprecated_argument( __FUNCTION__, '0.0' );
     645        _deprecated_argument( __FUNCTION__, '0.0' ); // Never implemented
    646646
    647647    $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
     
    690690                    <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </span></legend>
    691691                        <label for="contact">
    692                         <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?></label>
     692                        <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('contact') ?></label>
    693693                        <label for="acquaintance">
    694                         <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> />  <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?></label>
     694                        <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance'); ?> />  <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('acquaintance') ?></label>
    695695                        <label for="friend">
    696                         <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?></label>
     696                        <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friend') ?></label>
    697697                        <label for="friendship">
    698                         <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
     698                        <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship'); ?> /> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
    699699                    </fieldset></td>
    700700                </tr>
     
    722722                    <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </span></legend>
    723723                        <label for="co-resident">
    724                         <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
     724                        <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident'); ?> />
    725725                        <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('co-resident') ?></label>
    726726                        <label for="neighbor">
    727                         <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
     727                        <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor'); ?> />
    728728                        <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('neighbor') ?></label>
    729729                        <label for="geographical">
    730                         <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
     730                        <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical'); ?> />
    731731                        <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
    732732                    </fieldset></td>
     
    736736                    <td><fieldset><legend class="screen-reader-text"><span> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </span></legend>
    737737                        <label for="child">
    738                         <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?>  />
     738                        <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child'); ?>  />
    739739                        <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('child') ?></label>
    740740                        <label for="kin">
    741                         <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?>  />
     741                        <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin'); ?>  />
    742742                        <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('kin') ?></label>
    743743                        <label for="parent">
    744                         <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
     744                        <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent'); ?> />
    745745                        <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('parent') ?></label>
    746746                        <label for="sibling">
    747                         <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
     747                        <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling'); ?> />
    748748                        <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('sibling') ?></label>
    749749                        <label for="spouse">
    750                         <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
     750                        <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse'); ?> />
    751751                        <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('spouse') ?></label>
    752752                        <label for="family">
    753                         <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
     753                        <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family'); ?> />
    754754                        <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('none') ?></label>
    755755                    </fieldset></td>
  • trunk/wp-includes/author-template.php

    r12598 r12680  
    2525
    2626    if ( !empty( $deprecated ) )
    27         _deprecated_argument( __FUNCTION__, '0.0' );
     27        _deprecated_argument( __FUNCTION__, '2.1' );
    2828
    2929    return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
     
    5050 */
    5151function the_author( $deprecated = '', $deprecated_echo = true ) {
    52     if ( !empty( $deprecated ) || $deprecated_echo !== true )
    53         _deprecated_argument( __FUNCTION__, '1.5', $deprecated_echo !== true ? __('Use get_the_author() instead if you do not want the value echoed.') : null );
     52    if ( !empty( $deprecated ) )
     53        _deprecated_argument( __FUNCTION__, '2.1' );
     54    if ( $deprecated_echo !== true )
     55        _deprecated_argument( __FUNCTION__, '1.5', __('Use get_the_author() instead if you do not want the value echoed.') );
    5456    if ( $deprecated_echo )
    5557        echo get_the_author();
     
    185187function the_author_posts_link($deprecated = '') {
    186188    if ( !empty( $deprecated ) )
    187         _deprecated_argument( __FUNCTION__, '0.0' );
     189        _deprecated_argument( __FUNCTION__, '2.1' );
    188190
    189191    global $authordata;
  • trunk/wp-includes/comment-template.php

    r12657 r12680  
    505505 *
    506506 * @param string $deprecated Not Used
    507  * @param bool $deprecated Not Used
    508  */
    509 function comments_link( $deprecated = '', $deprecated = '' ) {
     507 * @param bool $deprecated_2 Not Used
     508 */
     509function comments_link( $deprecated = '', $deprecated_2 = '' ) {
    510510    if ( !empty( $deprecated ) )
    511         _deprecated_argument( __FUNCTION__, '0.0' );
     511        _deprecated_argument( __FUNCTION__, '0.72' );
     512    if ( !empty( $deprecated_2 ) )
     513        _deprecated_argument( __FUNCTION__, '1.3' );
    512514    echo get_comments_link();
    513515}
     
    554556
    555557    if ( !empty( $deprecated ) )
    556         _deprecated_argument( __FUNCTION__, '0.0' );
     558        _deprecated_argument( __FUNCTION__, '1.3' );
    557559
    558560    $number = get_comments_number($id);
  • trunk/wp-includes/comment.php

    r12598 r12680  
    15141514function discover_pingback_server_uri( $url, $deprecated = '' ) {
    15151515    if ( !empty( $deprecated ) )
    1516         _deprecated_argument( __FUNCTION__, '0.0' );
     1516        _deprecated_argument( __FUNCTION__, '2.7' );
    15171517
    15181518    $pingback_str_dquote = 'rel="pingback"';
  • trunk/wp-includes/formatting.php

    r12584 r12680  
    868868function convert_chars($content, $deprecated = '') {
    869869    if ( !empty( $deprecated ) )
    870         _deprecated_argument( __FUNCTION__, '0.0' );
     870        _deprecated_argument( __FUNCTION__, '0.71' );
    871871
    872872    // Translation of invalid Unicode references range to valid range
  • 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
  • trunk/wp-includes/kses.php

    r12584 r12680  
    11971197add_action('set_current_user', 'kses_init');
    11981198
     1199/**
     1200 * Inline CSS filter
     1201 *
     1202 * @since 2.8.1
     1203 */
    11991204function safecss_filter_attr( $css, $deprecated = '' ) {
    12001205    if ( !empty( $deprecated ) )
    1201         _deprecated_argument( __FUNCTION__, '0.0' );
     1206        _deprecated_argument( __FUNCTION__, '2.8.1' ); // Never implemented
    12021207
    12031208    $css = wp_kses_no_null($css);
  • trunk/wp-includes/link-template.php

    r12598 r12680  
    171171function post_permalink( $post_id = 0, $deprecated = '' ) {
    172172    if ( !empty( $deprecated ) )
    173         _deprecated_argument( __FUNCTION__, '0.0' );
     173        _deprecated_argument( __FUNCTION__, '1.3' );
    174174
    175175    return get_permalink($post_id);
  • trunk/wp-includes/post-template.php

    r12664 r12680  
    904904function the_attachment_link( $id = 0, $fullsize = false, $deprecated = false, $permalink = false ) {
    905905    if ( !empty( $deprecated ) )
    906         _deprecated_argument( __FUNCTION__, '0.0' );
     906        _deprecated_argument( __FUNCTION__, '2.5' );
    907907
    908908    if ( $fullsize )
  • trunk/wp-includes/widgets.php

    r12584 r12680  
    986986function wp_get_sidebars_widgets($deprecated = true) {
    987987    if ( $deprecated !== true )
    988         _deprecated_argument( __FUNCTION__, '0.0' );
     988        _deprecated_argument( __FUNCTION__, '2.8.1' );
    989989
    990990    global $wp_registered_widgets, $wp_registered_sidebars, $_wp_sidebars_widgets;
Note: See TracChangeset for help on using the changeset viewer.