ddw_gftb_plugin_links

Add various support links to plugin page.

Description

(strings) ddw_gftb_plugin_links( $gftb_links, $gftb_file ); 

Returns (strings)

plugin links

Parameters (2)

0. $gftb_links
The gftb links.
1. $gftb_file
The gftb file.

Usage

  1. if ( !function_exists( 'ddw_gftb_plugin_links' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-forms-toolbar/lib/gftb-admin.php'; 
  3.  
  4. // The gftb links. 
  5. $gftb_links = null; 
  6.  
  7. // The gftb file. 
  8. $gftb_file = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = ddw_gftb_plugin_links($gftb_links, $gftb_file); 
  12.  

Defined (1)

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

/lib/gftb-admin.php  
  1. function ddw_gftb_plugin_links( $gftb_links, $gftb_file ) { 
  2.  
  3. /** Capability check */ 
  4. if ( ! current_user_can( 'install_plugins' ) ) { 
  5.  
  6. return $gftb_links; 
  7.  
  8. } // end-if cap check 
  9.  
  10. /** List additional links only for this plugin */ 
  11. if ( $gftb_file == GFTB_PLUGIN_BASEDIR . '/gravity-forms-toolbar.php' ) { 
  12.  
  13. $gftb_links[] = '<a href="' . esc_url_raw( GFTB_URL_WPORG_FAQ ) . '" target="_new" title="' . __( 'FAQ', 'gravity-forms-toolbar' ) . '">' . __( 'FAQ', 'gravity-forms-toolbar' ) . '</a>'; 
  14. $gftb_links[] = '<a href="' . esc_url_raw( GFTB_URL_WPORG_FORUM ) . '" target="_new" title="' . __( 'Support', 'gravity-forms-toolbar' ) . '">' . __( 'Support', 'gravity-forms-toolbar' ) . '</a>'; 
  15. $gftb_links[] = '<a href="' . esc_url_raw( GFTB_URL_TRANSLATE ) . '" target="_new" title="' . __( 'Translations', 'gravity-forms-toolbar' ) . '">' . __( 'Translations', 'gravity-forms-toolbar' ) . '</a>'; 
  16. $gftb_links[] = '<a href="' . esc_url_raw( GFTB_URL_DONATE ) . '" target="_new" title="' . __( 'Donate', 'gravity-forms-toolbar' ) . '"><strong>' . __( 'Donate', 'gravity-forms-toolbar' ) . '</strong></a>'; 
  17.  
  18. } // end-if plugin links 
  19.  
  20. /** Output the links */ 
  21. return $gftb_links; 
  22.  
  23. } // end of function ddw_gftb_plugin_links