ddwpinfo_detect_inactive_plugins

Helper function to check for all supported plugins, that are currently inactive, and putting out a list of them.

Description

ddwpinfo_detect_inactive_plugins(); 

Usage

  1. if ( !function_exists( 'ddwpinfo_detect_inactive_plugins' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-german-de_de/includes/ddwpinfo/ddwpinfo-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ddwpinfo_detect_inactive_plugins(); 
  7.  

Defined (1)

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

/includes/ddwpinfo/ddwpinfo-functions.php  
  1. function ddwpinfo_detect_inactive_plugins() { 
  2.  
  3. /** Array of supported plugins */ 
  4. $plugins_list = (array) ddwpinfo_supported_language_plugins(); 
  5.  
  6. /** Start display of list */ 
  7. echo '<ul class="ddwpinfo-inactive-plugins">'; 
  8.  
  9. /** List items */ 
  10. foreach ( $plugins_list as $plugin => $plugin_id ) { 
  11.  
  12. /** Only for inactive plugins */ 
  13. if ( ! defined( $plugin_id[ 'key' ] ) ) { 
  14.  
  15. if ( isset( $plugin_id[ 'slug' ] ) ) { 
  16.  
  17. $install_link = ddwpinfo_plugin_install_link( $plugin_id[ 'slug' ], $plugin_id[ 'label' ] ); 
  18.  
  19. } elseif ( isset( $plugin_id[ 'repo' ] ) && current_user_can( 'install_plugins' ) ) { 
  20.  
  21. $install_link = sprintf( 
  22. '<a class="add-new-h2 download" href="%s" target="_new" title="%s herunterladen zum Installieren"><small>herunterladen</small></a>',  
  23. $plugin_id[ 'repo' ],  
  24. $plugin_id[ 'label' ] 
  25. ); 
  26.  
  27. } else { 
  28.  
  29. $install_link = ''; 
  30.  
  31. } // end if 
  32.  
  33. $output = '<li><a href="' . esc_url( $plugin_id[ 'repo' ] ) . '" target="_new" title="' . esc_html__( $plugin_id[ 'label' ] ) . '">' . $plugin_id[ 'label' ] . '</a> ' . $install_link . '<br /><small>' . $plugin_id[ 'desc' ] . '</small></li>'; 
  34.  
  35. echo $output; 
  36.  
  37. } else { 
  38.  
  39. $output = FALSE; 
  40.  
  41. } // end if 
  42.  
  43. } // end foreach 
  44.  
  45. /** 
  46. if ( ! $output ) { 
  47.  
  48. echo 'Glckwunsch, Sie haben alle verfgbaren Sprach-Plugins bereits im Einsatz! ;-)'; 
  49.  
  50. } // end if 
  51. */ 
  52.  
  53. /** End display of list */ 
  54. echo '</ul>'; 
  55.  
  56. } // end of function ddwpinfo_detect_inactive_plugins