From 3a9f0316e6996d4f0bb0a72d4987ec65851a8058 Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Wed, 22 Apr 2020 12:31:30 +0200 Subject: [PATCH] =?UTF-8?q?Menus=20dans=20la=20barre=20d=E2=80=99administr?= =?UTF-8?q?ation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/functions.php b/functions.php index c317eb3..6af48ae 100644 --- a/functions.php +++ b/functions.php @@ -33,4 +33,75 @@ function theme_additional_images() { echo '
' . print_r($_wp_additional_image_sizes) . '
'; } + +// Add Toolbar Menus +function custom_toolbar() { + global $wp_admin_bar; + + $args = array( + 'id' => 'parent-menu', + 'title' => __( 'My Menu', 'yuzu-child' ), + ); + $wp_admin_bar->add_menu( $args ); + + $args = array( + 'id' => 'child1-menu', + 'parent' => 'parent-menu', + 'title' => __( 'clicclac.info', 'yuzu-child' ), + 'href' => 'https://clicclac.info', + ); + $wp_admin_bar->add_menu( $args ); + + $args = array( + 'id' => 'child2-menu', + 'parent' => 'parent-menu', + 'title' => __( 'Extensions', 'yuzu-child' ), + 'href' => 'https://silverbook.local/wordpress/wp-admin/plugins.php', + ); + $wp_admin_bar->add_menu( $args ); + + $args = array( + 'id' => 'child3-menu', + 'parent' => 'parent-menu', + 'title' => __( 'Articles', 'yuzu-child' ), + 'href' => 'Articles: https://silverbook.local/wordpress/wp-admin/edit.php', + ); + $wp_admin_bar->add_menu( $args ); + + $args = array( + 'id' => 'child4-menu', + 'parent' => 'parent-menu', + 'title' => __( 'Medias', 'yuzu-child' ), + 'href' => 'https://silverbook.local/wordpress/wp-admin/upload.php?rml_folder', + ); + $wp_admin_bar->add_menu( $args ); + + $args = array( + 'id' => 'child5-menu', + 'parent' => 'parent-menu', + 'title' => __( 'Pages', 'yuzu-child' ), + 'href' => 'https://silverbook.local/wordpress/wp-admin/edit.php?post_type=page', + ); + $wp_admin_bar->add_menu( $args ); + + $args = array( + 'id' => 'child6-menu', + 'parent' => 'parent-menu', + 'title' => __( 'Réglages', 'yuzu-child' ), + 'href' => 'https://silverbook.local/wordpress/wp-admin/options-general.php', + ); + $wp_admin_bar->add_menu( $args ); + + $args = array( + 'id' => 'child6-menu', + 'parent' => 'parent-menu', + 'title' => __( 'WP/LR Sync (Galleries)', 'yuzu-child' ), + 'href' => 'https://silverbook.local/wordpress/wp-admin/admin.php?page=wplr-collections-tags-menu', + ); + $wp_admin_bar->add_menu( $args ); + +} +if ( is_admin() ) { + add_action( 'wp_before_admin_bar_render', 'custom_toolbar', 999 ); + } ?> \ No newline at end of file