wp_admin_bar_render

Renders the admin bar to the page based on the $wp_admin_bar->menu member var.

Description

wp_admin_bar_render(); 

This is called very late on the footer actions so that it will render after anything else being added to the footer.

It includes the action which should be used to hook in and add new menus to the admin bar. That way you can be sure that you are adding at most optimal point, right before the admin bar is rendered. This also gives you access to the $post global, among others.


Usage

  1. if ( !function_exists( 'wp_admin_bar_render' ) ) { 
  2. require_once ABSPATH . WPINC . '/admin-bar.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_admin_bar_render(); 
  7.  

Defined (1)

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

/wp-includes/admin-bar.php  
  1. function wp_admin_bar_render() { 
  2. global $wp_admin_bar; 
  3.  
  4. if ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) ) 
  5. return; 
  6.  
  7. /** 
  8. * Load all necessary admin bar items. 
  9. * This is the hook used to add, remove, or manipulate admin bar items. 
  10. * @since 3.1.0 
  11. * @param WP_Admin_Bar $wp_admin_bar WP_Admin_Bar instance, passed by reference 
  12. */ 
  13. do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) ); 
  14.  
  15. /** 
  16. * Fires before the admin bar is rendered. 
  17. * @since 3.1.0 
  18. */ 
  19.  
  20. $wp_admin_bar->render(); 
  21.  
  22. /** 
  23. * Fires after the admin bar is rendered. 
  24. * @since 3.1.0 
  25. */