Make WordPress Core


Ignore:
Timestamp:
09/14/2023 12:52:45 AM (15 months ago)
Author:
joedolson
Message:

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

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

Props costdev, joedolson.
See #57791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/options-reading.php

    r55412 r56570  
    145145</label></li>
    146146</ul>
    147     <?php if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) === get_option( 'page_on_front' ) ) : ?>
    148     <div id="front-page-warning" class="notice notice-warning inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same!' ); ?></p></div>
    149     <?php endif; ?>
    150     <?php if ( get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_for_posts' ) || get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_on_front' ) ) : ?>
    151     <div id="privacy-policy-page-warning" class="notice notice-warning inline"><p><?php _e( '<strong>Warning:</strong> these pages should not be the same as your Privacy Policy page!' ); ?></p></div>
    152     <?php endif; ?>
     147    <?php
     148    if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_for_posts' ) === get_option( 'page_on_front' ) ) :
     149        wp_admin_notice(
     150            __( '<strong>Warning:</strong> these pages should not be the same!' ),
     151            array(
     152                'type'               => 'warning',
     153                'id'                 => 'front-page-warning',
     154                'additional_classes' => array( 'inline' ),
     155            )
     156        );
     157    endif;
     158    if ( get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_for_posts' ) || get_option( 'wp_page_for_privacy_policy' ) === get_option( 'page_on_front' ) ) :
     159        wp_admin_notice(
     160            __( '<strong>Warning:</strong> these pages should not be the same as your Privacy Policy page!' ),
     161            array(
     162                'type'               => 'warning',
     163                'id'                 => 'privacy-policy-page-warning',
     164                'additional_classes' => array( 'inline' ),
     165            )
     166        );
     167    endif;
     168    ?>
    153169</fieldset></td>
    154170</tr>
Note: See TracChangeset for help on using the changeset viewer.