aioseop_output_dismissable_notice

The All In One SEO Pack aioseop output dismissable notice function.

Description

aioseop_output_dismissable_notice( $message, (string) $id = '', (string) $class = 'updated fade' ); 

Parameters (3)

0. $message
The message.
1. $id — Optional. (string) => ''
The id.
2. $class — Optional. (string) => 'updated fade'
The class.

Usage

  1. if ( !function_exists( 'aioseop_output_dismissable_notice' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'all-in-one-seo-pack/inc/aioseop_functions.php'; 
  3.  
  4. // The message. 
  5. $message = null; 
  6.  
  7. // The id. 
  8. $id = ''; 
  9.  
  10. // The class. 
  11. $class = 'updated fade'; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = aioseop_output_dismissable_notice($message, $id, $class); 
  15.  

Defined (1)

The function is defined in the following location(s).

/inc/aioseop_functions.php  
  1. function aioseop_output_dismissable_notice( $message, $id = '', $class = 'updated fade' ) { 
  2. global $current_user; 
  3. if ( ! empty( $current_user ) ) { 
  4. $user_id = $current_user->ID; 
  5. $msgid = md5( $message ); 
  6. $ignore = get_user_meta( $user_id, 'aioseop_ignore_notice' ); 
  7. if ( ! empty( $ignore ) && in_array( $msgid, $ignore ) ) { 
  8. return false; 
  9. global $wp; 
  10. $qa = Array(); 
  11. wp_parse_str( $_SERVER['QUERY_STRING'], $qa ); 
  12. $qa['aioseop_ignore_notice'] = $msgid; 
  13. $url = '?' . build_query( $qa ); 
  14. $message = '<p class=alignleft>' . $message . '</p><p class="alignright"><a class="aioseop_dismiss_link" href="' . $url . '">Dismiss</a></p>'; 
  15.  
  16. return aioseop_output_notice( $message, $id, $class );