WordPress.org

Make WordPress Core

Ticket #4800: trackback-cleanup.diff

File trackback-cleanup.diff, 3.8 KB (added by Otto42, 12 years ago)

Cleanup of trackback_url functions

  • wp-content/themes/default/attachment.php

     
    3232
    3333                                                <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    3434                                                        // Both Comments and Pings are open ?>
    35                                                         You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site.
     35                                                        You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
    3636
    3737                                                <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    3838                                                        // Only Pings are Open ?>
    39                                                         Responses are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site.
     39                                                        Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
    4040
    4141                                                <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    4242                                                        // Comments are open, Pings are not ?>
  • wp-content/themes/default/single.php

     
    3131
    3232                                                <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    3333                                                        // Both Comments and Pings are open ?>
    34                                                         You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site.
     34                                                        You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
    3535
    3636                                                <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
    3737                                                        // Only Pings are Open ?>
    38                                                         Responses are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site.
     38                                                        Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
    3939
    4040                                                <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
    4141                                                        // Comments are open, Pings are not ?>
  • wp-includes/comment-template.php

     
    223223
    224224function get_trackback_url() {
    225225        global $id;
    226         $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . $id;
    227 
    228         if ( '' != get_option('permalink_structure') )
     226        if ( '' != get_option('permalink_structure') ) {
    229227                $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
    230 
     228        } else {
     229                $tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . $id;
     230        }
    231231        return apply_filters('trackback_url', $tb_url);
    232232}
    233 function trackback_url( $display = true ) {
    234         if ( $display)
    235                 echo get_trackback_url();
    236         else
    237                 return get_trackback_url();
     233
     234function trackback_url($deprecated = true) { // remove backwards compat in 2.4
     235        if ($deprecated) echo get_trackback_url();
     236        else return get_trackback_url();
    238237}
    239238
    240239function trackback_rdf($timezone = 0) {
     
    250249                the_permalink();
    251250                echo '"'."\n";
    252251                echo '    dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n";
    253                 echo '    trackback:ping="'.trackback_url(0).'"'." />\n";
     252                echo '    trackback:ping="'.get_trackback_url().'"'." />\n";
    254253                echo '</rdf:RDF>';
    255254        }
    256255}