Update WordPress to 5.2

This commit is contained in:
Oliver Davies 2019-05-08 08:05:39 +01:00
parent 489b5a5914
commit e00f87f2f5
599 changed files with 119573 additions and 55990 deletions

View file

@ -170,7 +170,7 @@ function wp_admin_bar_wp_menu( $wp_admin_bar ) {
array(
'parent' => 'wp-logo-external',
'id' => 'support-forums',
'title' => __( 'Support Forums' ),
'title' => __( 'Support' ),
'href' => __( 'https://wordpress.org/support/' ),
)
);
@ -885,11 +885,15 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) {
$awaiting_mod = wp_count_comments();
$awaiting_mod = $awaiting_mod->moderated;
$awaiting_text = sprintf( _n( '%s comment awaiting moderation', '%s comments awaiting moderation', $awaiting_mod ), number_format_i18n( $awaiting_mod ) );
$awaiting_text = sprintf(
/* translators: %s: number of comments in moderation */
_n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ),
number_format_i18n( $awaiting_mod )
);
$icon = '<span class="ab-icon"></span>';
$title = '<span class="ab-label awaiting-mod pending-count count-' . $awaiting_mod . '" aria-hidden="true">' . number_format_i18n( $awaiting_mod ) . '</span>';
$title .= '<span class="screen-reader-text">' . $awaiting_text . '</span>';
$title .= '<span class="screen-reader-text comments-in-moderation-text">' . $awaiting_text . '</span>';
$wp_admin_bar->add_menu(
array(
@ -1043,6 +1047,32 @@ function wp_admin_bar_search_menu( $wp_admin_bar ) {
);
}
/**
* Add a link to exit recovery mode when Recovery Mode is active.
*
* @since 5.2.0
*
* @param WP_Admin_Bar $wp_admin_bar
*/
function wp_admin_bar_recovery_mode_menu( $wp_admin_bar ) {
if ( ! wp_is_recovery_mode() ) {
return;
}
$url = wp_login_url();
$url = add_query_arg( 'action', WP_Recovery_Mode::EXIT_ACTION, $url );
$url = wp_nonce_url( $url, WP_Recovery_Mode::EXIT_ACTION );
$wp_admin_bar->add_menu(
array(
'parent' => 'top-secondary',
'id' => 'recovery-mode',
'title' => __( 'Exit Recovery Mode' ),
'href' => $url,
)
);
}
/**
* Add secondary menus.
*