Make WordPress Core


Ignore:
Timestamp:
09/17/2023 03:21:07 PM (15 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/update.php

    r56571 r56599  
    343343    }
    344344
    345     echo "<div class='update-nag notice notice-warning inline'>$msg</div>";
     345    wp_admin_notice(
     346        $msg,
     347        array(
     348            'type'              => 'warning',
     349            'additonal_classes' => array( 'update-nag', 'inline' ),
     350            'paragraph_wrap'    => false,
     351        )
     352    );
    346353}
    347354
     
    885892    }
    886893
    887     echo "<div class='update-nag notice notice-warning inline'>$msg</div>";
     894    wp_admin_notice(
     895        $msg,
     896        array(
     897            'type'               => 'warning',
     898            'additional_classes' => array( 'update-nag', 'inline' ),
     899            'paragraph_wrap'     => false,
     900        )
     901    );
    888902}
    889903
Note: See TracChangeset for help on using the changeset viewer.