-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the admin notice examples to leave them on the UI.
- Loading branch information
Showing
2 changed files
with
89 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,89 @@ | ||
<h2><?php esc_attr_e( 'Admin Notices', 'WpAdminStyle' ); ?></h2> | ||
<p><mark><?php printf( __( '<strong>Note:</strong> Admin Notices get moved to the <a %1$s>top</a> (via <a href="%2$s" target="_blank">wp-admin/js/common.js</a>) and appear below the first <code>h1</code> or <code>h2</code> (whichever comes first) inside <code>.wrap</code> by default (since WordPress version 4.3). Add the `.inline` css class if you do not wish to move the notice to the top. Example notices appear at the top of this page.', | ||
'WpAdminStyle' ), 'href="javascript:void(0);" onclick="window.scrollTo(0,0);"', esc_url( admin_url( '/js/common.js' ) ) ); ?></mark></p> | ||
<p><?php printf( __( 'Define type via parameter (same as CSS classes) with <a href="%s" target="_blank">function add_settings_error()</a>, or use class(es) on a wrapping <code>div</code>.', | ||
'WpAdminStyle' ), 'https://developer.wordpress.org/reference/functions/add_settings_error/' ); ?></p> | ||
<p><?php printf( __( 'Since WordPress version 4.2 there are more classes and paths available. See <a href="%s" target="_blank">this post on make.w.org</a> for further details.', | ||
'WpAdminStyle' ), 'https://make.wordpress.org/core/2015/04/23/spinners-and-dismissible-admin-notices-in-4-2/' ); ?></p> | ||
|
||
<div class="notice notice-error"><p><?php printf( esc_attr__( 'class %s with paragraph', 'WpAdminStyle' ), '<code>.notice-error</code>' ); ?></p></div> | ||
<div class="notice notice-warning"><p><?php printf( esc_attr__( 'class %s with paragraph', 'WpAdminStyle' ), '<code>.notice-warning</code>' ); ?></p></div> | ||
<div class="notice notice-success"><p><?php printf( esc_attr__( 'class %s with paragraph', 'WpAdminStyle' ), '<code>.notice-success</code>' ); ?></p></div> | ||
<div class="notice notice-info is-dismissible"><p><?php printf( esc_attr__( 'class %s with paragraph include %s class', | ||
'WpAdminStyle' ), '<code>.notice-info</code>', '<code>.is-dismissible</code>' ); ?></p></div> | ||
<div class="notice notice-info inline"><p><?php printf( esc_attr__( 'class %s with paragraph and %s class', | ||
'WpAdminStyle' ), '<code>.notice-info</code>', '<code>.inline</code>' ); ?></p></div> | ||
<p> | ||
<?php | ||
printf( | ||
// translators: Leave always a hint for translators to understand the placeholders. | ||
__( 'Define type via parameter (same as CSS classes) with <a href="%s" target="_blank">function add_settings_error()</a>, or use class(es) on a wrapping <code>div</code>.', | ||
'WpAdminStyle' ), 'https://developer.wordpress.org/reference/functions/add_settings_error/' | ||
); | ||
?> | ||
</p> | ||
<p> | ||
<?php | ||
printf( | ||
// translators: Leave always a hint for translators to understand the placeholders. | ||
__( 'Since WordPress version 4.2 there are more classes and paths available. See <a href="%s" target="_blank">this post on make.w.org</a> for further details.', 'WpAdminStyle' ), | ||
'https://make.wordpress.org/core/2015/04/23/spinners-and-dismissible-admin-notices-in-4-2/' | ||
); | ||
?> | ||
</p> | ||
<p> | ||
<?php | ||
_e( 'Note: The <code>inline</code> class is only to leave the notices here. On default WordPress will hide them via javascript.', 'WpAdminStyle' ); | ||
?> | ||
</p> | ||
|
||
<!-- Deprecated | ||
<div class="updated"><p><?php esc_attr_e( 'class .updated with paragraph, deprecated', 'WpAdminStyle' ); ?></p></div> | ||
<div class="error"><?php esc_attr_e( 'class .error WITHOUT paragraph, deprecated', 'WpAdminStyle' ); ?></div> | ||
<div class="settings-error"><?php esc_attr_e( 'class .settings-error WITHOUT paragraph, deprecated', 'WpAdminStyle' ); ?></div> | ||
<div class="error form-invalid"><?php esc_attr_e( 'class .error and .form-invalid WITHOUT paragraph, deprecated', | ||
'WpAdminStyle' ); ?></div> | ||
<div class="notice"><p><?php esc_attr_e( 'class .notice only with paragraph, deprecated', 'WpAdminStyle' ); ?></p></div> | ||
--> | ||
<div class="notice notice-error inline"> | ||
<p> | ||
<?php | ||
printf( | ||
// translators: Leave always a hint for translators to understand the placeholders. | ||
esc_attr__( 'class %s with paragraph and %2$s class', 'WpAdminStyle' ), | ||
'<code>.notice-error</code>', | ||
'<code>.inline</code>' | ||
); | ||
?> | ||
</p> | ||
</div> | ||
|
||
<div class="notice notice-warning inline"> | ||
<p> | ||
<?php | ||
printf( | ||
// translators: Leave always a hint for translators to understand the placeholders. | ||
esc_html__( 'class %1$s with paragraph and %2$s class', 'WpAdminStyle' ), | ||
'<code>.notice-warning</code>', | ||
'<code>.inline</code>' | ||
); | ||
?> | ||
</p> | ||
</div> | ||
|
||
<div class="notice notice-success inline"> | ||
<p> | ||
<?php printf( | ||
// translators: Leave always a hint for translators to understand the placeholders. | ||
esc_html__( 'class %1$s with paragraph and %2$s class', 'WpAdminStyle' ), | ||
'<code>.notice-success</code>', | ||
'<code>.inline</code>' | ||
); | ||
?> | ||
</p> | ||
</div> | ||
|
||
<div class="notice notice-info is-dismissible inline"> | ||
<p> | ||
<?php printf( | ||
// translators: Leave always a hint for translators to understand the placeholders. | ||
esc_attr__( 'class %1$s with paragraph include %2$s and %3$s class','WpAdminStyle' ), | ||
'<code>.notice-info</code>', | ||
'<code>.is-dismissible</code>', | ||
'<code>.inline</code>' | ||
); | ||
?> | ||
</p> | ||
</div> | ||
|
||
<div class="notice notice-info inline"> | ||
<p> | ||
<?php | ||
printf( | ||
// translators: %1$s is a code fragment for the notice information and %2$s is the inline class code. | ||
esc_attr__( 'class %1$s with paragraph and %2$s class', 'WpAdminStyle' ), | ||
'<code>.notice-info</code>', | ||
'<code>.inline</code>' | ||
); | ||
?> | ||
</p> | ||
</div> |