monsterinsights_add_settings_notice

The Google Analytics for WordPress by MonsterInsights monsterinsights add settings notice function.

Description

monsterinsights_add_settings_notice( (string) $name, (string) $type = 'success', (string) $message = '' ); 

Parameters (3)

0. $name (string)
The name.
1. $type — Optional. (string) => 'success'
The type.
2. $message — Optional. (string) => ''
The message.

Usage

  1. if ( !function_exists( 'monsterinsights_add_settings_notice' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/admin/settings/settings-api.php'; 
  3.  
  4. // The name. 
  5. $name = ''; 
  6.  
  7. // The type. 
  8. $type = 'success'; 
  9.  
  10. // The message. 
  11. $message = ''; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = monsterinsights_add_settings_notice($name, $type, $message); 
  15.  

Defined (1)

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

/includes/admin/settings/settings-api.php  
  1. function monsterinsights_add_settings_notice( $name, $type = 'success', $message = '' ) { 
  2. $notices = get_transient( 'monsterinsights_settings_notices' ); 
  3. if ( empty( $notices ) ) { 
  4. $notices = array(); 
  5. $notices[ $name ] = array( "type" => $type, "message" => $message ); 
  6. } else { 
  7. $notices[ $name ] = array( "type" => $type, "message" => $message ); 
  8. set_transient( 'monsterinsights_settings_notices', $notices );