Make WordPress Core


Ignore:
Timestamp:
09/14/2023 01:23:37 AM (3 years ago)
Author:
joedolson
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/customize/class-wp-customize-theme-control.php

    r52978 r56572  
    241241                                        </div>
    242242                                </div>
    243                                 <div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
     243                                <?php
     244                                wp_admin_notice(
     245                                        _x( 'Installed', 'theme' ),
     246                                        array(
     247                                                'type'               => 'success',
     248                                                'additional_classes' => array( 'notice-alt' ),
     249                                        )
     250                                );
     251                                ?>
    244252                        <# } else if ( 'installed' === data.theme.type ) { #>
    245253                                <# if ( data.theme.blockTheme ) { #>
     
    256264                                                </div>
    257265                                        </div>
    258                                         <div class="notice notice-error notice-alt"><p>
    259                                         <?php
    260                                                 _e( 'This theme doesn\'t support Customizer.' );
    261                                         ?>
     266                                        <?php $customizer_not_supported_message = __( 'This theme doesn\'t support Customizer.' ); ?>
    262267                                        <# if ( data.theme.actions.activate ) { #>
    263268                                                <?php
    264                                                         echo ' ';
    265                                                         printf(
     269                                                        $customizer_not_supported_message .= ' ' . sprintf(
    266270                                                                /* translators: %s: URL to the themes page (also it activates the theme). */
    267271                                                                __( 'However, you can still <a href="%s">activate this theme</a>, and use the Site Editor to customize it.' ),
     
    270274                                                ?>
    271275                                        <# } #>
    272                                         </p></div>
     276
     277                                        <?php
     278                                        wp_admin_notice(
     279                                                $customizer_not_supported_message,
     280                                                array(
     281                                                        'type'               => 'error',
     282                                                        'additional_classes' => array( 'notice-alt' ),
     283                                                )
     284                                        );
     285                                        ?>
    273286                                <# } else { #>
    274287                                        <div class="theme-id-container">
     
    282295                                                </div>
    283296                                        </div>
    284                                         <div class="notice notice-success notice-alt"><p><?php _ex( 'Installed', 'theme' ); ?></p></div>
     297                                        <?php
     298                                        wp_admin_notice(
     299                                                _x( 'Installed', 'theme' ),
     300                                                array(
     301                                                        'type'               => 'success',
     302                                                        'additional_classes' => array( 'notice-alt' ),
     303                                                )
     304                                        );
     305                                        ?>
    285306                                <# } #>
    286307                        <# } else { #>
Note: See TracChangeset for help on using the changeset viewer.