wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.
_wp_admin_bar_init is private and should not be used in themes or plugins directly.
_wp_admin_bar_init › WordPress Function
Od3.1.0
Przestarzałyn/a
› _wp_admin_bar_init ( Brak parametrów )
| Dostęp: |
|
| Powrót: |
|
| Zdefiniowane na: |
|
| Codex: |
Instantiates the admin bar object and set it up as a global for access elsewhere.
UNHOOKING THIS FUNCTION WILL NOT PROPERLY REMOVE THE ADMIN BAR. For that, use show_admin_bar(false) or the {@see 'show_admin_bar'} filter.Powiązane Funkcje: _wp_admin_bar_icon, wp_admin_bar_render, wp_admin_bar_edit_menu, wp_admin_bar_site_menu, wp_admin_bar_wp_menu
Źródło
function _wp_admin_bar_init() {
global $wp_admin_bar;
if ( ! is_admin_bar_showing() ) {
return false;
}
/* Load the admin bar class code ready for instantiation */
require_once ABSPATH . WPINC . '/class-wp-admin-bar.php';
/* Instantiate the admin bar */
/**
* Filters the admin bar class to instantiate.
*
* @since 3.1.0
*
* @param string $wp_admin_bar_class Admin bar class to use. Default 'WP_Admin_Bar'.
*/
$admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );
if ( class_exists( $admin_bar_class ) ) {
$wp_admin_bar = new $admin_bar_class();
} else {
return false;
}
$wp_admin_bar->initialize();
$wp_admin_bar->add_menus();
return true;
}