ddwpinfo_add_toolbar_items

Add Toolbar items.

Description

ddwpinfo_add_toolbar_items(); 

Usage

  1. if ( !function_exists( 'ddwpinfo_add_toolbar_items' ) ) { 
  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_add_toolbar_items(); 
  7.  

Defined (1)

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

/includes/ddwpinfo/ddwpinfo-functions.php  
  1. function ddwpinfo_add_toolbar_items() { 
  2.  
  3. /** Get global */ 
  4. global $wp_admin_bar; 
  5.  
  6. /** Only for logged in users with active admin bar, our items are enabled */ 
  7. if ( is_user_logged_in() 
  8. && is_admin_bar_showing() 
  9. ) { 
  10.  
  11. /** Add our Toolbar main item */ 
  12. $wp_admin_bar->add_node( array(  
  13. 'parent' => 'wp-logo-default',  
  14. 'id' => 'ddwpinfo-deckerweb-translations',  
  15. 'title' => 'ber Deutsche bersetzungen', //'Deutsche bersetzungen Info' 
  16. 'href' => admin_url( 'index.php?page=deckerweb-translations' ),  
  17. 'meta' => array( 'title' => 'Info zu: Deutsche bersetzungen von WordPress - Sprach-Plugins von DECKERWEB' ) 
  18. ) ); 
  19.  
  20. /** Array of supported plugins */ 
  21. $plugins_list = (array) ddwpinfo_supported_language_plugins(); 
  22.  
  23. /** List sub items */ 
  24. foreach ( $plugins_list as $plugin => $plugin_id ) { 
  25.  
  26. /** Only for active plugins */ 
  27. if ( defined( $plugin_id[ 'key' ] ) ) { 
  28.  
  29. /** Add Toolbar sub item(s) */ 
  30. $wp_admin_bar->add_node( array(  
  31. 'parent' => 'ddwpinfo-deckerweb-translations',  
  32. 'id' => 'ddwpinfo-' . $plugin,  
  33. 'title' => $plugin_id[ 'short' ],  
  34. 'href' => $plugin_id[ 'aurl' ],  
  35. 'meta' => array( 'title' => $plugin_id[ 'label' ] ) 
  36. ) ); 
  37.  
  38. } // end if 
  39.  
  40. } // end foreach 
  41.  
  42. } // end if 
  43.  
  44. } // end of function ddwpinfo_add_toolbar_items