: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
<?php submit_button( __( 'Search Users' ), '', false, false, array( 'id' => 'submit_users' ) ); ?>
<form action="<?php echo esc_url( network_admin_url( 'sites.php' ) ); ?>" method="get">
<label class="screen-reader-text" for="search-sites">
/* translators: Hidden accessibility text. */
<input type="search" name="s" value="" size="30" autocomplete="off" id="search-sites" />
<?php submit_button( __( 'Search Sites' ), '', false, false, array( 'id' => 'submit_sites' ) ); ?>
* Fires at the end of the 'Right Now' widget in the Network Admin dashboard.
do_action( 'mu_rightnow_end' );
* Fires at the end of the 'Right Now' widget in the Network Admin dashboard.
do_action( 'mu_activity_box_end' );
* Displays the Quick Draft widget.
* @param string|false $error_msg Optional. Error message. Default false.
function wp_dashboard_quick_press( $error_msg = false ) {
if ( ! current_user_can( 'edit_posts' ) ) {
// Check if a new auto-draft (= no new post_ID) is needed or if the old can be used.
$last_post_id = (int) get_user_option( 'dashboard_quick_press_last_post_id' ); // Get the last post_ID.
$post = get_post( $last_post_id );
if ( empty( $post ) || 'auto-draft' !== $post->post_status ) { // auto-draft doesn't exist anymore.
$post = get_default_post_to_edit( 'post', true );
update_user_option( get_current_user_id(), 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID.
$post->post_title = ''; // Remove the auto draft title.
$post = get_default_post_to_edit( 'post', true );
$user_id = get_current_user_id();
// Don't create an option if this is a super admin who does not belong to this site.
if ( in_array( get_current_blog_id(), array_keys( get_blogs_of_user( $user_id ) ), true ) ) {
update_user_option( $user_id, 'dashboard_quick_press_last_post_id', (int) $post->ID ); // Save post_ID.
$post_ID = (int) $post->ID;
<form name="post" action="<?php echo esc_url( admin_url( 'post.php' ) ); ?>" method="post" id="quick-press" class="initial-form hide-if-no-js">
'additional_classes' => array( 'error' ),
<div class="input-text-wrap" id="title-wrap">
/** This filter is documented in wp-admin/edit-form-advanced.php */
echo apply_filters( 'enter_title_here', __( 'Title' ), $post );
<input type="text" name="post_title" id="title" autocomplete="off" />
<div class="textarea-wrap" id="description-wrap">
<label for="content"><?php _e( 'Content' ); ?></label>
<textarea name="content" id="content" placeholder="<?php esc_attr_e( 'What’s on your mind?' ); ?>" class="mceEditor" rows="3" cols="15" autocomplete="off"></textarea>
<input type="hidden" name="action" id="quickpost-action" value="post-quickdraft-save" />
<input type="hidden" name="post_ID" value="<?php echo $post_ID; ?>" />
<input type="hidden" name="post_type" value="post" />
<?php wp_nonce_field( 'add-post' ); ?>
<?php submit_button( __( 'Save Draft' ), 'primary', 'save', false, array( 'id' => 'save-post' ) ); ?>
wp_dashboard_recent_drafts();
* Show recent drafts of the user on the dashboard.
* @param WP_Post[]|false $drafts Optional. Array of posts to display. Default false.
function wp_dashboard_recent_drafts( $drafts = false ) {
'post_status' => 'draft',
'author' => get_current_user_id(),
* Filters the post query arguments for the 'Recent Drafts' dashboard widget.
* @param array $query_args The query arguments for the 'Recent Drafts' dashboard widget.
$query_args = apply_filters( 'dashboard_recent_drafts_query_args', $query_args );
$drafts = get_posts( $query_args );
echo '<div class="drafts">';
if ( count( $drafts ) > 3 ) {
'<p class="view-all"><a href="%s">%s</a></p>' . "\n",
esc_url( admin_url( 'edit.php?post_status=draft' ) ),
echo '<h2 class="hide-if-no-js">' . __( 'Your Recent Drafts' ) . "</h2>\n";
/* translators: Maximum number of words used in a preview of a draft on the dashboard. */
$draft_length = (int) _x( '10', 'draft_length' );
$drafts = array_slice( $drafts, 0, 3 );
foreach ( $drafts as $draft ) {
$url = get_edit_post_link( $draft->ID );
$title = _draft_or_post_title( $draft->ID );
'<div class="draft-title"><a href="%s" aria-label="%s">%s</a><time datetime="%s">%s</time></div>',
/* translators: %s: Post title. */
esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ),
get_the_time( 'c', $draft ),
get_the_time( __( 'F j, Y' ), $draft )
$the_content = wp_trim_words( $draft->post_content, $draft_length );
echo '<p>' . $the_content . '</p>';
* Outputs a row for the Recent Comments widget.
* @global WP_Comment $comment Global comment object.
* @param WP_Comment $comment The current comment.
* @param bool $show_date Optional. Whether to display the date.
function _wp_dashboard_recent_comments_row( &$comment, $show_date = true ) {
$GLOBALS['comment'] = clone $comment;
if ( $comment->comment_post_ID > 0 ) {
$comment_post_title = _draft_or_post_title( $comment->comment_post_ID );
$comment_post_url = get_the_permalink( $comment->comment_post_ID );
$comment_post_link = '<a href="' . esc_url( $comment_post_url ) . '">' . $comment_post_title . '</a>';
if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) {
// Pre-order it: Approve | Reply | Edit | Spam | Trash.
$del_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "delete-comment_$comment->comment_ID" ) );
$approve_nonce = esc_html( '_wpnonce=' . wp_create_nonce( "approve-comment_$comment->comment_ID" ) );
$approve_url = esc_url( "comment.php?action=approvecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
$unapprove_url = esc_url( "comment.php?action=unapprovecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$approve_nonce" );
$spam_url = esc_url( "comment.php?action=spamcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
$trash_url = esc_url( "comment.php?action=trashcomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
$delete_url = esc_url( "comment.php?action=deletecomment&p=$comment->comment_post_ID&c=$comment->comment_ID&$del_nonce" );
$actions['approve'] = sprintf(
'<a href="%s" data-wp-lists="%s" class="vim-a aria-button-if-js" aria-label="%s">%s</a>',
"dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=approved",
esc_attr__( 'Approve this comment' ),
$actions['unapprove'] = sprintf(
'<a href="%s" data-wp-lists="%s" class="vim-u aria-button-if-js" aria-label="%s">%s</a>',
"dim:the-comment-list:comment-{$comment->comment_ID}:unapproved:e7e7d3:e7e7d3:new=unapproved",
esc_attr__( 'Unapprove this comment' ),
$actions['edit'] = sprintf(
'<a href="%s" aria-label="%s">%s</a>',
"comment.php?action=editcomment&c={$comment->comment_ID}",
esc_attr__( 'Edit this comment' ),
$actions['reply'] = sprintf(
'<button type="button" onclick="window.commentReply && commentReply.open(\'%s\',\'%s\');" class="vim-r button-link hide-if-no-js" aria-label="%s">%s</button>',
$comment->comment_post_ID,
esc_attr__( 'Reply to this comment' ),
$actions['spam'] = sprintf(
'<a href="%s" data-wp-lists="%s" class="vim-s vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
"delete:the-comment-list:comment-{$comment->comment_ID}::spam=1",
esc_attr__( 'Mark this comment as spam' ),
/* translators: "Mark as spam" link. */
if ( ! EMPTY_TRASH_DAYS ) {
$actions['delete'] = sprintf(
'<a href="%s" data-wp-lists="%s" class="delete vim-d vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
"delete:the-comment-list:comment-{$comment->comment_ID}::trash=1",
esc_attr__( 'Delete this comment permanently' ),
__( 'Delete Permanently' )
$actions['trash'] = sprintf(
'<a href="%s" data-wp-lists="%s" class="delete vim-d vim-destructive aria-button-if-js" aria-label="%s">%s</a>',
"delete:the-comment-list:comment-{$comment->comment_ID}::trash=1",
esc_attr__( 'Move this comment to the Trash' ),
$actions['view'] = sprintf(
'<a class="comment-link" href="%s" aria-label="%s">%s</a>',
esc_url( get_comment_link( $comment ) ),
esc_attr__( 'View this comment' ),
* Filters the action links displayed for each comment in the 'Recent Comments'
* @param string[] $actions An array of comment actions. Default actions include:
* 'Approve', 'Unapprove', 'Edit', 'Reply', 'Spam',
* @param WP_Comment $comment The comment object.
$actions = apply_filters( 'comment_row_actions', array_filter( $actions ), $comment );
foreach ( $actions as $action => $link ) {
if ( ( ( 'approve' === $action || 'unapprove' === $action ) && 2 === $i )
// Reply and quickedit need a hide-if-no-js span.
if ( 'reply' === $action || 'quickedit' === $action ) {
$action .= ' hide-if-no-js';
if ( 'view' === $action && '1' !== $comment->comment_approved ) {
$actions_string .= "<span class='$action'>{$separator}{$link}</span>";
<li id="comment-<?php echo $comment->comment_ID; ?>" <?php comment_class( array( 'comment-item', wp_get_comment_status( $comment ) ), $comment ); ?>>
if ( get_option( 'show_avatars' ) ) {
echo get_avatar( $comment, 50, 'mystery' );
$comment_row_class .= ' has-avatar';
<?php if ( ! $comment->comment_type || 'comment' === $comment->comment_type ) : ?>
<div class="dashboard-comment-wrap has-row-actions <?php echo $comment_row_class; ?>">
// Comments might not have a post they relate to, e.g. programmatically created ones.
if ( $comment_post_link ) {
/* translators: 1: Comment author, 2: Post link, 3: Notification if the comment is pending. */
__( 'From %1$s on %2$s %3$s' ),
'<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
'<span class="approve">' . __( '[Pending]' ) . '</span>'
/* translators: 1: Comment author, 2: Notification if the comment is pending. */
'<cite class="comment-author">' . get_comment_author_link( $comment ) . '</cite>',
'<span class="approve">' . __( '[Pending]' ) . '</span>'
switch ( $comment->comment_type ) {
$type = __( 'Pingback' );
$type = __( 'Trackback' );
$type = ucwords( $comment->comment_type );
$type = esc_html( $type );
<div class="dashboard-comment-wrap has-row-actions">
// Pingbacks, Trackbacks or custom comment types might not have a post they relate to, e.g. programmatically created ones.
if ( $comment_post_link ) {
/* translators: 1: Type of comment, 2: Post link, 3: Notification if the comment is pending. */
_x( '%1$s on %2$s %3$s', 'dashboard' ),
"<strong>$type</strong>",
'<span class="approve">' . __( '[Pending]' ) . '</span>'
/* translators: 1: Type of comment, 2: Notification if the comment is pending. */
_x( '%1$s %2$s', 'dashboard' ),
"<strong>$type</strong>",
'<span class="approve">' . __( '[Pending]' ) . '</span>'
<p class="comment-author"><?php comment_author_link( $comment ); ?></p>
<?php endif; // comment_type ?>
<blockquote><p><?php comment_excerpt( $comment ); ?></p></blockquote>
<?php if ( $actions_string ) : ?>
<p class="row-actions"><?php echo $actions_string; ?></p>
$GLOBALS['comment'] = null;
* Outputs the Activity widget.
* Callback function for {@see 'dashboard_activity'}.
function wp_dashboard_site_activity() {
echo '<div id="activity-widget">';
$future_posts = wp_dashboard_recent_posts(
'title' => __( 'Publishing Soon' ),
$recent_posts = wp_dashboard_recent_posts(
'title' => __( 'Recently Published' ),
'id' => 'published-posts',
$recent_comments = wp_dashboard_recent_comments();
if ( ! $future_posts && ! $recent_posts && ! $recent_comments ) {
echo '<div class="no-activity">';
echo '<p>' . __( 'No activity yet!' ) . '</p>';
* Generates Publishing Soon and Recently Published sections.
* An array of query and display arguments.
* @type int $max Number of posts to display.
* @type string $status Post status.
* @type string $order Designates ascending ('ASC') or descending ('DESC') order.
* @type string $title Section title.
* @type string $id The container id.
* @return bool False if no posts were found. True otherwise.
function wp_dashboard_recent_posts( $args ) {
'post_status' => $args['status'],
'order' => $args['order'],
'posts_per_page' => (int) $args['max'],
'perm' => ( 'future' === $args['status'] ) ? 'editable' : 'readable',
* Filters the query arguments used for the Recent Posts widget.