Skip to content

Commit 008d73a

Browse files
Add filter for admin bar config.
1 parent 325f378 commit 008d73a

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

config/admin-bar.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@
1919
'message_background_color' => '#cb4b14',
2020
'message_hover_color' => '#1b202d',
2121
],
22+
'css_file' => _get_plugin_root_dir() . '/assets/css/admin-bar.html',
2223
];

debug-toolkit.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,15 @@ function _get_plugin_root_dir() {
5858
*/
5959
function load_admin_bar() {
6060
require_once __DIR__ . '/src/class-admin-bar.php';
61-
$config = require __DIR__ . '/config/admin-bar.php';
61+
62+
/**
63+
* Filter the admin bar configuration parameters.
64+
*
65+
* @since 1.0.0
66+
*
67+
* @param array $config Array of configuration parameters.
68+
*/
69+
$config = apply_filters( 'debug_toolkit_admin_bar_config', (array) require __DIR__ . '/config/admin-bar.php' );
6270

6371
( new Admin_Bar( $config ) )->init();
6472
}

src/class-admin-bar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public function render_admin_bar_css() {
9595

9696
ob_start();
9797

98-
include _get_plugin_root_dir() . '/assets/css/admin-bar.html';
98+
include $this->config['css_file'];
9999

100100
$css_pattern = ob_get_clean();
101101

0 commit comments

Comments
 (0)