do_action( 'wp_network_dashboard_setup' );
/**
- * Filter the list of widgets to load for the Network Admin dashboard.
+ * Filters the list of widgets to load for the Network Admin dashboard.
*
* @since 3.1.0
*
do_action( 'wp_user_dashboard_setup' );
/**
- * Filter the list of widgets to load for the User Admin dashboard.
+ * Filters the list of widgets to load for the User Admin dashboard.
*
* @since 3.1.0
*
do_action( 'wp_dashboard_setup' );
/**
- * Filter the list of widgets to load for the admin dashboard.
+ * Filters the list of widgets to load for the admin dashboard.
*
* @since 2.5.0
*
$screen = get_current_screen();
global $wp_dashboard_control_callbacks;
+ $private_callback_args = array( '__widget_basename' => $widget_name );
+
+ if ( is_null( $callback_args ) ) {
+ $callback_args = $private_callback_args;
+ } else if ( is_array( $callback_args ) ) {
+ $callback_args = array_merge( $callback_args, $private_callback_args );
+ }
+
if ( $control_callback && current_user_can( 'edit_dashboard' ) && is_callable( $control_callback ) ) {
$wp_dashboard_control_callbacks[$widget_id] = $control_callback;
if ( isset( $_GET['edit'] ) && $widget_id == $_GET['edit'] ) {
}
// Comments
$num_comm = wp_count_comments();
- if ( $num_comm && $num_comm->approved ) {
+ if ( $num_comm && ( $num_comm->approved || $num_comm->moderated ) ) {
$text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) );
?>
<li class="comment-count"><a href="edit-comments.php"><?php echo $text; ?></a></li>
}
/**
- * Filter the array of extra elements to list in the 'At a Glance'
+ * Filters the array of extra elements to list in the 'At a Glance'
* dashboard widget.
*
* Prior to 3.8.0, the widget was named 'Right Now'. Each element
if ( ! is_network_admin() && ! is_user_admin() && current_user_can( 'manage_options' ) && '0' == get_option( 'blog_public' ) ) {
/**
- * Filter the link title attribute for the 'Search Engines Discouraged'
+ * Filters the link title attribute for the 'Search Engines Discouraged'
* message displayed in the 'At a Glance' dashboard widget.
*
* Prior to 3.8.0, the widget was named 'Right Now'.
$title = apply_filters( 'privacy_on_link_title', '' );
/**
- * Filter the link label for the 'Search Engines Discouraged' message
+ * Filters the link label for the 'Search Engines Discouraged' message
* displayed in the 'At a Glance' dashboard widget.
*
* Prior to 3.8.0, the widget was named 'Right Now'.
);
/**
- * Filter the post query arguments for the 'Recent Drafts' dashboard widget.
+ * Filters the post query arguments for the 'Recent Drafts' dashboard widget.
*
* @since 4.4.0
*
$actions['trash'] = "<a href='$trash_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID::trash=1' class='delete vim-d vim-destructive' aria-label='" . esc_attr__( 'Move this comment to the Trash' ) . "'>" . _x( 'Trash', 'verb' ) . '</a>';
}
- if ( '1' === $comment->comment_approved ) {
- $actions['view'] = '<a class="comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '" aria-label="' . esc_attr__( 'View this comment' ) . '">' . __( 'View' ) . '</a>';
- }
+ $actions['view'] = '<a class="comment-link" href="' . esc_url( get_comment_link( $comment ) ) . '" aria-label="' . esc_attr__( 'View this comment' ) . '">' . __( 'View' ) . '</a>';
/**
- * Filter the action links displayed for each comment in the 'Recent Comments'
+ * Filters the action links displayed for each comment in the 'Recent Comments'
* dashboard widget.
*
* @since 2.6.0
( ( ('approve' == $action || 'unapprove' == $action) && 2 === $i ) || 1 === $i ) ? $sep = '' : $sep = ' | ';
// Reply and quickedit need a hide-if-no-js span
- if ( 'reply' == $action || 'quickedit' == $action )
+ if ( 'reply' == $action || 'quickedit' == $action ) {
$action .= ' hide-if-no-js';
+ }
+ if ( 'view' === $action && '1' !== $comment->comment_approved ) {
+ $action .= ' hidden';
+ }
$actions_string .= "<span class='$action'>$sep$link</span>";
}
}
);
/**
- * Filter the query arguments used for the Recent Posts widget.
+ * Filters the query arguments used for the Recent Posts widget.
*
* @since 4.2.0
*
} elseif ( date( 'Y-m-d', $time ) == $tomorrow ) {
$relative = __( 'Tomorrow' );
} elseif ( date( 'Y', $time ) !== date( 'Y', current_time( 'timestamp' ) ) ) {
- /* translators: date and time format for recent posts on the dashboard, from a different calendar year, see http://php.net/date */
+ /* translators: date and time format for recent posts on the dashboard, from a different calendar year, see https://secure.php.net/date */
$relative = date_i18n( __( 'M jS Y' ), $time );
} else {
- /* translators: date and time format for recent posts on the dashboard, see http://php.net/date */
+ /* translators: date and time format for recent posts on the dashboard, see https://secure.php.net/date */
$relative = date_i18n( __( 'M jS' ), $time );
}
* If $check_urls is empty, look for the rss feed url found in the dashboard
* widget options of $widget_id. If cached, call $callback, a function that
* echoes out output for this widget. If not cache, echo a "Loading..." stub
- * which is later replaced by AJAX call (see top of /wp-admin/index.php)
+ * which is later replaced by Ajax call (see top of /wp-admin/index.php)
*
* @since 2.5.0
*
'news' => array(
/**
- * Filter the primary link URL for the 'WordPress News' dashboard widget.
+ * Filters the primary link URL for the 'WordPress News' dashboard widget.
*
* @since 2.5.0
*
'link' => apply_filters( 'dashboard_primary_link', __( 'https://wordpress.org/news/' ) ),
/**
- * Filter the primary feed URL for the 'WordPress News' dashboard widget.
+ * Filters the primary feed URL for the 'WordPress News' dashboard widget.
*
* @since 2.3.0
*
'url' => apply_filters( 'dashboard_primary_feed', __( 'http://wordpress.org/news/feed/' ) ),
/**
- * Filter the primary link title for the 'WordPress News' dashboard widget.
+ * Filters the primary link title for the 'WordPress News' dashboard widget.
*
* @since 2.3.0
*
'planet' => array(
/**
- * Filter the secondary link URL for the 'WordPress News' dashboard widget.
+ * Filters the secondary link URL for the 'WordPress News' dashboard widget.
*
* @since 2.3.0
*
'link' => apply_filters( 'dashboard_secondary_link', __( 'https://planet.wordpress.org/' ) ),
/**
- * Filter the secondary feed URL for the 'WordPress News' dashboard widget.
+ * Filters the secondary feed URL for the 'WordPress News' dashboard widget.
*
* @since 2.3.0
*
'url' => apply_filters( 'dashboard_secondary_feed', __( 'https://planet.wordpress.org/feed/' ) ),
/**
- * Filter the secondary link title for the 'WordPress News' dashboard widget.
+ * Filters the secondary link title for the 'WordPress News' dashboard widget.
*
* @since 2.3.0
*
'title' => apply_filters( 'dashboard_secondary_title', __( 'Other WordPress News' ) ),
/**
- * Filter the number of secondary link items for the 'WordPress News' dashboard widget.
+ * Filters the number of secondary link items for the 'WordPress News' dashboard widget.
*
* @since 4.4.0
*
/**
* Display file upload quota on dashboard.
*
- * Runs on the activity_box_end hook in wp_dashboard_right_now().
+ * Runs on the {@see 'activity_box_end'} hook in wp_dashboard_right_now().
*
* @since 3.0.0
*
}
/**
- * Filter the notice output for the 'Browse Happy' nag meta box.
+ * Filters the notice output for the 'Browse Happy' nag meta box.
*
* @since 3.2.0
*