WordPress.org

Make WordPress Core

Ticket #11386: _deprecated_argument_in-the-wild.2.diff

File _deprecated_argument_in-the-wild.2.diff, 10.3 KB (added by nacin, 9 years ago)

Use this instead. Small change in trackback_url()

  • 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.
    2021 * @return string Thumbnail path on success, Error string on failure.
    2122 */
    2223function wp_create_thumbnail( $file, $max_side, $deprecated = '' ) {
     24        if ( !empty( $deprecated ) )
     25                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
    2326        $thumbpath = image_resize( $file, $max_side, $max_side );
    2427        return apply_filters( 'wp_create_thumbnail', $thumbpath );
    2528}
  • wp-admin/includes/meta-boxes.php

     
    639639function xfn_check($class, $value = '', $deprecated = '') {
    640640        global $link;
    641641
     642        if ( !empty( $deprecated ) )
     643                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     644
    642645        $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
    643646        $rels = preg_split('/\s+/', $link_rel);
    644647
  • wp-admin/includes/upgrade.php

     
    3333 * @param null $deprecated Optional. Not used.
    3434 * @return array Array keys 'url', 'user_id', 'password', 'password_message'.
    3535 */
    36 function wp_install($blog_title, $user_name, $user_email, $public, $deprecated='') {
     36function wp_install( $blog_title, $user_name, $user_email, $public, $deprecated = '' ) {
    3737        global $wp_rewrite;
    3838
     39        if ( !empty( $deprecated ) )
     40                _deprecated_argument( __FUNCTION__, 'deprecated', '2.6' );
     41
    3942        wp_check_mysql_version();
    4043        wp_cache_flush();
    4144        make_db_current_silent();
  • wp-app.php

     
    884884         *
    885885         * @since 2.2.0
    886886         *
    887          * @param mixed $deprecated Optional, not used.
     887         * @param mixed $deprecated Not used.
    888888         * @return string
    889889         */
    890890        function get_categories_url($deprecated = '') {
     891                if ( !empty( $deprecated ) )
     892                        _deprecated_argument( __FUNCTION__, 'deprecated', '2.5' );
    891893                return $this->app_base . $this->CATEGORIES_PATH;
    892894        }
    893895
  • wp-includes/author-template.php

     
    2222 */
    2323function get_the_author($deprecated = '') {
    2424        global $authordata;
     25
     26        if ( !empty( $deprecated )
     27                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     28
    2529        return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null);
    2630}
    2731
  • wp-includes/comment-template.php

     
    554554 */
    555555function comments_number( $zero = false, $one = false, $more = false, $deprecated = '' ) {
    556556        global $id;
     557
     558        if ( !empty( $deprecated )
     559                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     560
    557561        $number = get_comments_number($id);
    558562
    559563        if ( $number > 1 )
     
    696700 * @since 0.71
    697701 * @uses get_trackback_url() Gets the trackback url for the current post
    698702 *
    699  * @param bool $deprecated Remove backwards compat in 2.5
     703 * @param bool $deprecated_echo Remove backwards compat in 2.5
    700704 * @return void|string Should only be used to echo the trackback URL, use get_trackback_url() for the result instead.
    701705 */
    702 function trackback_url($deprecated = true) {
    703         if ($deprecated) echo get_trackback_url();
    704         else return get_trackback_url();
     706function trackback_url( $deprecated_echo = true ) {
     707        if ( $deprecated_echo !== true )
     708                _deprecated_argument( __FUNCTION__, 'deprecated', '2.5', __('Use get_trackback_url() instead if you do not want the value echoed.') );
     709        if ( $deprecated_echo )
     710                echo get_trackback_url();
     711        else
     712                return get_trackback_url();
    705713}
    706714
    707715/**
     
    712720 * @param int $deprecated Not used (Was $timezone = 0)
    713721 */
    714722function trackback_rdf($deprecated = '') {
     723        if ( !empty( $deprecated ) )
     724                _deprecated_argument( __FUNCTION__, 'deprecated', '2.5' );
     725
    715726        if (stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') === false) {
    716727                echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    717728                                xmlns:dc="http://purl.org/dc/elements/1.1/"
  • wp-includes/comment.php

     
    15111511 * @param int $deprecated Not Used.
    15121512 * @return bool|string False on failure, string containing URI on success.
    15131513 */
    1514 function discover_pingback_server_uri($url, $deprecated = '') {
    1515         if ( !empty($deprecated) )
    1516                 _deprecated_argument(__FUNCTION__, 'deprecated', '0.0');
     1514function discover_pingback_server_uri( $url, $deprecated = '' ) {
     1515        if ( !empty( $deprecated ) )
     1516                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
    15171517
    15181518        $pingback_str_dquote = 'rel="pingback"';
    15191519        $pingback_str_squote = 'rel=\'pingback\'';
  • wp-includes/formatting.php

     
    866866 * @return string Converted string.
    867867 */
    868868function convert_chars($content, $deprecated = '') {
     869        if ( !empty( $deprecated ) )
     870                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     871
    869872        // Translation of invalid Unicode references range to valid range
    870873        $wp_htmltranswinuni = array(
    871874        '&#128;' => '&#8364;', // the Euro sign
  • wp-includes/functions.php

     
    570570 * @return null returns when finished.
    571571 */
    572572function add_option( $name, $value = '', $deprecated = '', $autoload = 'yes' ) {
     573        if ( !empty( $deprecated ) )
     574                _deprecated_argument( __FUNCTION__, 'deprecated', '2.3' );
     575
    573576        global $wpdb;
    574577
    575578        wp_protect_special_option( $name );
     
    11881191 * @return bool|string False on failure and string of headers if HEAD request.
    11891192 */
    11901193function wp_get_http( $url, $file_path = false, $deprecated = false ) {
     1194        if ( !empty( $deprecated ) )
     1195                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     1196
    11911197        @set_time_limit( 60 );
    11921198
    11931199        $options = array();
     
    12301236 * @return bool|string False on failure, headers on success.
    12311237 */
    12321238function wp_get_http_headers( $url, $deprecated = false ) {
     1239        if ( !empty( $deprecated ) )
     1240                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     1241
    12331242        $response = wp_remote_head( $url );
    12341243
    12351244        if ( is_wp_error( $response ) )
     
    21722181 * @return array
    21732182 */
    21742183function wp_upload_bits( $name, $deprecated, $bits, $time = null ) {
     2184        if ( !empty( $deprecated ) )
     2185                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     2186
    21752187        if ( empty( $name ) )
    21762188                return array( 'error' => __( 'Empty filename' ) );
    21772189
  • wp-includes/kses.php

     
    11971197add_action('set_current_user', 'kses_init');
    11981198
    11991199function safecss_filter_attr( $css, $deprecated = '' ) {
     1200        if ( !empty( $deprecated ) )
     1201                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     1202
    12001203        $css = wp_kses_no_null($css);
    12011204        $css = str_replace(array("\n","\r","\t"), '', $css);
    12021205
  • wp-includes/link-template.php

     
    168168 * @param mixed $deprecated Not used.
    169169 * @return string
    170170 */
    171 function post_permalink($post_id = 0, $deprecated = '') {
     171function post_permalink( $post_id = 0, $deprecated = '' ) {
     172        if ( !empty( $deprecated ) )
     173                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     174
    172175        return get_permalink($post_id);
    173176}
    174177
  • wp-includes/post-template.php

     
    245245 * @param mixed $deprecated Not used.
    246246 * @return string
    247247 */
    248 function get_the_excerpt($deprecated = '') {
     248function get_the_excerpt( $deprecated = '' ) {
    249249        if ( !empty( $deprecated ) )
    250                 _deprecated_argument(__FUNCTION__, 'deprecated', '2.3');
     250                _deprecated_argument( __FUNCTION__, 'deprecated', '2.3' );
    251251
    252252        global $post;
    253253        $output = $post->post_excerpt;
     
    900900 * @param bool $deprecated Deprecated. Not used.
    901901 * @param bool $permalink Optional, default is false. Whether to include permalink.
    902902 */
    903 function the_attachment_link($id = 0, $fullsize = false, $deprecated = false, $permalink = false) {
     903function the_attachment_link( $id = 0, $fullsize = false, $deprecated = false, $permalink = false ) {
     904        if ( !empty( $deprecated ) )
     905                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
     906
    904907        if ( $fullsize )
    905908                echo wp_get_attachment_link($id, 'full', $permalink);
    906909        else
  • wp-includes/post.php

     
    35383538 * @param int $deprecated Not Used. Can be set to null.
    35393539 * @param object $post Object type containing the post information
    35403540 */
    3541 function _future_post_hook($deprecated = '', $post) {
     3541function _future_post_hook( $deprecated = '', $post ) {
     3542        if ( !empty( $deprecated ) )
     3543                _deprecated_argument( __FUNCTION__, 'deprecated', '0.0' );
    35423544        wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) );
    3543         wp_schedule_single_event(strtotime($post->post_date_gmt. ' GMT'), 'publish_future_post', array($post->ID));
     3545        wp_schedule_single_event( strtotime( $post->post_date_gmt. ' GMT' ), 'publish_future_post', array( $post->ID ) );
    35443546}
    35453547
    35463548/**