Make WordPress Core


Ignore:
Timestamp:
09/16/2023 09:47:22 PM (3 years ago)
Author:
costdev
Message:

Administration: Increase wp_admin_notice() usage in /wp-includes/.

Adds further usages of wp_admin_notice() in the root level of /wp-includes/ on .error and .notice-info.

Ongoing task to implement new function across core.

Follow-up to [56408], [56409], [56410], [56518], [56570], [56571], [56572], [56573], [56576], [56589], [56590].

Props joedolson, costdev.
See #57791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-widget-media-audio.php

    r53136 r56597  
    190190                <script type="text/html" id="tmpl-wp-media-widget-audio-preview">
    191191                        <# if ( data.error && 'missing_attachment' === data.error ) { #>
    192                                 <div class="notice notice-error notice-alt notice-missing-attachment">
    193                                         <p><?php echo $this->l10n['missing_attachment']; ?></p>
    194                                 </div>
     192                                <?php
     193                                wp_admin_notice(
     194                                        $this->l10n['missing_attachment'],
     195                                        array(
     196                                                'type'               => 'error',
     197                                                'additional_classes' => array( 'notice-alt', 'notice-missing-attachment' ),
     198                                        )
     199                                );
     200                                ?>
    195201                        <# } else if ( data.error ) { #>
    196                                 <div class="notice notice-error notice-alt">
    197                                         <p><?php _e( 'Unable to preview media due to an unknown error.' ); ?></p>
    198                                 </div>
     202                                <?php
     203                                wp_admin_notice(
     204                                        __( 'Unable to preview media due to an unknown error.' ),
     205                                        array(
     206                                                'type'               => 'error',
     207                                                'additional_classes' => array( 'notice-alt' ),
     208                                        )
     209                                );
     210                                ?>
    199211                        <# } else if ( data.model && data.model.src ) { #>
    200212                                <?php wp_underscore_audio_template(); ?>
Note: See TracChangeset for help on using the changeset viewer.