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-extras.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-extras.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_info = (array) ddw_gftb_info_values(); 
  14.  
  15. $gftb_links[] = '<a href="' . esc_url( $gftb_info[ 'url_wporg_faq' ] ) . '" target="_new" title="' . __( 'FAQ', 'gravity-forms-toolbar' ) . '">' . __( 'FAQ', 'gravity-forms-toolbar' ) . '</a>'; 
  16.  
  17. $gftb_links[] = '<a href="' . esc_url( $gftb_info[ 'url_wporg_forum' ] ) . '" target="_new" title="' . __( 'Support', 'gravity-forms-toolbar' ) . '">' . __( 'Support', 'gravity-forms-toolbar' ) . '</a>'; 
  18.  
  19. $gftb_links[] = '<a href="' . esc_url( $gftb_info[ 'url_snippets' ] ) . '" target="_new" title="' . __( 'Code Snippets for Customization', 'gravity-forms-toolbar' ) . '">' . __( 'Code Snippets', 'gravity-forms-toolbar' ) . '</a>'; 
  20.  
  21. $gftb_links[] = '<a href="' . esc_url( $gftb_info[ 'url_translate' ] ) . '" target="_new" title="' . __( 'Translations', 'gravity-forms-toolbar' ) . '">' . __( 'Translations', 'gravity-forms-toolbar' ) . '</a>'; 
  22.  
  23. $gftb_links[] = '<a href="' . esc_url( $gftb_info[ 'url_donate' ] ) . '" target="_new" title="' . __( 'Donate', 'gravity-forms-toolbar' ) . '"><strong>' . __( 'Donate', 'gravity-forms-toolbar' ) . '</strong></a>'; 
  24.  
  25. } // end if plugin links 
  26.  
  27. /** Output the links */ 
  28. return apply_filters( 'gftb_filter_plugin_links', $gftb_links ); 
  29.  
  30. } // end of function ddw_gftb_plugin_links