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-includes/functions.php

    r56559 r56570  
    83198319 * @since 5.1.0
    83208320 * @since 5.2.0 Added the `$before` and `$after` parameters.
     8321 * @since 6.4.0 Added the `$echo` parameter.
    83218322 *
    83228323 * @param string $before Markup to output before the annotation. Default `<p class="description">`.
    83238324 * @param string $after  Markup to output after the annotation. Default `</p>`.
    8324  */
    8325 function wp_update_php_annotation( $before = '<p class="description">', $after = '</p>' ) {
     8325 * @param bool   $echo   Markup should echo if true. Default `true`.
     8326 *
     8327 * @return string|void
     8328 */
     8329function wp_update_php_annotation( $before = '<p class="description">', $after = '</p>', $echo = true ) {
    83268330    $annotation = wp_get_update_php_annotation();
    83278331
    83288332    if ( $annotation ) {
    8329         echo $before . $annotation . $after;
     8333        if ( $echo ) {
     8334            echo $before . $annotation . $after;
     8335        } else {
     8336            return $before . $annotation . $after;
     8337        }
    83308338    }
    83318339}
Note: See TracChangeset for help on using the changeset viewer.