From d124de95cf787f1b8f368bc8ef626d8d0af62534 Mon Sep 17 00:00:00 2001 From: PierreLebedel Date: Mon, 4 Dec 2023 12:15:01 +0100 Subject: [PATCH 1/2] Add admin-notice new core function wp_admin_notice (fixes #67) --- patterns/admin-notices.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/patterns/admin-notices.php b/patterns/admin-notices.php index b15100d..25b4664 100644 --- a/patterns/admin-notices.php +++ b/patterns/admin-notices.php @@ -4,7 +4,7 @@ function add_settings_error(), or use class(es) on a wrapping div.', + __( 'Define type via parameter (same as CSS classes) with function add_settings_error(), or use class(es) on a wrapping div.', 'WpAdminStyle' ), 'https://developer.wordpress.org/reference/functions/add_settings_error/' ); ?> @@ -18,6 +18,16 @@ ); ?>

+

+ wp_admin_notice() to standardize admin notices. See this changeset on core.trac.wordpress.org for further details.', 'WpAdminStyle' ), + 'https://developer.wordpress.org/reference/functions/wp_admin_notice/', + 'https://core.trac.wordpress.org/changeset/56408' + ); + ?> +

inline class is only to leave the notices here. On default WordPress will hide them via javascript.', 'WpAdminStyle' ); From 2f008eea4788030944f0af0268ca71b4a4c34687 Mon Sep 17 00:00:00 2001 From: PierreLebedel Date: Mon, 4 Dec 2023 12:16:41 +0100 Subject: [PATCH 2/2] Add admin-notice .notice-alt css class examples --- patterns/admin-notices.php | 192 +++++++++++++++++++++++++------------ 1 file changed, 132 insertions(+), 60 deletions(-) diff --git a/patterns/admin-notices.php b/patterns/admin-notices.php index 25b4664..a1533a0 100644 --- a/patterns/admin-notices.php +++ b/patterns/admin-notices.php @@ -34,68 +34,140 @@ ?>

-
-

- .notice-error', - '.inline' - ); - ?> -

-
+
+
+
+ -
-

- .notice-warning', - '.inline' - ); - ?> -

-
+
+

+ .notice-error', + '.inline' + ); + ?> +

+
-
-

- .notice-success', - '.inline' - ); - ?> -

-
+
+

+ .notice-warning', + '.inline' + ); + ?> +

+
-
-

- .notice-info', - '.is-dismissible', - '.inline' - ); - ?> -

-
+
+

+ .notice-success', + '.inline' + ); + ?> +

+
+ +
+

+ .notice-info', + '.is-dismissible', + '.inline' + ); + ?> +

+
+ +
+

+ .notice-info', + '.inline' + ); + ?> +

+
+
+
+ + +
+

+ .notice-alt' + ); + ?> +

+
+ +
+

+ .notice-alt' + ); + ?> +

+
+ +
+

+ .notice-alt' + ); + ?> +

+
+ +
+

+ .notice-alt' + ); + ?> +

+
-
-

- .notice-info', - '.inline' - ); - ?> -

+
+

+ .notice-alt' + ); + ?> +

+
+
+
+