Family Encyclopedia >> Electronics

How to add theme editor to WordPress admin bar

In the past, we've shown you how to add the shortlinks menu, draft posts, and other stuff to the WordPress admin bar. In this article, we will show you how to add the Theme Editor to the WordPress admin bar.

All you need to do is open your site-specific plugin or your theme's functions.php file and paste the following code:

// Agregar el Editor de temas a la barra de administración (¡para ahorrar tiempo!) Función admin_bar_theme_editor_option () global $ wp_admin_bar; if (! is_super_admin () ||! is_admin_bar_showing ()) devuelve; $ wp_admin_bar-> add_menu (array ('id' => 'edit-theme', 'title' => __ ('Edit Theme'), 'href' => admin_url ('theme-editor.php'))); add_action ('admin_bar_menu', 'admin_bar_bar_tema_editor_opción', 100);

That's it. We found this code floating around in WordCamp's Nashville hashtag. We tested it on WordPress 3.3.2 and it works. The code should work for other versions as well.