Administration: Use `wp_admin_notice()` for `.updated`.
Add usages of `wp_admin_notice()` and `wp_get_admin_notice()` on `.updated` in the root level of `/wp-admin/`. Ongoing task to implement new function across core. Props costdev, joedolson. See #57791. Built from https://develop.svn.wordpress.org/trunk@56573 git-svn-id: http://core.svn.wordpress.org/trunk@56085 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d2cc86d508
commit
768f51f60c
|
@ -411,9 +411,13 @@ if ( isset( $_REQUEST['approved'] )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(
|
wp_admin(
|
||||||
'<div id="moderated" class="updated notice is-dismissible"><p>%s</p></div>',
|
implode( "<br />\n", $messages ),
|
||||||
implode( "<br />\n", $messages )
|
array(
|
||||||
|
'id' => 'moderated',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,9 +91,18 @@ echo esc_html( $title );
|
||||||
|
|
||||||
<hr class="wp-header-end">
|
<hr class="wp-header-end">
|
||||||
|
|
||||||
<?php if ( isset( $_GET['added'] ) ) : ?>
|
<?php
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Link added.' ); ?></p></div>
|
if ( isset( $_GET['added'] ) ) {
|
||||||
<?php endif; ?>
|
wp_admin_notice(
|
||||||
|
__( 'Link added.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<form name="<?php echo esc_attr( $form_name ); ?>" id="<?php echo esc_attr( $form_name ); ?>" method="post" action="link.php">
|
<form name="<?php echo esc_attr( $form_name ); ?>" id="<?php echo esc_attr( $form_name ); ?>" method="post" action="link.php">
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -469,9 +469,13 @@ foreach ( $bulk_counts as $message => $count ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $messages ) {
|
if ( $messages ) {
|
||||||
printf(
|
wp_admin_notice(
|
||||||
'<div id="message" class="updated notice is-dismissible"><p>%s</p></div>',
|
implode( ' ', $messages ),
|
||||||
implode( ' ', $messages )
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
unset( $messages );
|
unset( $messages );
|
||||||
|
|
|
@ -119,11 +119,17 @@ if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ( isset( $_REQUEST['deleted'] ) ) {
|
if ( isset( $_REQUEST['deleted'] ) ) {
|
||||||
echo '<div id="message" class="updated notice is-dismissible"><p>';
|
|
||||||
$deleted = (int) $_REQUEST['deleted'];
|
$deleted = (int) $_REQUEST['deleted'];
|
||||||
/* translators: %s: Number of links. */
|
/* translators: %s: Number of links. */
|
||||||
printf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted );
|
$deleted_message = sprintf( _n( '%s link deleted.', '%s links deleted.', $deleted ), $deleted );
|
||||||
echo '</p></div>';
|
wp_admin_notice(
|
||||||
|
$deleted_message,
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] );
|
$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'deleted' ), $_SERVER['REQUEST_URI'] );
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -281,7 +281,14 @@ switch ( $action ) {
|
||||||
check_admin_referer( 'delete-menu_item_' . $menu_item_id );
|
check_admin_referer( 'delete-menu_item_' . $menu_item_id );
|
||||||
|
|
||||||
if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) {
|
if ( is_nav_menu_item( $menu_item_id ) && wp_delete_post( $menu_item_id, true ) ) {
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'The menu item has been successfully deleted.' ) . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
|
__( 'The menu item has been successfully deleted.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -302,9 +309,23 @@ switch ( $action ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_wp_error( $deletion ) ) {
|
if ( is_wp_error( $deletion ) ) {
|
||||||
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $deletion->get_error_message() . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
|
$deletion->get_error_message(),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'error' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'The menu has been successfully deleted.' ) . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
|
__( 'The menu has been successfully deleted.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -320,13 +341,27 @@ switch ( $action ) {
|
||||||
$deletion = wp_delete_nav_menu( $menu_id_to_delete );
|
$deletion = wp_delete_nav_menu( $menu_id_to_delete );
|
||||||
|
|
||||||
if ( is_wp_error( $deletion ) ) {
|
if ( is_wp_error( $deletion ) ) {
|
||||||
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $deletion->get_error_message() . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
|
$deletion->get_error_message(),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'error' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
$deletion_error = true;
|
$deletion_error = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( empty( $deletion_error ) ) {
|
if ( empty( $deletion_error ) ) {
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Selected menus have been successfully deleted.' ) . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
|
__( 'Selected menus have been successfully deleted.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -431,7 +466,14 @@ switch ( $action ) {
|
||||||
|
|
||||||
if ( is_wp_error( $_nav_menu_selected_id ) ) {
|
if ( is_wp_error( $_nav_menu_selected_id ) ) {
|
||||||
$_menu_object = $_nav_menu_selected_id;
|
$_menu_object = $_nav_menu_selected_id;
|
||||||
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . $_nav_menu_selected_id->get_error_message() . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
|
$_nav_menu_selected_id->get_error_message(),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'error' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id );
|
$_menu_object = wp_get_nav_menu_object( $_nav_menu_selected_id );
|
||||||
$nav_menu_selected_title = $_menu_object->name;
|
$nav_menu_selected_title = $_menu_object->name;
|
||||||
|
@ -614,11 +656,19 @@ wp_nav_menu_setup();
|
||||||
wp_initial_nav_menu_meta_boxes();
|
wp_initial_nav_menu_meta_boxes();
|
||||||
|
|
||||||
if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) {
|
if ( ! current_theme_supports( 'menus' ) && ! $num_locations ) {
|
||||||
$messages[] = '<div id="message" class="updated"><p>' . sprintf(
|
$message_no_theme_support = sprintf(
|
||||||
/* translators: %s: URL to Widgets screen. */
|
/* translators: %s: URL to Widgets screen. */
|
||||||
__( 'Your theme does not natively support menus, but you can use them in sidebars by adding a “Navigation Menu” widget on the <a href="%s">Widgets</a> screen.' ),
|
__( 'Your theme does not natively support menus, but you can use them in sidebars by adding a “Navigation Menu” widget on the <a href="%s">Widgets</a> screen.' ),
|
||||||
admin_url( 'widgets.php' )
|
admin_url( 'widgets.php' )
|
||||||
) . '</p></div>';
|
);
|
||||||
|
$messages[] = wp_get_admin_notice(
|
||||||
|
$message_no_theme_support,
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! $locations_screen ) : // Main tab.
|
if ( ! $locations_screen ) : // Main tab.
|
||||||
|
|
|
@ -139,25 +139,25 @@ if ( ! is_multisite() ) {
|
||||||
<p class="description" id="new-admin-email-description"><?php _e( 'This address is used for admin purposes. If you change this, an email will be sent to your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?></p>
|
<p class="description" id="new-admin-email-description"><?php _e( 'This address is used for admin purposes. If you change this, an email will be sent to your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?></p>
|
||||||
<?php
|
<?php
|
||||||
$new_admin_email = get_option( 'new_admin_email' );
|
$new_admin_email = get_option( 'new_admin_email' );
|
||||||
if ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) :
|
if ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) {
|
||||||
?>
|
$pending_admin_email_message = sprintf(
|
||||||
<div class="updated inline">
|
|
||||||
<p>
|
|
||||||
<?php
|
|
||||||
printf(
|
|
||||||
/* translators: %s: New admin email. */
|
/* translators: %s: New admin email. */
|
||||||
__( 'There is a pending change of the admin email to %s.' ),
|
__( 'There is a pending change of the admin email to %s.' ),
|
||||||
'<code>' . esc_html( $new_admin_email ) . '</code>'
|
'<code>' . esc_html( $new_admin_email ) . '</code>'
|
||||||
);
|
);
|
||||||
printf(
|
$pending_admin_email_message .= sprintf(
|
||||||
' <a href="%1$s">%2$s</a>',
|
' <a href="%1$s">%2$s</a>',
|
||||||
esc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ),
|
esc_url( wp_nonce_url( admin_url( 'options.php?dismiss=new_admin_email' ), 'dismiss-' . get_current_blog_id() . '-new_admin_email' ) ),
|
||||||
__( 'Cancel' )
|
__( 'Cancel' )
|
||||||
);
|
);
|
||||||
|
wp_admin_notice(
|
||||||
|
$pending_admin_email_message,
|
||||||
|
array(
|
||||||
|
'additional_classes' => array( 'updated', 'inline' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
|
@ -618,7 +618,7 @@ if ( ! empty( $invalid ) ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $_GET['error'] ) ) :
|
if ( isset( $_GET['error'] ) ) {
|
||||||
|
|
||||||
if ( isset( $_GET['main'] ) ) {
|
if ( isset( $_GET['main'] ) ) {
|
||||||
$errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );
|
$errmsg = __( 'You cannot delete a plugin while it is active on the main site.' );
|
||||||
|
@ -639,10 +639,6 @@ if ( isset( $_GET['error'] ) ) :
|
||||||
$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );
|
$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' );
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
||||||
<div id="message" class="error"><p><?php echo $errmsg; ?></p>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] )
|
if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] )
|
||||||
&& isset( $_GET['_error_nonce'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin )
|
&& isset( $_GET['_error_nonce'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin )
|
||||||
) {
|
) {
|
||||||
|
@ -655,66 +651,71 @@ if ( isset( $_GET['error'] ) ) :
|
||||||
admin_url( 'plugins.php' )
|
admin_url( 'plugins.php' )
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
$errmsg .= '<iframe style="border:0" width="100%" height="70px" src="' . esc_url( $iframe_url ) . '"></iframe>';
|
||||||
<iframe style="border:0" width="100%" height="70px" src="<?php echo esc_url( $iframe_url ); ?>"></iframe>
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
wp_admin_notice(
|
||||||
</div>
|
$errmsg,
|
||||||
<?php
|
array(
|
||||||
elseif ( isset( $_GET['deleted'] ) ) :
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'error' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
} elseif ( isset( $_GET['deleted'] ) ) {
|
||||||
$delete_result = get_transient( 'plugins_delete_result_' . $user_ID );
|
$delete_result = get_transient( 'plugins_delete_result_' . $user_ID );
|
||||||
// Delete it once we're done.
|
// Delete it once we're done.
|
||||||
delete_transient( 'plugins_delete_result_' . $user_ID );
|
delete_transient( 'plugins_delete_result_' . $user_ID );
|
||||||
|
|
||||||
if ( is_wp_error( $delete_result ) ) :
|
if ( is_wp_error( $delete_result ) ) {
|
||||||
?>
|
$plugin_not_deleted_message = sprintf(
|
||||||
<div id="message" class="error notice is-dismissible">
|
|
||||||
<p>
|
|
||||||
<?php
|
|
||||||
printf(
|
|
||||||
/* translators: %s: Error message. */
|
/* translators: %s: Error message. */
|
||||||
__( 'Plugin could not be deleted due to an error: %s' ),
|
__( 'Plugin could not be deleted due to an error: %s' ),
|
||||||
esc_html( $delete_result->get_error_message() )
|
esc_html( $delete_result->get_error_message() )
|
||||||
);
|
);
|
||||||
?>
|
wp_admin_notice(
|
||||||
</p>
|
$plugin_not_deleted_message,
|
||||||
</div>
|
array(
|
||||||
<?php else : ?>
|
'id' => 'message',
|
||||||
<div id="message" class="updated notice is-dismissible">
|
'additional_classes' => array( 'error' ),
|
||||||
<p>
|
'dismissible' => true,
|
||||||
<?php
|
)
|
||||||
if ( 1 === (int) $_GET['deleted'] ) {
|
);
|
||||||
_e( 'The selected plugin has been deleted.' );
|
|
||||||
} else {
|
} else {
|
||||||
_e( 'The selected plugins have been deleted.' );
|
$updated_args = array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
);
|
||||||
|
if ( 1 === (int) $_GET['deleted'] ) {
|
||||||
|
$plugins_deleted_message = __( 'The selected plugin has been deleted.' );
|
||||||
|
} else {
|
||||||
|
$plugins_deleted_message = __( 'The selected plugins have been deleted.' );
|
||||||
|
}
|
||||||
|
wp_admin_notice( $plugins_deleted_message, $updated_args );
|
||||||
|
}
|
||||||
|
} elseif ( isset( $_GET['activate'] ) ) {
|
||||||
|
wp_admin_notice( __( 'Plugin activated.' ), $updated_args );
|
||||||
|
} elseif ( isset( $_GET['activate-multi'] ) ) {
|
||||||
|
wp_admin_notice( __( 'Selected plugins activated.' ), $updated_args );
|
||||||
|
} elseif ( isset( $_GET['deactivate'] ) ) {
|
||||||
|
wp_admin_notice( __( 'Plugin deactivated.' ), $updated_args );
|
||||||
|
} elseif ( isset( $_GET['deactivate-multi'] ) ) {
|
||||||
|
wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_args );
|
||||||
|
} elseif ( 'update-selected' === $action ) {
|
||||||
|
wp_admin_notice( __( 'All selected plugins are up to date.' ), $updated_args );
|
||||||
|
} elseif ( isset( $_GET['resume'] ) ) {
|
||||||
|
wp_admin_notice( __( 'Plugin resumed.' ), $updated_args );
|
||||||
|
} elseif ( isset( $_GET['enabled-auto-update'] ) ) {
|
||||||
|
wp_admin_notice( __( 'Plugin will be auto-updated.' ), $updated_args );
|
||||||
|
} elseif ( isset( $_GET['disabled-auto-update'] ) ) {
|
||||||
|
wp_admin_notice( __( 'Plugin will no longer be auto-updated.' ), $updated_args );
|
||||||
|
} elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) {
|
||||||
|
wp_admin_notice( __( 'Selected plugins will be auto-updated.' ), $updated_args );
|
||||||
|
} elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) {
|
||||||
|
wp_admin_notice( __( 'Selected plugins will no longer be auto-updated.' ), $updated_args );
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php elseif ( isset( $_GET['activate'] ) ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin activated.' ); ?></p></div>
|
|
||||||
<?php elseif ( isset( $_GET['activate-multi'] ) ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins activated.' ); ?></p></div>
|
|
||||||
<?php elseif ( isset( $_GET['deactivate'] ) ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin deactivated.' ); ?></p></div>
|
|
||||||
<?php elseif ( isset( $_GET['deactivate-multi'] ) ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins deactivated.' ); ?></p></div>
|
|
||||||
<?php elseif ( 'update-selected' === $action ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'All selected plugins are up to date.' ); ?></p></div>
|
|
||||||
<?php elseif ( isset( $_GET['resume'] ) ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin resumed.' ); ?></p></div>
|
|
||||||
<?php elseif ( isset( $_GET['enabled-auto-update'] ) ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin will be auto-updated.' ); ?></p></div>
|
|
||||||
<?php elseif ( isset( $_GET['disabled-auto-update'] ) ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Plugin will no longer be auto-updated.' ); ?></p></div>
|
|
||||||
<?php elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins will be auto-updated.' ); ?></p></div>
|
|
||||||
<?php elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php _e( 'Selected plugins will no longer be auto-updated.' ); ?></p></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div class="wrap">
|
<div class="wrap">
|
||||||
<h1 class="wp-heading-inline">
|
<h1 class="wp-heading-inline">
|
||||||
|
|
|
@ -260,43 +260,86 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||||
<hr class="wp-header-end">
|
<hr class="wp-header-end">
|
||||||
<?php
|
<?php
|
||||||
if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) {
|
if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) {
|
||||||
?>
|
wp_admin_notice(
|
||||||
<div id="message1" class="updated notice is-dismissible"><p><?php _e( 'The active theme is broken. Reverting to the default theme.' ); ?></p></div>
|
__( 'The active theme is broken. Reverting to the default theme.' ),
|
||||||
<?php
|
array(
|
||||||
|
'id' => 'message1',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
} elseif ( isset( $_GET['activated'] ) ) {
|
} elseif ( isset( $_GET['activated'] ) ) {
|
||||||
if ( isset( $_GET['previewed'] ) ) {
|
if ( isset( $_GET['previewed'] ) ) {
|
||||||
?>
|
wp_admin_notice(
|
||||||
<div id="message2" class="updated notice is-dismissible"><p><?php _e( 'Settings saved and theme activated.' ); ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Visit site' ); ?></a></p></div>
|
__( 'Settings saved and theme activated.' ) . '<a href="' . esc_url( home_url( '/' ) ) . '">' . __( 'Visit site' ) . '</a>',
|
||||||
<?php
|
array(
|
||||||
|
'id' => 'message2',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
?>
|
wp_admin_notice(
|
||||||
<div id="message2" class="updated notice is-dismissible"><p><?php _e( 'New theme activated.' ); ?> <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php _e( 'Visit site' ); ?></a></p></div>
|
__( 'New theme activated.' ) . '<a href="' . esc_url( home_url( '/' ) ) . '">' . __( 'Visit site' ) . '</a>',
|
||||||
<?php
|
array(
|
||||||
|
'id' => 'message2',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} elseif ( isset( $_GET['deleted'] ) ) {
|
} elseif ( isset( $_GET['deleted'] ) ) {
|
||||||
?>
|
wp_admin_notice(
|
||||||
<div id="message3" class="updated notice is-dismissible"><p><?php _e( 'Theme deleted.' ); ?></p></div>
|
__( 'Theme deleted.' ),
|
||||||
<?php
|
array(
|
||||||
|
'id' => 'message3',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
} elseif ( isset( $_GET['delete-active-child'] ) ) {
|
} elseif ( isset( $_GET['delete-active-child'] ) ) {
|
||||||
?>
|
wp_admin_notice(
|
||||||
<div id="message4" class="error"><p><?php _e( 'You cannot delete a theme while it has an active child theme.' ); ?></p></div>
|
__( 'You cannot delete a theme while it has an active child theme.' ),
|
||||||
<?php
|
array(
|
||||||
|
'id' => 'message4',
|
||||||
|
'additional_classes' => array( 'error' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
} elseif ( isset( $_GET['resumed'] ) ) {
|
} elseif ( isset( $_GET['resumed'] ) ) {
|
||||||
?>
|
wp_admin_notice(
|
||||||
<div id="message5" class="updated notice is-dismissible"><p><?php _e( 'Theme resumed.' ); ?></p></div>
|
__( 'Theme resumed.' ),
|
||||||
<?php
|
array(
|
||||||
|
'id' => 'message5',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
} elseif ( isset( $_GET['error'] ) && 'resuming' === $_GET['error'] ) {
|
} elseif ( isset( $_GET['error'] ) && 'resuming' === $_GET['error'] ) {
|
||||||
?>
|
wp_admin_notice(
|
||||||
<div id="message6" class="error"><p><?php _e( 'Theme could not be resumed because it triggered a <strong>fatal error</strong>.' ); ?></p></div>
|
__( 'Theme could not be resumed because it triggered a <strong>fatal error</strong>.' ),
|
||||||
<?php
|
array(
|
||||||
|
'id' => 'message6',
|
||||||
|
'additional_classes' => array( 'error' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
} elseif ( isset( $_GET['enabled-auto-update'] ) ) {
|
} elseif ( isset( $_GET['enabled-auto-update'] ) ) {
|
||||||
?>
|
wp_admin_notice(
|
||||||
<div id="message7" class="updated notice is-dismissible"><p><?php _e( 'Theme will be auto-updated.' ); ?></p></div>
|
__( 'Theme will be auto-updated.' ),
|
||||||
<?php
|
array(
|
||||||
|
'id' => 'message7',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
} elseif ( isset( $_GET['disabled-auto-update'] ) ) {
|
} elseif ( isset( $_GET['disabled-auto-update'] ) ) {
|
||||||
?>
|
wp_admin_notice(
|
||||||
<div id="message8" class="updated notice is-dismissible"><p><?php _e( 'Theme will no longer be auto-updated.' ); ?></p></div>
|
__( 'Theme will no longer be auto-updated.' ),
|
||||||
<?php
|
array(
|
||||||
|
'id' => 'message8',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$current_theme = wp_get_theme();
|
$current_theme = wp_get_theme();
|
||||||
|
|
|
@ -218,21 +218,41 @@ if ( 'grid' === $mode ) {
|
||||||
|
|
||||||
<hr class="wp-header-end">
|
<hr class="wp-header-end">
|
||||||
|
|
||||||
<?php if ( ! empty( $message ) ) : ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php echo $message; ?></p></div>
|
|
||||||
<?php endif; ?>
|
|
||||||
|
|
||||||
<div class="error hide-if-js">
|
|
||||||
<p>
|
|
||||||
<?php
|
<?php
|
||||||
printf(
|
if ( ! empty( $message ) ) {
|
||||||
|
wp_admin_notice(
|
||||||
|
$message,
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! empty( $message ) ) {
|
||||||
|
wp_admin_notice(
|
||||||
|
$message,
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
$js_required_message = sprintf(
|
||||||
/* translators: %s: List view URL. */
|
/* translators: %s: List view URL. */
|
||||||
__( 'The grid view for the Media Library requires JavaScript. <a href="%s">Switch to the list view</a>.' ),
|
__( 'The grid view for the Media Library requires JavaScript. <a href="%s">Switch to the list view</a>.' ),
|
||||||
'upload.php?mode=list'
|
'upload.php?mode=list'
|
||||||
);
|
);
|
||||||
|
wp_admin_notice(
|
||||||
|
$js_required_message,
|
||||||
|
array(
|
||||||
|
additional_classes( 'error', 'hide-if-js' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||||
|
@ -426,9 +446,18 @@ if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
|
||||||
|
|
||||||
<hr class="wp-header-end">
|
<hr class="wp-header-end">
|
||||||
|
|
||||||
<?php if ( ! empty( $message ) ) : ?>
|
<?php
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php echo $message; ?></p></div>
|
if ( ! empty( $message ) ) {
|
||||||
<?php endif; ?>
|
wp_admin_notice(
|
||||||
|
$message,
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<form id="posts-filter" method="get">
|
<form id="posts-filter" method="get">
|
||||||
|
|
||||||
|
|
|
@ -545,25 +545,28 @@ switch ( $action ) {
|
||||||
</p>
|
</p>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php $new_email = get_user_meta( $current_user->ID, '_new_email', true ); ?>
|
|
||||||
<?php if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profile_user->ID === $current_user->ID ) : ?>
|
|
||||||
<div class="updated inline">
|
|
||||||
<p>
|
|
||||||
<?php
|
<?php
|
||||||
printf(
|
$new_email = get_user_meta( $current_user->ID, '_new_email', true );
|
||||||
|
if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profile_user->ID === $current_user->ID ) :
|
||||||
|
|
||||||
|
$pending_change_message = sprintf(
|
||||||
/* translators: %s: New email. */
|
/* translators: %s: New email. */
|
||||||
__( 'There is a pending change of your email to %s.' ),
|
__( 'There is a pending change of your email to %s.' ),
|
||||||
'<code>' . esc_html( $new_email['newemail'] ) . '</code>'
|
'<code>' . esc_html( $new_email['newemail'] ) . '</code>'
|
||||||
);
|
);
|
||||||
printf(
|
$pending_change_message .= sprintf(
|
||||||
' <a href="%1$s">%2$s</a>',
|
' <a href="%1$s">%2$s</a>',
|
||||||
esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ),
|
esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ),
|
||||||
__( 'Cancel' )
|
__( 'Cancel' )
|
||||||
);
|
);
|
||||||
|
wp_admin_notice(
|
||||||
|
$pending_change_message,
|
||||||
|
array(
|
||||||
|
'additional_classes' => array( 'updated', 'inline' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
endif;
|
||||||
?>
|
?>
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<?php endif; ?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
|
@ -396,7 +396,14 @@ endif;
|
||||||
|
|
||||||
if ( ! empty( $messages ) ) {
|
if ( ! empty( $messages ) ) {
|
||||||
foreach ( $messages as $msg ) {
|
foreach ( $messages as $msg ) {
|
||||||
echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
|
wp_admin_notice(
|
||||||
|
$msg,
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -610,11 +610,18 @@ switch ( $wp_list_table->current_action() ) {
|
||||||
/* translators: %s: Number of users. */
|
/* translators: %s: Number of users. */
|
||||||
$message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
|
$message = _n( '%s user deleted.', '%s users deleted.', $delete_count );
|
||||||
}
|
}
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $delete_count ) ) . '</p></div>';
|
$message = sprintf( $message, number_format_i18n( $delete_count ) );
|
||||||
|
$messages[] = wp_get_admin_notice(
|
||||||
|
$message,
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'add':
|
case 'add':
|
||||||
$message = __( 'New user created.' );
|
$message = __( 'New user created.' );
|
||||||
|
|
||||||
$user_id = isset( $_GET['id'] ) ? $_GET['id'] : false;
|
$user_id = isset( $_GET['id'] ) ? $_GET['id'] : false;
|
||||||
if ( $user_id && current_user_can( 'edit_user', $user_id ) ) {
|
if ( $user_id && current_user_can( 'edit_user', $user_id ) ) {
|
||||||
$message .= sprintf(
|
$message .= sprintf(
|
||||||
|
@ -630,7 +637,14 @@ switch ( $wp_list_table->current_action() ) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . $message . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
|
$message,
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'resetpassword':
|
case 'resetpassword':
|
||||||
$reset_count = isset( $_GET['reset_count'] ) ? (int) $_GET['reset_count'] : 0;
|
$reset_count = isset( $_GET['reset_count'] ) ? (int) $_GET['reset_count'] : 0;
|
||||||
|
@ -640,25 +654,89 @@ switch ( $wp_list_table->current_action() ) {
|
||||||
/* translators: %s: Number of users. */
|
/* translators: %s: Number of users. */
|
||||||
$message = _n( 'Password reset links sent to %s user.', 'Password reset links sent to %s users.', $reset_count );
|
$message = _n( 'Password reset links sent to %s user.', 'Password reset links sent to %s users.', $reset_count );
|
||||||
}
|
}
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $reset_count ) ) . '</p></div>';
|
$message = sprintf( $message, number_format_i18n( $reset_count ) );
|
||||||
|
$messages[] = wp_get_admin_notice(
|
||||||
|
$message,
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'promote':
|
case 'promote':
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Changed roles.' ) . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
|
__( 'Changed roles.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'err_admin_role':
|
case 'err_admin_role':
|
||||||
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'The current user’s role must have user editing capabilities.' ) . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other user roles have been changed.' ) . '</p></div>';
|
__( 'The current user’s role must have user editing capabilities.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'error' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$messages[] = wp_get_admin_notice(
|
||||||
|
__( 'Other user roles have been changed.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'err_admin_del':
|
case 'err_admin_del':
|
||||||
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'You cannot delete the current user.' ) . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' . __( 'Other users have been deleted.' ) . '</p></div>';
|
__( 'You cannot delete the current user.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'error' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$messages[] = wp_get_admin_notice(
|
||||||
|
__( 'Other users have been deleted.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'remove':
|
case 'remove':
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'User removed from this site.' ) . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
|
__( 'User removed from this site.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated', 'fade' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'err_admin_remove':
|
case 'err_admin_remove':
|
||||||
$messages[] = '<div id="message" class="error notice is-dismissible"><p>' . __( 'You cannot remove the current user.' ) . '</p></div>';
|
$messages[] = wp_get_admin_notice(
|
||||||
$messages[] = '<div id="message" class="updated notice is-dismissible fade"><p>' . __( 'Other users have been removed.' ) . '</p></div>';
|
__( 'You cannot remove the current user.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'error' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$messages[] = wp_get_admin_notice(
|
||||||
|
__( 'Other users have been removed.' ),
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated', 'fade' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
endif;
|
endif;
|
||||||
|
|
|
@ -403,14 +403,28 @@ $nonce = wp_create_nonce( 'widgets-access' );
|
||||||
|
|
||||||
<hr class="wp-header-end">
|
<hr class="wp-header-end">
|
||||||
|
|
||||||
<?php if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) { ?>
|
|
||||||
<div id="message" class="updated notice is-dismissible"><p><?php echo $messages[ $_GET['message'] ]; ?></p></div>
|
|
||||||
<?php } ?>
|
|
||||||
<?php if ( isset( $_GET['error'] ) && isset( $errors[ $_GET['error'] ] ) ) { ?>
|
|
||||||
<div id="message" class="error"><p><?php echo $errors[ $_GET['error'] ]; ?></p></div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
if ( isset( $_GET['message'] ) && isset( $messages[ $_GET['message'] ] ) ) {
|
||||||
|
wp_admin_notice(
|
||||||
|
$messages[ $_GET['message'] ],
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'updated' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if ( isset( $_GET['error'] ) && isset( $errors[ $_GET['error'] ] ) ) {
|
||||||
|
wp_admin_notice(
|
||||||
|
$errors[ $_GET['error'] ],
|
||||||
|
array(
|
||||||
|
'id' => 'message',
|
||||||
|
'additional_classes' => array( 'error' ),
|
||||||
|
'dismissible' => true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fires before the Widgets administration page content loads.
|
* Fires before the Widgets administration page content loads.
|
||||||
*
|
*
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.4-alpha-56572';
|
$wp_version = '6.4-alpha-56573';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue