monsterinsights_add_action_links

Add a link to the settings page to the plugins list.

Description

(array) monsterinsights_add_action_links( (array) $links ); 

Returns (array)

$links

Parameters (1)

0. $links (array)
Array of links for the plugins, adapted when the current plugin is found.

Usage

  1. if ( !function_exists( 'monsterinsights_add_action_links' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/admin/admin.php'; 
  3.  
  4. // array of links for the plugins, adapted when the current plugin is found. 
  5. $links = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = monsterinsights_add_action_links($links); 
  9.  

Defined (1)

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

/includes/admin/admin.php  
  1. function monsterinsights_add_action_links( $links ) { 
  2. $docs = '<a title="MonsterInsights Knowledge Base" href="https://www.monsterinsights.com/docs/">' . esc_html__( 'Documentation', 'google-analytics-for-wordpress' ) . '</a>'; 
  3. array_unshift( $links, $docs ); 
  4.  
  5. // If lite, show a link where they can get pro from 
  6. $get_pro = '<a title="Get MonsterInsights Pro" href="https://www.monsterinsights.com/upgrade-to-pro/">' . esc_html__( 'Get MonsterInsights Pro', 'google-analytics-for-wordpress' ) . '</a>'; 
  7. array_unshift( $links, $get_pro ); 
  8. }  
  9.  
  10. // If Lite, support goes to forum. If pro, it goes to our website 
  11. $support = '<a title="MonsterInsights Pro Support" href="https://www.monsterinsights.com/my-account/support/">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; 
  12. array_unshift( $links, $support ); 
  13. } else { 
  14. $support = '<a title="MonsterInsights Lite Support" href="https://wordpress.org/support/plugin/google-analytics-for-wordpress">' . esc_html__( 'Support', 'google-analytics-for-wordpress' ) . '</a>'; 
  15. array_unshift( $links, $support );  
  16.  
  17. $settings_link = '<a href="' . esc_url( admin_url( 'admin.php?page=monsterinsights_settings' ) ) . '">' . esc_html__( 'Settings', 'google-analytics-for-wordpress' ) . '</a>'; 
  18. array_unshift( $links, $settings_link ); 
  19.  
  20. return $links;