Make WordPress Core


Ignore:
Timestamp:
09/17/2023 03:21:07 PM (21 months ago)
Author:
costdev
Message:

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

Adds further usages of wp_admin_notice() in /wp-admin/includes/ on .notice-error, .notice-warning, .error, and .updated.

Ongoing task to implement new function across core.

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

Props joedolson, mukesh27, costdev.
See #57791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-privacy-policy-content.php

    r56571 r56599  
    139139        }
    140140
    141         ?>
    142         <div class="policy-text-updated notice notice-warning is-dismissible">
    143             <p>
    144             <?php
    145                 printf(
    146                     /* translators: %s: Privacy Policy Guide URL. */
    147                     __( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
    148                     esc_url( admin_url( 'privacy-policy-guide.php?tab=policyguide' ) )
    149                 );
    150             ?>
    151             </p>
    152         </div>
    153         <?php
     141        $privacy_message = sprintf(
     142            /* translators: %s: Privacy Policy Guide URL. */
     143            __( 'The suggested privacy policy text has changed. Please <a href="%s">review the guide</a> and update your privacy policy.' ),
     144            esc_url( admin_url( 'privacy-policy-guide.php?tab=policyguide' ) )
     145        );
     146
     147        wp_admin_notice(
     148            $privacy_message,
     149            array(
     150                'type'               => 'warning',
     151                'additional_classes' => array( 'policy-text-updated' ),
     152                'dismissible'        => true,
     153            )
     154        );
    154155    }
    155156
Note: See TracChangeset for help on using the changeset viewer.