Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




do_trackbacks [ WordPress Function ]

do_trackbacks ( $post_id )
Parameters:
  • (int) $post_id Post ID to do trackbacks on.
Uses:
  • $wpdb
Defined at:



Perform trackbacks.

Source


<?php
function do_trackbacks($post_id) {
    global 
$wpdb;

    
$post $wpdb->get_row$wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d"$post_id) );
    
$to_ping get_to_ping($post_id);
    
$pinged  get_pung($post_id);
    if ( empty(
$to_ping) ) {
        
$wpdb->update($wpdb->posts, array('to_ping' => ''), array('ID' => $post_id) );
        return;
    }

    if ( empty(
$post->post_excerpt) )
        
$excerpt apply_filters('the_content'$post->post_content);
    else
        
$excerpt apply_filters('the_excerpt'$post->post_excerpt);
    
$excerpt str_replace(']]>'']]&gt;'$excerpt);
    
$excerpt wp_html_excerpt($excerpt252) . '...';

    
$post_title apply_filters('the_title'$post->post_title$post->ID);
    
$post_title strip_tags($post_title);

    if ( 
$to_ping ) {
        foreach ( (array) 
$to_ping as $tb_ping ) {
            
$tb_ping trim($tb_ping);
            if ( !
in_array($tb_ping$pinged) ) {
                
trackback($tb_ping$post_title$excerpt$post_id);
                
$pinged[] = $tb_ping;
            } else {
                
$wpdb->query$wpdb->prepare("UPDATE $wpdb->posts SET to_ping = TRIM(REPLACE(to_ping, %s, '')) WHERE ID = %d"$tb_ping$post_id) );
            }
        }
    }
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics