monsterinsights_settings_permissions

Permissions Tracking Settings.

Description

apply_filters( 'monsterinsights_settings_permissions', (callback) $array ); 

Parameters (1)

0. $array — Optional. (callback) => array( 'view_reports' => array( 'id' => 'view_reports', 'name' => __( 'Let these user roles see reports (and the dashboard):', 'google-analytics-for-wordpress' ), 'desc' => sprintf( esc_html( 'Users that have at least one of these roles will be able to view the reports and dashboard, along with any user with the %s capability.', 'google-analytics-for-wordpress' ), 'manage_options'), 'type' => 'select', 'options' => monsterinsights_get_roles(), 'select2' => true, 'multiple' => true, 'allowclear' => true ), 'save_settings' => array( 'id' => 'save_settings', 'name' => __( 'Let these user roles save settings:', 'google-analytics-for-wordpress' ), 'desc' => sprintf( esc_html__( 'Users that have at least one of these roles will be able to view and save the settings panel, along with any user with the %s capability.', 'google-analytics-for-wordpress'), 'manage_options' ), 'type' => 'select', 'options' => monsterinsights_get_roles(), 'select2' => true, 'multiple' => true, 'allowclear' => true ), 'anonymous_data' => array( 'id' => 'anonymous_data', 'name' => __( 'Allow Usage Tracking', 'google-analytics-for-wordpress' ), 'desc' => __( 'By allowing us to track usage data we can better help you, because we know with which WordPress configurations, themes and plugins we should test.', 'google-analytics-for-wordpress' ), 'type' => 'checkbox', ), )
The array.

Usage

To run the hook, copy the example below.
  1. $array = apply_filters( 'monsterinsights_settings_permissions', $array ); 
  2.  
  3. if ( !empty( $array ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the monsterinsights_settings_permissions callback 
  2. function filter_monsterinsights_settings_permissions( $array ) { 
  3. // make filter magic happen here... 
  4. return $array
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'monsterinsights_settings_permissions', 'filter_monsterinsights_settings_permissions', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'monsterinsights_settings_permissions', 'filter_monsterinsights_settings_permissions', 10, 1 ); 

Defined (1)

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

/includes/admin/settings/register-settings.php  
  1. 'permissions' => apply_filters('monsterinsights_settings_permissions',