Administration: Use `wp_admin_notice()` in `/wp-includes/`.

Add usages of `wp_admin_notice()` and `wp_get_admin_notice()` on `.notice-[type]` in the root level of `/wp-includes/`. Ongoing task to implement new function across core.

Props costdev, joedolson.
See #57791.
Built from https://develop.svn.wordpress.org/trunk@56572


git-svn-id: http://core.svn.wordpress.org/trunk@56084 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2023-09-14 01:25:16 +00:00
parent 008a32110f
commit d2cc86d508
3 changed files with 37 additions and 12 deletions

View File

@ -240,7 +240,15 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
<button type="button" class="button button-primary customize-theme" aria-label="<?php echo esc_attr( $customize_label ); ?>"><?php _e( 'Customize' ); ?></button> <button type="button" class="button button-primary customize-theme" aria-label="<?php echo esc_attr( $customize_label ); ?>"><?php _e( 'Customize' ); ?></button>
</div> </div>
</div> </div>
<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div> <?php
wp_admin_notice(
_x( 'Installed', 'theme' ),
array(
'type' => 'success',
'additional_classes' => array( 'notice-alt' ),
)
);
?>
<# } else if ( 'installed' === data.theme.type ) { #> <# } else if ( 'installed' === data.theme.type ) { #>
<# if ( data.theme.blockTheme ) { #> <# if ( data.theme.blockTheme ) { #>
<div class="theme-id-container"> <div class="theme-id-container">
@ -255,21 +263,26 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
<# } #> <# } #>
</div> </div>
</div> </div>
<div class="notice notice-error notice-alt"><p> <?php $customizer_not_supported_message = __( 'This theme doesn\'t support Customizer.' ); ?>
<?php
_e( 'This theme doesn\'t support Customizer.' );
?>
<# if ( data.theme.actions.activate ) { #> <# if ( data.theme.actions.activate ) { #>
<?php <?php
echo ' '; $customizer_not_supported_message .= ' ' . sprintf(
printf(
/* translators: %s: URL to the themes page (also it activates the theme). */ /* translators: %s: URL to the themes page (also it activates the theme). */
__( 'However, you can still <a href="%s">activate this theme</a>, and use the Site Editor to customize it.' ), __( 'However, you can still <a href="%s">activate this theme</a>, and use the Site Editor to customize it.' ),
'{{{ data.theme.actions.activate }}}' '{{{ data.theme.actions.activate }}}'
); );
?> ?>
<# } #> <# } #>
</p></div>
<?php
wp_admin_notice(
$customizer_not_supported_message,
array(
'type' => 'error',
'additional_classes' => array( 'notice-alt' ),
)
);
?>
<# } else { #> <# } else { #>
<div class="theme-id-container"> <div class="theme-id-container">
<h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3> <h3 class="theme-name" id="{{ data.section }}-{{ data.theme.id }}-name">{{ data.theme.name }}</h3>
@ -281,7 +294,15 @@ class WP_Customize_Theme_Control extends WP_Customize_Control {
<# } #> <# } #>
</div> </div>
</div> </div>
<div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div> <?php
wp_admin_notice(
_x( 'Installed', 'theme' ),
array(
'type' => 'success',
'additional_classes' => array( 'notice-alt' ),
)
);
?>
<# } #> <# } #>
<# } else { #> <# } else { #>
<div class="theme-id-container"> <div class="theme-id-container">

View File

@ -3761,8 +3761,12 @@ function new_user_email_admin_notice() {
if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) ) { if ( 'profile.php' === $pagenow && isset( $_GET['updated'] ) ) {
$email = get_user_meta( get_current_user_id(), '_new_email', true ); $email = get_user_meta( get_current_user_id(), '_new_email', true );
if ( $email ) { if ( $email ) {
/* translators: %s: New email address. */ $message = sprintf(
echo '<div class="notice notice-info"><p>' . sprintf( __( 'Your email address has not been updated yet. Please check your inbox at %s for a confirmation email.' ), '<code>' . esc_html( $email['newemail'] ) . '</code>' ) . '</p></div>'; /* translators: %s: New email address. */
__( 'Your email address has not been updated yet. Please check your inbox at %s for a confirmation email.' ),
'<code>' . esc_html( $email['newemail'] ) . '</code>'
);
wp_admin_notice( $message, array( 'type' => 'info' ) );
} }
} }
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.4-alpha-56571'; $wp_version = '6.4-alpha-56572';
/** /**
* 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.