ddw_wcde_plugin_links

Add various support links to plugin page.

Description

(strings) ddw_wcde_plugin_links( (string) $wcde_links, (string) $wcde_file ); 

Returns (strings)

Plugin links.

Parameters (2)

0. $wcde_links (string)
HTML link strings/ URLs.
1. $wcde_file (string)
Plugin file path.

Usage

  1. if ( !function_exists( 'ddw_wcde_plugin_links' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-german-de_de/includes/wcde-admin-extras.php'; 
  3.  
  4. // HTML link strings/ URLs. 
  5. $wcde_links = ''; 
  6.  
  7. // Plugin file path. 
  8. $wcde_file = ''; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = ddw_wcde_plugin_links($wcde_links, $wcde_file); 
  12.  

Defined (1)

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

/includes/wcde-admin-extras.php  
  1. function ddw_wcde_plugin_links( $wcde_links, $wcde_file ) { 
  2.  
  3. /** Capability check */ 
  4. if ( ! current_user_can( 'install_plugins' ) ) { 
  5.  
  6. return $wcde_links; 
  7.  
  8. } // end if cap check 
  9.  
  10. /** List additional links only for this plugin */ 
  11. if ( $wcde_file == WCDE_PLUGIN_BASEDIR . 'woocommerce-de.php' ) { 
  12.  
  13. $wcde_info = (array) ddw_wcde_info_values(); 
  14.  
  15. $wcde_links[] = '<a href="' . esc_url( $wcde_info[ 'url_wporg_faq' ] ) . '" target="_new" title="' . __( 'FAQ', 'woocommerce-german' ) . '">' . __( 'FAQ', 'woocommerce-german' ) . '</a>'; 
  16.  
  17. $wcde_links[] = '<a href="' . esc_url( $wcde_info[ 'url_wporg_forum' ] ) . '" target="_new" title="' . __( 'Support', 'woocommerce-german' ) . '">' . __( 'Support', 'woocommerce-german' ) . '</a>'; 
  18.  
  19. $wcde_links[] = '<a href="' . esc_url( $wcde_info[ 'url_snippets' ] ) . '" target="_new" title="' . __( 'Code Snippets for Customization', 'woocommerce-german' ) . '">' . __( 'Code Snippets', 'woocommerce-german' ) . '</a>'; 
  20.  
  21. $wcde_links[] = '<a href="' . esc_url( $wcde_info[ 'url_translate' ] ) . '" target="_new" title="' . __( 'Translations', 'woocommerce-german' ) . '">' . __( 'Translations', 'woocommerce-german' ) . '</a>'; 
  22.  
  23. $wcde_links[] = '<a class="button button-secondary" href="' . esc_url( $wcde_info[ 'url_donate' ] ) . '" target="_new" title="' . _x( 'Donate for Translations', 'Translators: for title attribute', 'woocommerce-german' ) . '"><strong>→ ' . __( 'Donate for Translations', 'woocommerce-german' ) . '</strong></a>'; 
  24.  
  25. } // end if plugin check 
  26.  
  27. /** Output the links */ 
  28. return apply_filters( 'wcde_filter_plugin_links', $wcde_links ); 
  29.  
  30. } // end of function ddw_wcde_plugin_links