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'.
$c_users = get_user_count();
$c_blogs = get_blog_count();
+ /* translators: 1: Number of users on the network */
$user_text = sprintf( _n( '%s user', '%s users', $c_users ), number_format_i18n( $c_users ) );
+ /* translators: 1: Number of sites on the network */
$blog_text = sprintf( _n( '%s site', '%s sites', $c_blogs ), number_format_i18n( $c_blogs ) );
+ /* translators: 1: Text indicating the number of sites on the network, 2: Text indicating the number of users on the network */
$sentence = sprintf( __( 'You have %1$s and %2$s.' ), $blog_text, $user_text );
if ( $actions ) {
<p>
<label class="screen-reader-text" for="search-users"><?php _e( 'Search Users' ); ?></label>
<input type="search" name="s" value="" size="30" autocomplete="off" id="search-users"/>
- <?php submit_button( __( 'Search Users' ), 'button', false, false, array( 'id' => 'submit_users' ) ); ?>
+ <?php submit_button( __( 'Search Users' ), '', false, false, array( 'id' => 'submit_users' ) ); ?>
</p>
</form>
<p>
<label class="screen-reader-text" for="search-sites"><?php _e( 'Search Sites' ); ?></label>
<input type="search" name="s" value="" size="30" autocomplete="off" id="search-sites"/>
- <?php submit_button( __( 'Search Sites' ), 'button', false, false, array( 'id' => 'submit_sites' ) ); ?>
+ <?php submit_button( __( 'Search Sites' ), '', false, false, array( 'id' => 'submit_sites' ) ); ?>
</p>
</form>
<?php
);
/**
- * 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>";
}
}
if ( !$future_posts && !$recent_posts && !$recent_comments ) {
echo '<div class="no-activity">';
- echo '<p class="smiley"></p>';
+ echo '<p class="smiley" aria-hidden="true"></p>';
echo '<p>' . __( 'No activity yet!' ) . '</p>';
echo '</div>';
}
);
/**
- * 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
*
*/
function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) {
$loading = '<p class="widget-loading hide-if-no-js">' . __( 'Loading…' ) . '</p><p class="hide-if-js">' . __( 'This widget requires JavaScript.' ) . '</p>';
- $doing_ajax = ( defined('DOING_AJAX') && DOING_AJAX );
+ $doing_ajax = wp_doing_ajax();
if ( empty($check_urls) ) {
$widgets = get_option( 'dashboard_widget_options' );
'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
*
)
);
- if ( ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) ) {
+ if ( ( ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS ) && ( ! is_multisite() && is_blog_admin() && current_user_can( 'install_plugins' ) ) || ( is_network_admin() && current_user_can( 'manage_network_plugins' ) && current_user_can( 'install_plugins' ) ) ) {
$feeds['plugins'] = array(
'link' => '',
'url' => array(
/**
* 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
*
$notice .= "<p class='browser-update-nag{$browser_nag_class}'>{$msg}</p>";
$browsehappy = 'http://browsehappy.com/';
- $locale = get_locale();
+ $locale = get_user_locale();
if ( 'en_US' !== $locale )
$browsehappy = add_query_arg( 'locale', $locale, $browsehappy );
}
/**
- * 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
*
*
* @since 3.2.0
*
- * @global string $wp_version
- *
* @return array|bool False on failure, array of browser data on success.
*/
function wp_check_browser_version() {
$key = md5( $_SERVER['HTTP_USER_AGENT'] );
if ( false === ($response = get_site_transient('browser_' . $key) ) ) {
- global $wp_version;
-
$options = array(
'body' => array( 'useragent' => $_SERVER['HTTP_USER_AGENT'] ),
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url()
+ 'user-agent' => 'WordPress/' . get_bloginfo( 'version' ) . '; ' . home_url()
);
$response = wp_remote_post( 'http://api.wordpress.org/core/browse-happy/1.1/', $options );