friendly( 3, false ) ) ); ?>
array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ),
'own_posts' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ),
'post_page' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ),
);
if ( $user->can_any( $perms ) ) {
$message = '' . $message . '';
}
$content_type_msg[] = $message;
}
if ( !empty( $stats['entry_count'] ) ) {
$message = sprintf( _n( '%d entry', '%d entries', $stats['entry_count'] ), $stats['entry_count'] );
$perms = array(
'post_any' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ),
'own_posts' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ),
'post_entry' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ),
);
if ( $user->can_any( $perms ) ) {
$message = '' . $message . '';
}
$content_type_msg[] = $message;
}
$comment_tag_msg = array();
if ( !empty( $stats['comment_count'] ) ) {
$message = sprintf( _n( '%d comment', '%d comments', $stats['comment_count'] ), $stats['comment_count'] );
$perms = array( 'manage_all_comments' => true, 'manage_own_post_comments' => true );
if ( $user->can_any( $perms ) ) {
$message = '' . $message . '';
}
$comment_tag_msg[] = $message;
}
if ( !empty( $stats['tag_count'] ) ) {
$message = sprintf( _n( '%d tag', '%d tags', $stats['tag_count'] ), $stats['tag_count'] );
$perms = array( 'manage_tags' => true );
if ( $user->can_any( $perms ) ) {
$message = '' . $message . '';
}
$comment_tag_msg[] = $message;
}
if ( !empty( $content_type_msg ) ) {
$status_report = sprintf( _n( '[You] have published %1$s%2$s', 'The [%3$d authors] have published %1$s%2$s', $stats['author_count'] ),
Format::and_list( $content_type_msg ),
!empty( $comment_tag_msg ) ? _t( ' with ' ) . Format::and_list( $comment_tag_msg ) : "",
$stats['author_count'] );
$perms = array( 'manage_users' => true );
if ( $user->can_any( $perms ) ) {
$status_report = str_replace( array( '[', ']' ),
array( '', '' ),
$status_report );
}
else {
$status_report = str_replace( array( '[', ']' ), array( '', '' ), $status_report );
}
echo $status_report;
}
?>
array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ), 'own_posts' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ), 'post_entry' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ), ); if ( $user->can_any( $perms ) ) { $message = '' . $message . ''; } $message_bits[] = $message; } if ( !empty( $stats['user_entry_scheduled_count'] ) ) { $message = sprintf( _n( '%d scheduled post' , '%d scheduled posts' , $stats['user_entry_scheduled_count'] ), $stats['user_entry_scheduled_count' ] ); $perms = array( 'post_any' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ), 'own_posts' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ), 'post_entry' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ), ); if ( $user->can_any( $perms ) ) { $message = '' . $message . ''; } $message_bits[] = $message; } if ( !empty( $stats['page_draft_count'] ) ) { $message = sprintf( _n( '%d page draft', '%d page drafts', $stats['page_draft_count'] ), $stats['page_draft_count'] ); $perms = array( 'post_any' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ), 'own_posts' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ), 'post_page' => array( ACL::get_bitmask( 'delete' ), ACL::get_bitmask( 'edit' ) ), ); if ( $user->can_any( $perms ) ) { $message = '' . $message . ''; } $message_bits[] = $message; } if ( $user->can_any( array( 'manage_all_comments' => true, 'manage_own_post_comments' => true ) ) ) { if ( !empty( $stats['unapproved_comment_count'] ) ) { $message = ''; $message .= sprintf( _n( '%d comment awaiting approval', '%d comments awaiting approval', $stats['unapproved_comment_count'] ), $stats['unapproved_comment_count'] ); $message .= ''; $message_bits[] = $message; } if ( !empty( $stats['spam_comment_count'] ) && User::identify()->info->dashboard_hide_spam_count != true ) { $message = ''; $message .= sprintf( _n( '%d spam comment awaiting moderation', '%d spam comments awaiting moderation', $stats['spam_comment_count'] ), $stats['spam_comment_count'] ); $message .= ''; $message_bits[] = $message; } } if ( !empty( $message_bits ) ) { _e('You have %s', array(Format::and_list( $message_bits)) ); } ?>