Merged in feature/81-dev-dev01 (pull request #5)

auto-patch  81-dev-dev01-2023-12-05T22_45_26

* auto-patch  81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
Tony Volpe
2023-12-05 23:05:59 +00:00
parent ba16964e7a
commit 725d3043d5
1463 changed files with 142461 additions and 89421 deletions

View File

@@ -50,11 +50,11 @@ $menu[4] = array( '', 'read', 'separator1', '', 'wp-menu-separator' );
/* translators: Sites menu item. */
$menu[5] = array( __( 'Sites' ), 'manage_sites', 'sites.php', '', 'menu-top menu-icon-site', 'menu-site', 'dashicons-admin-multisite' );
$submenu['sites.php'][5] = array( __( 'All Sites' ), 'manage_sites', 'sites.php' );
$submenu['sites.php'][10] = array( _x( 'Add New', 'site' ), 'create_sites', 'site-new.php' );
$submenu['sites.php'][10] = array( __( 'Add New Site' ), 'create_sites', 'site-new.php' );
$menu[10] = array( __( 'Users' ), 'manage_network_users', 'users.php', '', 'menu-top menu-icon-users', 'menu-users', 'dashicons-admin-users' );
$submenu['users.php'][5] = array( __( 'All Users' ), 'manage_network_users', 'users.php' );
$submenu['users.php'][10] = array( _x( 'Add New', 'user' ), 'create_users', 'user-new.php' );
$submenu['users.php'][10] = array( __( 'Add New User' ), 'create_users', 'user-new.php' );
if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
$menu[15] = array(
@@ -78,7 +78,7 @@ if ( current_user_can( 'update_themes' ) && $update_data['counts']['themes'] ) {
$menu[15] = array( __( 'Themes' ), 'manage_network_themes', 'themes.php', '', 'menu-top menu-icon-appearance', 'menu-appearance', 'dashicons-admin-appearance' );
}
$submenu['themes.php'][5] = array( __( 'Installed Themes' ), 'manage_network_themes', 'themes.php' );
$submenu['themes.php'][10] = array( _x( 'Add New', 'theme' ), 'install_themes', 'theme-install.php' );
$submenu['themes.php'][10] = array( __( 'Add New Theme' ), 'install_themes', 'theme-install.php' );
$submenu['themes.php'][15] = array( __( 'Theme File Editor' ), 'edit_themes', 'theme-editor.php' );
if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] ) {
@@ -103,7 +103,7 @@ if ( current_user_can( 'update_plugins' ) && $update_data['counts']['plugins'] )
$menu[20] = array( __( 'Plugins' ), 'manage_network_plugins', 'plugins.php', '', 'menu-top menu-icon-plugins', 'menu-plugins', 'dashicons-admin-plugins' );
}
$submenu['plugins.php'][5] = array( __( 'Installed Plugins' ), 'manage_network_plugins', 'plugins.php' );
$submenu['plugins.php'][10] = array( _x( 'Add New', 'plugin' ), 'install_plugins', 'plugin-install.php' );
$submenu['plugins.php'][10] = array( __( 'Add New Plugin' ), 'install_plugins', 'plugin-install.php' );
$submenu['plugins.php'][15] = array( __( 'Plugin File Editor' ), 'edit_plugins', 'plugin-editor.php' );
$menu[25] = array( __( 'Settings' ), 'manage_network_options', 'settings.php', '', 'menu-top menu-icon-settings', 'menu-settings', 'dashicons-admin-settings' );

View File

