Make WordPress Core


Ignore:
Timestamp:
09/14/2023 01:11:29 AM (17 months ago)
Author:
joedolson
Message:

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

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

Props costdev, joedolson.
See #57791.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r56414 r56571  
    24982498    }
    24992499
    2500     printf(
    2501         '<div class="notice notice-error"><p><strong>%s</strong><br>%s</p><p><a href="%s">%s</a></p></div>',
     2500    $message = sprintf(
     2501        '<strong>%s</strong><br>%s</p><p><a href="%s">%s</a>',
    25022502        __( 'One or more plugins failed to load properly.' ),
    25032503        __( 'You can find more details and make changes on the Plugins screen.' ),
    25042504        esc_url( admin_url( 'plugins.php?plugin_status=paused' ) ),
    25052505        __( 'Go to the Plugins screen' )
     2506    );
     2507    wp_admin_notice(
     2508        $message,
     2509        array( 'type' => 'error' )
    25062510    );
    25072511}
     
    25722576        }
    25732577
    2574         printf(
    2575             '<div class="notice notice-warning"><p><strong>%s</strong><br>%s</p><p><a href="%s">%s</a></p></div>',
     2578        $message = sprintf(
     2579            '<strong>%s</strong><br>%s</p><p><a href="%s">%s</a>',
    25762580            sprintf(
    25772581                /* translators: %s: Name of deactivated plugin. */
     
    25832587            __( 'Go to the Plugins screen' )
    25842588        );
     2589        wp_admin_notice( $message, array( 'type' => 'warning' ) );
    25852590    }
    25862591
Note: See TracChangeset for help on using the changeset viewer.