fbpx
How to Add a Theme Editor Shortcut to the WordPress Admin Bar

How to Add a Theme Editor Shortcut to the WordPress Admin Bar

This snippet will add a shortcut link to your WordPress theme editor.

Instructions
Add this to your functions.php file.

function admin_bar_theme_editor_option() {
	global $wp_admin_bar;
		if ( !is_super_admin() || !is_admin_bar_showing() )
		return;
		$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_theme_editor_option', 100 );

WordPress Hosting

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *