wp_dashboard_recent_drafts [ WordPress Function ]
wp_dashboard_recent_drafts ( $drafts = false )
| Defined at: |
|
Benzer Fonksiyonlar: wp_dashboard_recent_comments, wp_dashboard_secondary, _wp_dashboard_recent_comments_row, wp_dashboard_rss_control, wp_dashboard_recent_comments_control
No description yet.
Source
<?php
function wp_dashboard_recent_drafts( $drafts = false ) {
if ( !$drafts ) {
$drafts_query = new WP_Query( array(
'post_type' => 'post',
'post_status' => 'draft',
'author' => $GLOBALS['current_user']->ID,
'posts_per_page' => 5,
'orderby' => 'modified',
'order' => 'DESC'
) );
$drafts =& $drafts_query->posts;
}
if ( $drafts && is_array( $drafts ) ) {
$list = array();
foreach ( $drafts as $draft ) {
$url = get_edit_post_link( $draft->ID );
$title = _draft_or_post_title( $draft->ID );
$item = "<h4><a href='$url' title='" . sprintf( __( 'Edit “%s”' ), esc_attr( $title ) ) . "'>" . esc_html($title) . "</a> <abbr title='" . get_the_time(__('Y/m/d g:i:s A'), $draft) . "'>" . get_the_time( get_option( 'date_format' ), $draft ) . '</abbr></h4>';
if ( $the_content = preg_split( '#\s#', strip_tags( $draft->post_content ), 11, PREG_SPLIT_NO_EMPTY ) )
$item .= '<p>' . join( ' ', array_slice( $the_content, 0, 10 ) ) . ( 10 < count( $the_content ) ? '…' : '' ) . '</p>';
$list[] = $item;
}
?>
<ul>
<li><?php echo join( "</li>\n<li>", $list ); ?></li>
</ul>
<p class="textright"><a href="edit.php?post_status=draft" ><?php _e('View all'); ?></a></p>
<?php
} else {
_e('There are no drafts at the moment');
}
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- PHPXRef 0.7 : WordPress : Detail view of dashboard.php
wp_dashboard_quick_press() wp_dashboard_recent_drafts() ...
phpxref.ftwr.co.uk - PHPXRef 0.7 : WordPress : /wp-admin/includes/dashboard.php source
alt="" /> 545 </span> 546 <br class="clear" /> 547 </p> 548 549 </form> 550 551 <?php 552 if ( $drafts ) 553 wp_dashboard_recent_drafts( $drafts ); 554 } 555 ...
phpxref.ftwr.co.uk - dashboard.php - PHP Cross Reference of WordPress Source - Yoast
wp_dashboard_quick_press() wp_dashboard_recent_drafts() ...
xref.yoast.com - Docs for page dashboard.php
since: 3.0.0. void wp_dashboard_recent_comments_control (). wp_dashboard_recent_drafts (line 556). void wp_dashboard_recent_drafts ([ $ drafts = false]) ...
phpdoc.wordpress.org