WordPress.org

Make WordPress Core

Ticket #11386: 11386.10.diff

File 11386.10.diff, 20.0 KB (added by nacin, 8 years ago)

Patch 9, plus $version added to the three deprecated_* actions.

  • wp-includes/post-template.php

     
    903903 */
    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 )
    909909                echo wp_get_attachment_link($id, 'full', $permalink);
  • wp-includes/comment.php

     
    15131513 */
    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"';
    15191519        $pingback_str_squote = 'rel=\'pingback\'';
  • wp-includes/functions.php

     
    12071207 */
    12081208function wp_get_http( $url, $file_path = false, $deprecated = false ) {
    12091209        if ( !empty( $deprecated ) )
    1210                 _deprecated_argument( __FUNCTION__, '0.0' );
     1210                _deprecated_argument( __FUNCTION__, '2.7' );
    12111211
    12121212        @set_time_limit( 60 );
    12131213
     
    12521252 */
    12531253function wp_get_http_headers( $url, $deprecated = false ) {
    12541254        if ( !empty( $deprecated ) )
    1255                 _deprecated_argument( __FUNCTION__, '0.0' );
     1255                _deprecated_argument( __FUNCTION__, '2.7' );
    12561256
    12571257        $response = wp_remote_head( $url );
    12581258
     
    21902190 * @since 2.0.0
    21912191 *
    21922192 * @param string $name
    2193  * @param null $deprecated Not used. Set to null.
     2193 * @param null $deprecated Never used. Set to null.
    21942194 * @param mixed $bits File content
    21952195 * @param string $time Optional. Time formatted in 'yyyy/mm'.
    21962196 * @return array
    21972197 */
    21982198function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
    21992199        if ( !empty( $deprecated ) )
    2200                 _deprecated_argument( __FUNCTION__, '0.0' );
     2200                _deprecated_argument( __FUNCTION__, '2.0' );
    22012201
    22022202        if ( empty( $name ) )
    22032203                return array( 'error' => __( 'Empty filename' ) );
     
    29832983 * This function is to be used in every function in depreceated.php
    29842984 *
    29852985 * @package WordPress
    2986  * @package Debug
     2986 * @subpackage Debug
    29872987 * @since 2.5.0
    29882988 * @access private
    29892989 *
    2990  * @uses do_action() Calls 'deprecated_function_run' and passes the function name and what to use instead.
    2991  * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
     2990 * @uses do_action() Calls 'deprecated_function_run' and passes the function name, what to use instead,
     2991 *   and the version the function was deprecated in.
     2992 * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do
     2993 *   trigger or false to not trigger error.
    29922994 *
    29932995 * @param string $function The function that was called
    29942996 * @param string $version The version of WordPress that deprecated the function
    29952997 * @param string $replacement Optional. The function that should have been called
    29962998 */
    2997 function _deprecated_function($function, $version, $replacement=null) {
     2999function _deprecated_function( $function, $version, $replacement=null ) {
    29983000
    2999         do_action('deprecated_function_run', $function, $replacement);
     3001        do_action( 'deprecated_function_run', $function, $replacement, $version );
    30003002
    30013003        // Allow plugin to filter the output error trigger
    3002         if( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true )) {
    3003                 if( !is_null($replacement) )
     3004        if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
     3005                if ( ! is_null($replacement) )
    30043006                        trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $function, $version, $replacement ) );
    30053007                else
    30063008                        trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $function, $version ) );
     
    30193021 * This function is to be used in every file that is depreceated
    30203022 *
    30213023 * @package WordPress
    3022  * @package Debug
     3024 * @subpackage Debug
    30233025 * @since 2.5.0
    30243026 * @access private
    30253027 *
    3026  * @uses do_action() Calls 'deprecated_file_included' and passes the file name and what to use instead.
    3027  * @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
     3028 * @uses do_action() Calls 'deprecated_file_included' and passes the file name, what to use instead,
     3029 *   and the version in which the file was deprecated.
     3030 * @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do
     3031 *   trigger or false to not trigger error.
    30283032 *
    30293033 * @param string $file The file that was included
    30303034 * @param string $version The version of WordPress that deprecated the file
    30313035 * @param string $replacement Optional. The file that should have been included based on ABSPATH
    30323036 */
    3033 function _deprecated_file($file, $version, $replacement=null) {
     3037function _deprecated_file( $file, $version, $replacement = null ) {
    30343038
    3035         do_action('deprecated_file_included', $file, $replacement);
     3039        do_action( 'deprecated_file_included', $file, $replacement, $version );
    30363040
    30373041        // Allow plugin to filter the output error trigger
    3038         if( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
    3039                 if( !is_null($replacement) )
     3042        if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
     3043                if ( ! is_null( $replacement ) )
    30403044                        trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.'), $file, $version, $replacement ) );
    30413045                else
    30423046                        trigger_error( sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.'), $file, $version ) );
     
    30513055 * For example:
    30523056 * <code>
    30533057 * if ( !empty($deprecated) )
    3054  *      _deprecated_argument( __FUNCTION__, '0.0' );
     3058 *      _deprecated_argument( __FUNCTION__, '3.0' );
    30553059 * </code>
    30563060 *
    30573061 * There is a hook deprecated_argument_run that will be called that can be used
     
    30613065 * The current behavior is to trigger an user error if WP_DEBUG is true.
    30623066 *
    30633067 * @package WordPress
    3064  * @package Debug
     3068 * @subpackage Debug
    30653069 * @since 3.0.0
    30663070 * @access private
    30673071 *
    3068  * @uses do_action() Calls 'deprecated_argument_run' and passes the function name and what to use instead.
    3069  * @uses apply_filters() Calls 'deprecated_argument_trigger_error' and expects boolean value of true to do trigger or false to not trigger error.
     3072 * @uses do_action() Calls 'deprecated_argument_run' and passes the function name, a message on the change,
     3073 *   and the version in which the argument was deprecated.
     3074 * @uses apply_filters() Calls 'deprecated_argument_trigger_error' and expects boolean value of true to do
     3075 *   trigger or false to not trigger error.
    30703076 *
    30713077 * @param string $function The function that was called
    30723078 * @param string $version The version of WordPress that deprecated the argument used
    30733079 * @param string $message Optional. A message regarding the change.
    30743080 */
    3075 function _deprecated_argument($function, $version, $message = null) {
     3081function _deprecated_argument( $function, $version, $message = null ) {
    30763082
    3077         do_action('deprecated_argument_run', $function, $message);
     3083        do_action( 'deprecated_argument_run', $function, $message );
    30783084
    30793085        // Allow plugin to filter the output error trigger
    3080         if( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
    3081                 if( !is_null($message) )
     3086        if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
     3087                if ( ! is_null( $message ) )
    30823088                        trigger_error( sprintf( __('%1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s'), $function, $version, $message ) );
    30833089                else
    30843090                        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-includes/comment-template.php

     
    504504 * @since 0.71
    505505 *
    506506 * @param string $deprecated Not Used
    507  * @param bool $deprecated Not Used
     507 * @param bool $deprecated_2 Not Used
    508508 */
    509 function comments_link( $deprecated = '', $deprecated = '' ) {
     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}
    514516
     
    553555        global $id;
    554556
    555557        if ( !empty( $deprecated ) )
    556                 _deprecated_argument( __FUNCTION__, '0.0' );
     558                _deprecated_argument( __FUNCTION__, '1.3' );
    557559
    558560        $number = get_comments_number($id);
    559561
  • wp-includes/link-template.php

     
    170170 */
    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);
    176176}
  • wp-includes/formatting.php

     
    867867 */
    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
    873873        $wp_htmltranswinuni = array(
  • wp-includes/author-template.php

     
    2424        global $authordata;
    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);
    3030}
     
    4949 * @return string The author's display name, from get_the_author().
    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();
    5658        return get_the_author();
     
    184186 */
    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;
    190192        $link = sprintf(
  • wp-includes/kses.php

     
    11961196add_action('init', 'kses_init');
    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);
    12041209        $css = str_replace(array("\n","\r","\t"), '', $css);
  • wp-includes/widgets.php

     
    985985 */
    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;
    991991
  • wp-admin/includes/meta-boxes.php

     
    636636 *
    637637 * @param string $class
    638638 * @param string $value
    639  * @param mixed $deprecated Not used.
     639 * @param mixed $deprecated Never used.
    640640 */
    641 function xfn_check($class, $value = '', $deprecated = '') {
     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 ?: '';
    648648        $rels = preg_split('/\s+/', $link_rel);
     
    689689                                        <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('friendship') ?> </th>
    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>
    701701                                <tr>
     
    721721                                        <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('geographical') ?> </th>
    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>
    733733                                </tr>
     
    735735                                        <th scope="row"> <?php /* translators: xfn: http://gmpg.org/xfn/ */ _e('family') ?> </th>
    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>
    756756                                </tr>
  • wp-admin/includes/image.php

     
    1717 *
    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 );
    2828}