diff --git src/wp-includes/admin-bar.php src/wp-includes/admin-bar.php
index 70c2a67..e9bae37 100644
|
|
function _wp_admin_bar_init() { |
25 | 25 | require( ABSPATH . WPINC . '/class-wp-admin-bar.php' ); |
26 | 26 | |
27 | 27 | /* Instantiate the admin bar */ |
| 28 | |
| 29 | /** |
| 30 | * Filter the name of the admin bar class to instantiate. |
| 31 | * |
| 32 | * @since 3.1.0 |
| 33 | * |
| 34 | * @param string The admin bar class. Default 'WP_Admin_Bar'. |
| 35 | */ |
28 | 36 | $admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' ); |
29 | 37 | if ( class_exists( $admin_bar_class ) ) |
30 | 38 | $wp_admin_bar = new $admin_bar_class; |
… |
… |
function wp_admin_bar_render() { |
57 | 65 | if ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) ) |
58 | 66 | return false; |
59 | 67 | |
| 68 | /** |
| 69 | * Fires before the admin bar is rendered. |
| 70 | * |
| 71 | * @since 3.1.0 |
| 72 | * |
| 73 | * @param array An array containing the referenced admin bar object. |
| 74 | */ |
60 | 75 | do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) ); |
61 | 76 | |
| 77 | /** |
| 78 | * Fires before the admin bar is rendered. |
| 79 | * |
| 80 | * @since 3.1.0 |
| 81 | */ |
62 | 82 | do_action( 'wp_before_admin_bar_render' ); |
63 | 83 | |
64 | 84 | $wp_admin_bar->render(); |
65 | 85 | |
| 86 | /** |
| 87 | * Fires after the admin bar is rendered. |
| 88 | * |
| 89 | * @since 3.1.0 |
| 90 | */ |
66 | 91 | do_action( 'wp_after_admin_bar_render' ); |
67 | 92 | } |
68 | 93 | add_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); |
… |
… |
function wp_admin_bar_appearance_menu( $wp_admin_bar ) { |
621 | 646 | if ( current_theme_supports( 'widgets' ) ) |
622 | 647 | $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __('Widgets'), 'href' => admin_url('widgets.php') ) ); |
623 | 648 | |
624 | | if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) |
| 649 | if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) |
625 | 650 | $wp_admin_bar->add_menu( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __('Menus'), 'href' => admin_url('nav-menus.php') ) ); |
626 | 651 | |
627 | 652 | if ( current_theme_supports( 'custom-background' ) ) |
… |
… |
function is_admin_bar_showing() { |
773 | 798 | } |
774 | 799 | } |
775 | 800 | |
| 801 | /** |
| 802 | * Filter whether the admin bar should be shown. |
| 803 | * |
| 804 | * This is the recommended way to hide the toolbar. |
| 805 | * |
| 806 | * @since 3.1.0 |
| 807 | * |
| 808 | * @param bool $show_admin_bar Whether the admin bar should be shown. Default 'false'. |
| 809 | * The user's display preference is used for logged in users. |
| 810 | */ |
776 | 811 | $show_admin_bar = apply_filters( 'show_admin_bar', $show_admin_bar ); |
777 | 812 | |
778 | 813 | return $show_admin_bar; |