Trackback fxn cleanup from Otto42. fixes #4800

git-svn-id: http://svn.automattic.com/wordpress/trunk@5982 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-08-29 23:08:44 +00:00
parent 560b73b9e3
commit b92227412a
3 changed files with 13 additions and 14 deletions

View File

@ -32,11 +32,11 @@
<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) { <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Both Comments and Pings are open ?> // Both Comments and Pings are open ?>
You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site. You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) { <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Only Pings are Open ?> // Only Pings are Open ?>
Responses are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site. Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) { <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
// Comments are open, Pings are not ?> // Comments are open, Pings are not ?>

View File

@ -31,11 +31,11 @@
<?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) { <?php if (('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Both Comments and Pings are open ?> // Both Comments and Pings are open ?>
You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(true); ?>" rel="trackback">trackback</a> from your own site. You can <a href="#respond">leave a response</a>, or <a href="<?php trackback_url(); ?>" rel="trackback">trackback</a> from your own site.
<?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) { <?php } elseif (!('open' == $post-> comment_status) && ('open' == $post->ping_status)) {
// Only Pings are Open ?> // Only Pings are Open ?>
Responses are currently closed, but you can <a href="<?php trackback_url(true); ?> " rel="trackback">trackback</a> from your own site. Responses are currently closed, but you can <a href="<?php trackback_url(); ?> " rel="trackback">trackback</a> from your own site.
<?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) { <?php } elseif (('open' == $post-> comment_status) && !('open' == $post->ping_status)) {
// Comments are open, Pings are not ?> // Comments are open, Pings are not ?>

View File

@ -223,18 +223,17 @@ function comment_type($commenttxt = 'Comment', $trackbacktxt = 'Trackback', $pin
function get_trackback_url() { function get_trackback_url() {
global $id; global $id;
$tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . $id; if ( '' != get_option('permalink_structure') ) {
if ( '' != get_option('permalink_structure') )
$tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback'); $tb_url = trailingslashit(get_permalink()) . user_trailingslashit('trackback', 'single_trackback');
} else {
$tb_url = get_option('siteurl') . '/wp-trackback.php?p=' . $id;
}
return apply_filters('trackback_url', $tb_url); return apply_filters('trackback_url', $tb_url);
} }
function trackback_url( $display = true ) {
if ( $display) function trackback_url($deprecated = true) { // remove backwards compat in 2.4
echo get_trackback_url(); if ($deprecated) echo get_trackback_url();
else else return get_trackback_url();
return get_trackback_url();
} }
function trackback_rdf($timezone = 0) { function trackback_rdf($timezone = 0) {
@ -250,7 +249,7 @@ function trackback_rdf($timezone = 0) {
the_permalink(); the_permalink();
echo '"'."\n"; echo '"'."\n";
echo ' dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n"; echo ' dc:title="'.str_replace('--', '&#x2d;&#x2d;', wptexturize(strip_tags(get_the_title()))).'"'."\n";
echo ' trackback:ping="'.trackback_url(0).'"'." />\n"; echo ' trackback:ping="'.get_trackback_url().'"'." />\n";
echo '</rdf:RDF>'; echo '</rdf:RDF>';
} }
} }