@@ -138,9 +138,14 @@ if ( $_POST ) {
require_once ABSPATH . 'wp-admin/admin-header.php';
if ( isset( $_GET['updated'] ) ) {
?>
<div id="message" class="notice notice-success is-dismissible"><p><?php _e( 'Settings saved.' ); ?></p></div>
<?php
wp_admin_notice(
__( 'Settings saved.' ),
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
}
?>
@@ -167,24 +172,28 @@ if ( isset( $_GET['updated'] ) ) {
<?php
$new_admin_email = get_site_option( 'new_admin_email' );
if ( $new_admin_email && get_site_option( 'admin_email' ) !== $new_admin_email ) :
?>
<div class="notice notice-warning is-dismissible inline">
<p>
<?php
printf(
/* translators: %s: New network admin email. */
__( 'There is a pending change of the network admin email to %s.' ),
'<code>' . esc_html( $new_admin_email ) . '</code>'
);
printf(
' <a href="%1$s">%2$s</a>',
esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ),
__( 'Cancel' )
);
?>
</p>
</div>
<?php endif; ?>
$notice_message = sprintf(
/* translators: %s: New network admin email. */
__( 'There is a pending change of the network admin email to %s.' ),
'<code>' . esc_html( $new_admin_email ) . '</code>'
);
$notice_message .= sprintf(
' <a href="%1$s">%2$s</a>',
esc_url( wp_nonce_url( network_admin_url( 'settings.php?dismiss=new_network_admin_email' ), 'dismiss_new_network_admin_email' ) ),
__( 'Cancel' )
);
wp_admin_notice(
$notice_message,
array(
'type' => 'warning',
'dismissible' => true,
'additional_classes' => array( 'inline' ),
)
);
endif;
?>
</td>
</tr>
</table>

View File

@@ -146,8 +146,14 @@ network_edit_site_nav(
);
if ( ! empty( $messages ) ) {
$notice_args = array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
);
foreach ( $messages as $msg ) {
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
wp_admin_notice( $msg, $notice_args );
}
}
?>

View File

@@ -192,8 +192,14 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<h1 id="add-new-site"><?php _e( 'Add New Site' ); ?></h1>
<?php
if ( ! empty( $messages ) ) {
$notice_args = array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
);
foreach ( $messages as $msg ) {
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
wp_admin_notice( $msg, $notice_args );
}
}
?>

View File

@@ -104,8 +104,14 @@ network_edit_site_nav(
);
if ( ! empty( $messages ) ) {
$notice_args = array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
);
foreach ( $messages as $msg ) {
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
wp_admin_notice( $msg, $notice_args );
}
}
?>

View File

@@ -196,7 +196,15 @@ if ( isset( $_GET['enabled'] ) ) {
/* translators: %s: Number of themes. */
$message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
}
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
wp_admin_notice(
sprintf( $message, number_format_i18n( $enabled ) ),
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
} elseif ( isset( $_GET['disabled'] ) ) {
$disabled = absint( $_GET['disabled'] );
if ( 1 === $disabled ) {
@@ -205,9 +213,24 @@ if ( isset( $_GET['enabled'] ) ) {
/* translators: %s: Number of themes. */
$message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
}
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
wp_admin_notice(
sprintf( $message, number_format_i18n( $disabled ) ),
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
} elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) {
echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
wp_admin_notice(
__( 'No theme selected.' ),
array(
'type' => 'error',
'dismissible' => true,
'id' => 'message',
)
);
}
?>

View File

@@ -234,41 +234,57 @@ network_edit_site_nav(
);
if ( isset( $_GET['update'] ) ) :
$message = '';
$type = 'error';
switch ( $_GET['update'] ) {
case 'adduser':
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User added.' ) . '</p></div>';
$type = 'success';
$message = __( 'User added.' );
break;
case 'err_add_member':
echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'User is already a member of this site.' ) . '</p></div>';
$message = __( 'User is already a member of this site.' );
break;
case 'err_add_fail':
echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'User could not be added to this site.' ) . '</p></div>';
$message = __( 'User could not be added to this site.' );
break;
case 'err_add_notfound':
echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Enter the username of an existing user.' ) . '</p></div>';
$message = __( 'Enter the username of an existing user.' );
break;
case 'promote':
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
$type = 'success';
$message = __( 'Changed roles.' );
break;
case 'err_promote':
echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Select a user to change role.' ) . '</p></div>';
$message = __( 'Select a user to change role.' );
break;
case 'remove':
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User removed from this site.' ) . '</p></div>';
$type = 'success';
$message = __( 'User removed from this site.' );
break;
case 'err_remove':
echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Select a user to remove.' ) . '</p></div>';
$message = __( 'Select a user to remove.' );
break;
case 'newuser':
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . __( 'User created.' ) . '</p></div>';
$type = 'success';
$message = __( 'User created.' );
break;
case 'err_new':
echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Enter the username and email.' ) . '</p></div>';
$message = __( 'Enter the username and email.' );
break;
case 'err_new_dup':
echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'Duplicated username or email address.' ) . '</p></div>';
$message = __( 'Duplicated username or email address.' );
break;
}
wp_admin_notice(
$message,
array(
'type' => $type,
'dismissible' => true,
'id' => 'message',
)
);
endif;
?>

View File

