
As you would assume, the Toolbar Extras plugin is “only” for selfhosted WordPress websites and blogs — this thing is also known as a “WordPress.org (selfhosted) site” — in comparison to a blog or site at the WordPress.com platform, a service by the company “Automattic”.
Normally you cannot install plugins on the platform WordPress.com. However, they introduced various plans some time ago which allow for installation of plugins. If you are on their “Business” plan then with this account type you can install plugins from the WordPress Plugin Directory.
However, since WordPress.com replaces the original WordPress Toolbar (Admin Bar), you cannot use Toolbar Extras by default. But don’t worry, you can disable the WordPress.com Toolbar (Masterbar) via a code snippet and then all falls back to the original Toolbar. Then plugins like Toolbar Extras will work like a charm. A user did verify all that already 🙂
Just follow these steps:
This code snippet goes into a core functionality plugin, or into Code Snippets.
Install and activate the Code Snippets plugin
Add this following code snippet then in that plugin:
if ( ! function_exists( 'tbex_disable_wpcomtoolbar' ) ) :
add_filter( 'jetpack_get_available_modules', 'tbex_disable_wpcomtoolbar' );
/**
* Disable the WordPress.com Toolbar
* @link https://en.forums.wordpress.com/topic/customizing-wordpress-com-toolbar-possible-for-plugin-authors-business/
*/
function tbex_disable_wpcomtoolbar( $modules ) {
if ( isset( $modules[ 'masterbar' ] ) ) {
unset( $modules[ 'masterbar' ] );
}
return $modules;
} // end function
endif;
Code language: PHP (php)
Install and activate the Toolbar Extras plugin
Ready. Let the Toolbar work for you 🙂
For reference you can see the original user support request I got for my plugin – plus, the support question I asked at WordPress.com
- Tagged Under:
- WordPress.com
- Code Snippet
- Tutorial