pmpro_add_action_links

Function to add links to the plugin action links.

Description

pmpro_add_action_links( $links ); 

Parameters (1)

0. $links
The links.

Usage

  1. if ( !function_exists( 'pmpro_add_action_links' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/adminpages.php'; 
  3.  
  4. // The links. 
  5. $links = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pmpro_add_action_links($links); 
  9.  

Defined (1)

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

/includes/adminpages.php  
  1. function pmpro_add_action_links($links) { 
  2.  
  3. //array of all caps in the menu 
  4. $pmpro_caps = pmpro_getPMProCaps(); 
  5.  
  6. //the top level menu links to the first page they have access to 
  7. foreach($pmpro_caps as $cap) 
  8. if(current_user_can($cap)) 
  9. $top_menu_page = str_replace("_", "-", $cap); 
  10. break; 
  11.  
  12. $new_links = array( 
  13. '<a href="' . get_admin_url(NULL, 'admin.php?page=' . $top_menu_page) . '">Settings</a>',  
  14. ); 
  15. return array_merge($new_links, $links);