@@ -358,7 +358,14 @@ if ( isset( $_GET['updated'] ) ) {
}
if ( ! empty( $msg ) ) {
$msg = '<div id="message" class="notice notice-success is-dismissible"><p>' . $msg . '</p></div>';
$msg = wp_get_admin_notice(
$msg,
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
}
}
@@ -371,7 +378,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<h1 class="wp-heading-inline"><?php _e( 'Sites' ); ?></h1>
<?php if ( current_user_can( 'create_sites' ) ) : ?>
<a href="<?php echo esc_url( network_admin_url( 'site-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
<a href="<?php echo esc_url( network_admin_url( 'site-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add New Site' ); ?></a>
<?php endif; ?>
<?php

View File

@@ -135,11 +135,25 @@ if ( $action ) {
<div class="wrap">
<?php if ( 1 === $themes_to_delete ) : ?>
<h1><?php _e( 'Delete Theme' ); ?></h1>
<div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'This theme may be active on other sites in the network.' ); ?></p></div>
<?php
wp_admin_notice(
'<strong>' . __( 'Caution:' ) . '</strong> ' . __( 'This theme may be active on other sites in the network.' ),
array(
'additional_classes' => array( 'error' ),
)
);
?>
<p><?php _e( 'You are about to remove the following theme:' ); ?></p>
<?php else : ?>
<h1><?php _e( 'Delete Themes' ); ?></h1>
<div class="error"><p><strong><?php _e( 'Caution:' ); ?></strong> <?php _e( 'These themes may be active on other sites in the network.' ); ?></p></div>
<?php
wp_admin_notice(
'<strong>' . __( 'Caution:' ) . '</strong> ' . __( 'These themes may be active on other sites in the network.' ),
array(
'additional_classes' => array( 'error' ),
)
);
?>
<p><?php _e( 'You are about to remove the following themes:' ); ?></p>
<?php endif; ?>
<ul class="ul-disc">
@@ -349,7 +363,7 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<h1 class="wp-heading-inline"><?php echo esc_html( $title ); ?></h1>
<?php if ( current_user_can( 'install_themes' ) ) : ?>
<a href="theme-install.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'theme' ); ?></a>
<a href="theme-install.php" class="page-title-action"><?php echo esc_html__( 'Add New Theme' ); ?></a>
<?php endif; ?>
<?php
@@ -367,57 +381,82 @@ if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
<hr class="wp-header-end">
<?php
$message = '';
$type = 'success';
if ( isset( $_GET['enabled'] ) ) {
$enabled = absint( $_GET['enabled'] );
if ( 1 === $enabled ) {
$message = __( 'Theme enabled.' );
} else {
/* translators: %s: Number of themes. */
$message = _n( '%s theme enabled.', '%s themes enabled.', $enabled );
$message = sprintf(
/* translators: %s: Number of themes. */
_n( '%s theme enabled.', '%s themes enabled.', $enabled ),
number_format_i18n( $enabled )
);
}
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
} elseif ( isset( $_GET['disabled'] ) ) {
$disabled = absint( $_GET['disabled'] );
if ( 1 === $disabled ) {
$message = __( 'Theme disabled.' );
} else {
/* translators: %s: Number of themes. */
$message = _n( '%s theme disabled.', '%s themes disabled.', $disabled );
$message = sprintf(
/* translators: %s: Number of themes. */
_n( '%s theme disabled.', '%s themes disabled.', $disabled ),
number_format_i18n( $disabled )
);
}
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
} elseif ( isset( $_GET['deleted'] ) ) {
$deleted = absint( $_GET['deleted'] );
if ( 1 === $deleted ) {
$message = __( 'Theme deleted.' );
} else {
/* translators: %s: Number of themes. */
$message = _n( '%s theme deleted.', '%s themes deleted.', $deleted );
$message = sprintf(
/* translators: %s: Number of themes. */
_n( '%s theme deleted.', '%s themes deleted.', $deleted ),
number_format_i18n( $deleted )
);
}
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $deleted ) ) . '</p></div>';
} elseif ( isset( $_GET['enabled-auto-update'] ) ) {
$enabled = absint( $_GET['enabled-auto-update'] );
if ( 1 === $enabled ) {
$message = __( 'Theme will be auto-updated.' );
} else {
/* translators: %s: Number of themes. */
$message = _n( '%s theme will be auto-updated.', '%s themes will be auto-updated.', $enabled );
$message = sprintf(
/* translators: %s: Number of themes. */
_n( '%s theme will be auto-updated.', '%s themes will be auto-updated.', $enabled ),
number_format_i18n( $enabled )
);
}
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $enabled ) ) . '</p></div>';
} elseif ( isset( $_GET['disabled-auto-update'] ) ) {
$disabled = absint( $_GET['disabled-auto-update'] );
if ( 1 === $disabled ) {
$message = __( 'Theme will no longer be auto-updated.' );
} else {
/* translators: %s: Number of themes. */
$message = _n( '%s theme will no longer be auto-updated.', '%s themes will no longer be auto-updated.', $disabled );
$message = sprintf(
/* translators: %s: Number of themes. */
_n( '%s theme will no longer be auto-updated.', '%s themes will no longer be auto-updated.', $disabled ),
number_format_i18n( $disabled )
);
}
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>';
} elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) {
echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>';
$message = __( 'No theme selected.' );
$type = 'error';
} elseif ( isset( $_GET['error'] ) && 'main' === $_GET['error'] ) {
echo '<div id="message" class="notice notice-error is-dismissible"><p>' . __( 'You cannot delete a theme while it is active on the main site.' ) . '</p></div>';
$message = __( 'You cannot delete a theme while it is active on the main site.' );
$type = 'error';
}
if ( '' !== $message ) {
wp_admin_notice(
$message,
array(
'type' => $type,
'dismissible' => true,
'id' => 'message',
)
);
}
?>
<form method="get">

