Switch language

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




wp_dashboard_recent_comments_control [ WordPress Function ]

wp_dashboard_recent_comments_control ( No parameters )
Defined at:



The recent comments dashboard widget control.

Source


<?php
function wp_dashboard_recent_comments_control() {
    if ( !
$widget_options get_option'dashboard_widget_options' ) )
        
$widget_options = array();

    if ( !isset(
$widget_options['dashboard_recent_comments']) )
        
$widget_options['dashboard_recent_comments'] = array();

    if ( 
'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-recent-comments']) ) {
        
$number absint$_POST['widget-recent-comments']['items'] );
        
$widget_options['dashboard_recent_comments']['items'] = $number;
        
update_option'dashboard_widget_options'$widget_options );
    }

    
$number = isset( $widget_options['dashboard_recent_comments']['items'] ) ? (int) $widget_options['dashboard_recent_comments']['items'] : '';

    echo 
'<p><label for="comments-number">' __('Number of comments to show:') . '</label>';
    echo 
'<input id="comments-number" name="widget-recent-comments[items]" type="text" value="' $number '" size="3" /></p>';
}
?>

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