Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Display a notice that can be dismissed */
- add_action('admin_notices', 'jwl_admin_notice');
- function jwl_admin_notice() {
- global $current_user ;
- $user_id = $current_user->ID;
- /* Check that the user hasn't already clicked to ignore the message */
- if ( ! get_user_meta($user_id, 'jwl_ignore_notice') ) {
- global $pagenow;
- if ( $pagenow == 'plugins.php' ) {
- echo '<div class="updated"><p>';
- printf(__('Thank you for choosing Google Webfonts. Please visit the <a href="admin.php?page=ultimate-tinymce-google">Settings Page</a> to get started. | <a href="%1$s">Dismiss</a>'), '?jwl_nag_ignore=0');
- echo "</p></div>";
- }
- }
- }
- add_action('admin_init', 'jwl_nag_ignore');
- function jwl_nag_ignore() {
- global $current_user;
- $user_id = $current_user->ID;
- /* If user clicks to ignore the notice, add that to their user meta */
- if ( isset($_GET['jwl_nag_ignore']) && '0' == $_GET['jwl_nag_ignore'] ) {
- add_user_meta($user_id, 'jwl_ignore_notice', 'true', true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement