From 9c45c2bf1856b21acea72f0753d284de7286754a Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Thu, 23 Apr 2020 10:46:14 +0200 Subject: [PATCH] =?UTF-8?q?Menu=20dans=20la=20barre=20d=E2=80=99admin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bugfix: - is_admin() ne marche que dans back-end - current_user_can(‘administrator’) marche partout --- functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 64ab8c6..f64fc6d 100644 --- a/functions.php +++ b/functions.php @@ -101,7 +101,7 @@ function custom_toolbar() { $wp_admin_bar->add_menu( $args ); } -if ( is_admin() ) { +if ( current_user_can( 'administrator' ) ) { add_action( 'wp_before_admin_bar_render', 'custom_toolbar', 999 ); } ?> \ No newline at end of file