View File

@@ -107,19 +107,33 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
<h1 id="add-new-user"><?php _e( 'Add New User' ); ?></h1>
<?php
if ( '' !== $message ) {
echo '<div id="message" class="notice notice-success is-dismissible"><p>' . $message . '</p></div>';
wp_admin_notice(
$message,
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
}
if ( isset( $add_user_errors ) && is_wp_error( $add_user_errors ) ) {
?>
<div id="message" class="notice notice-error is-dismissible">
<?php
foreach ( $add_user_errors->get_error_messages() as $error ) {
echo "<p>$error</p>";
}
?>
</div>
<?php } ?>
$error_messages = '';
foreach ( $add_user_errors->get_error_messages() as $error ) {
$error_messages .= "<p>$error</p>";
}
wp_admin_notice(
$error_messages,
array(
'type' => 'error',
'dismissible' => true,
'id' => 'message',
'paragraph_wrap' => false,
)
);
}
?>
<form action="<?php echo esc_url( network_admin_url( 'user-new.php?action=add-user' ) ); ?>" id="adduser" method="post" novalidate="novalidate">
<p><?php echo wp_required_field_message(); ?></p>
<table class="form-table" role="presentation">

View File

@@ -184,7 +184,7 @@ if ( isset( $_GET['action'] ) ) {
continue;
}
wpmu_delete_user( $id );
$i++;
++$i;
}
}
@@ -254,29 +254,33 @@ get_current_screen()->set_screen_reader_content(
require_once ABSPATH . 'wp-admin/admin-header.php';
if ( isset( $_REQUEST['updated'] ) && 'true' === $_REQUEST['updated'] && ! empty( $_REQUEST['action'] ) ) {
?>
<div id="message" class="notice notice-success is-dismissible"><p>
<?php
switch ( $_REQUEST['action'] ) {
case 'delete':
_e( 'User deleted.' );
break;
case 'all_spam':
_e( 'Users marked as spam.' );
break;
case 'all_notspam':
_e( 'Users removed from spam.' );
break;
case 'all_delete':
_e( 'Users deleted.' );
break;
case 'add':
_e( 'User added.' );
break;
}
?>
</p></div>
<?php
$message = '';
switch ( $_REQUEST['action'] ) {
case 'delete':
$message = __( 'User deleted.' );
break;
case 'all_spam':
$message = __( 'Users marked as spam.' );
break;
case 'all_notspam':
$message = __( 'Users removed from spam.' );
break;
case 'all_delete':
$message = __( 'Users deleted.' );
break;
case 'add':
$message = __( 'User added.' );
break;
}
wp_admin_notice(
$message,
array(
'type' => 'success',
'dismissible' => true,
'id' => 'message',
)
);
}
?>
<div class="wrap">
@@ -285,7 +289,7 @@ if ( isset( $_REQUEST['updated'] ) && 'true' === $_REQUEST['updated'] && ! empty
<?php
if ( current_user_can( 'create_users' ) ) :
?>
<a href="<?php echo esc_url( network_admin_url( 'user-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
<a href="<?php echo esc_url( network_admin_url( 'user-new.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add New User' ); ?></a>
<?php
endif;