Switch language

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




wp_dashboard_incoming_links_output [ WordPress Function ]

wp_dashboard_incoming_links_output ( No parameters )
Defined at:



Display incoming links dashboard widget content.

Source


<?php
function wp_dashboard_incoming_links_output() {
    
$widgets get_option'dashboard_widget_options' );
    @
extract( @$widgets['dashboard_incoming_links'], EXTR_SKIP );
    
$rss fetch_feed$url );

    if ( 
is_wp_error($rss) ) {
        if ( 
is_admin() || current_user_can('manage_options') ) {
            echo 
'<p>';
            
printf(__('<strong>RSS Error</strong>: %s'), $rss->get_error_message());
            echo 
'</p>';
        }
        return;
    }

    if ( !
$rss->get_item_quantity() ) {
        echo 
'<p>' __('This dashboard widget queries <a href="http://blogsearch.google.com/">Google Blog Search</a> so that when another blog links to your site it will show up here. It has found no incoming links&hellip; yet. It&#8217;s okay &#8212; there is no rush.') . "</p>\n";
        
$rss->__destruct();
        unset(
$rss);
        return;
    }

    echo 
"<ul>\n";

    if ( !isset(
$items) )
        
$items 10;

    foreach ( 
$rss->get_items(0$items) as $item ) {
        
$publisher '';
        
$site_link '';
        
$link '';
        
$content '';
        
$date '';
        
$link esc_urlstrip_tags$item->get_link() ) );

        
$author $item->get_author();
        if ( 
$author ) {
            
$site_link esc_urlstrip_tags$author->get_link() ) );

            if ( !
$publisher esc_htmlstrip_tags$author->get_name() ) ) )
                
$publisher __'Somebody' );
        } else {
          
$publisher __'Somebody' );
        }
        if ( 
$site_link )
            
$publisher "<a href='$site_link'>$publisher</a>";
        else
            
$publisher "<strong>$publisher</strong>";

        
$content $item->get_content();
        
$content wp_html_excerpt($content50) . ' ...';

        if ( 
$link )
            
/* translators: incoming links feed, %1$s is other person, %3$s is content */
            
$text __'%1$s linked here <a href="%2$s">saying</a>, "%3$s"' );
        else
            
/* translators: incoming links feed, %1$s is other person, %3$s is content */
            
$text __'%1$s linked here saying, "%3$s"' );

        if ( !empty(
$show_date) ) {
            if ( !empty(
$show_author) || !empty($show_summary) )
                
/* translators: incoming links feed, %4$s is the date */
                
$text .= ' ' __'on %4$s' );
            
$date esc_htmlstrip_tags$item->get_date() ) );
            
$date strtotime$date );
            
$date gmdateget_option'date_format' ), $date );
        }

        echo 
"\t<li>" sprintf$text$publisher$link$content$date ) . "</li>\n";
    }

    echo 
"</ul>\n";
    
$rss->__destruct();
    unset(
$rss);
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



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