Title: wp_admin_bar_class
Published: April 25, 2014
Last modified: April 28, 2025

---

# apply_filters( ‘wp_admin_bar_class’, string $wp_admin_bar_class )

## In this article

 * [Parameters](https://developer.wordpress.org/reference/hooks/wp_admin_bar_class/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/wp_admin_bar_class/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/wp_admin_bar_class/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/wp_admin_bar_class/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/wp_admin_bar_class/?output_format=md#wp--skip-link--target)

Filters the admin bar class to instantiate.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/wp_admin_bar_class/?output_format=md#parameters)󠁿

 `$wp_admin_bar_class`string

Admin bar class to use. Default ‘[WP_Admin_Bar](https://developer.wordpress.org/reference/classes/wp_admin_bar/)‘.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/wp_admin_bar_class/?output_format=md#source)󠁿

    ```php
    $admin_bar_class = apply_filters( 'wp_admin_bar_class', 'WP_Admin_Bar' );
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/admin-bar.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/admin-bar.php#L42)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/admin-bar.php#L42-L42)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/wp_admin_bar_class/?output_format=md#related)󠁿

| Used by | Description | 
| [_wp_admin_bar_init()](https://developer.wordpress.org/reference/functions/_wp_admin_bar_init/)`wp-includes/admin-bar.php` |

Instantiates the admin bar object and set it up as a global for access elsewhere.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/wp_admin_bar_class/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fwp_admin_bar_class%2F)
before being able to contribute a note or feedback.