From 1141b9fee228332aa6d7cf414dd238034fe5fc41 Mon Sep 17 00:00:00 2001 From: joedolson Date: Tue, 5 Sep 2023 20:50:24 +0000 Subject: [PATCH] Administration: Use admin notice functions in nav menu admin. Use `wp_get_admin_notice` and `wp_admin_notice` to handle settings notices on the nav menu admin screens. Props joedolson. See #57791. Built from https://develop.svn.wordpress.org/trunk@56518 git-svn-id: http://core.svn.wordpress.org/trunk@56030 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/nav-menu.php | 33 +++++++++++++++++++++------------ wp-includes/version.php | 2 +- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/wp-admin/includes/nav-menu.php b/wp-admin/includes/nav-menu.php index 1ace5cdd43..b68f6906a2 100644 --- a/wp-admin/includes/nav-menu.php +++ b/wp-admin/includes/nav-menu.php @@ -1291,15 +1291,21 @@ function wp_get_nav_menu_to_edit( $menu_id = 0 ) { } if ( $some_pending_menu_items ) { - $result .= '

' - . __( 'Click Save Menu to make pending menu items public.' ) - . '

'; + $message = __( 'Click Save Menu to make pending menu items public.' ); + $notice_args = array( + 'type' => 'info', + 'additional_classes' => array( 'notice-alt', 'inline' ), + ); + $result .= wp_get_admin_notice( $message, $notice_args ); } if ( $some_invalid_menu_items ) { - $result .= '

' - . __( 'There are some invalid menu items. Please check or delete them.' ) - . '

'; + $message = __( 'There are some invalid menu items. Please check or delete them.' ); + $notice_args = array( + 'type' => 'error', + 'additional_classes' => array( 'notice-alt', 'inline' ), + ); + $result .= wp_get_admin_notice( $message, $notice_args ); } $result .= '