WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Xtreme One Toolbar

This plugin adds useful admin links and resources for the Xtreme One Theme Framework to the WordPress Toolbar / Admin Bar.

Does this plugin work with latest WordPress version and also older versions?

Yes, this plugin works really fine with the latest WordPress 3.6+, of course also WordPress 3.8! :-) And sorry, it DOES NOT work with older WordPress versions so please update your install if you haven't done yet :).

How are new resources being added to the admin bar?

Just drop me a note on my Twitter @deckerweb or via my contact page and I'll add the link if it is useful for admins/ webmasters and the Xtreme One community.

How could my plugin/ extension or child theme options page be added to the admin bar links?

This is possible of course and highly welcomed! Just drop me a note on my Twitter @deckerweb or via my contact page and we sort out the details! Particularly, I need the admin url for the primary options page (like so wp-admin/admin.php?page=foo) - this is relevant for both, plugins and themes. For themes then I also need the correct name defined in the stylesheet (like so Footheme) and the correct folder name (like so footheme-folder) because this would be the template name when using with child themes. (I don't own all the premium stuff myself yet so you're more than welcomed to help me out with these things. Thank you!)

Is this plugin Multisite compatible?

Yes, it is! :) Works really fine in Multisite invironment - here I just recommend to activate on a per site basis so to load things only where and when needed.

In Multisite, could I "network activate" this plugin?

Yes, you could! Of course it makes only sense if you have one or more sites running with Xtreme One in your Multisite environment. However, it's a lightweight plugin but activation on a per site basis is the recommended way from my point of view. Almost all admin links are intended for a per-site use and not for network-related stuff.

Though intended for a per site use it could make some sense in such an edge case: if all of the sites in Multisite use the Xtreme One Framework and have lots of plugins in common. This might be the case if you use Multisite for multilingual projects, especially with that awesome plugin: http://wordpress.org/plugins/multilingual-press/

Can custom menu items be hooked in via child theme or other plugins?

Yes, this is possible since version 1.1.0 of the plugin! There are two action hooks available for hooking custom menu items in -- xotb_custom_main_items for the main section and xotb_custom_group_items for the resource group section. Here's an example code:

add_action( 'xotb_custom_group_items', 'xotb_custom_additional_group_item' );
/**
 * Xtreme One Toolbar: Custom Resource Group Items
 *
 * @global mixed $wp_admin_bar
 */
function xotb_custom_additional_group_item() {

    global $wp_admin_bar;

    $wp_admin_bar->add_menu( array(
        'parent' => 'ddw-xtreme-xobar',
        'title'  => __( 'Custom Menu Item Name', 'your-textdomain' ),
        'href'   => 'http://deckerweb.de/',
        'meta'   => array( 'title' => __( 'Custom Menu Item Name Tooltip', 'your-textdomain' ) )
    ) );
}

Can certain sections be removed?

Yes, this is possible! You can remove the following sections: "Child Theme" area (all items) / "Extensions" (main item + sub items!) / "Resources link group" at the bottom (all items) / "German language stuff" (all items)

To achieve this add one, some or all of the following constants to your child theme's functions.php file:

/** Xtreme One Toolbar: Remove Theme Items */
define( 'XOTB_THEME_DISPLAY', FALSE );

/** Xtreme One Toolbar: Remove Extensions Items */
define( 'XOTB_EXTENSIONS_DISPLAY', FALSE );

/** Xtreme One Toolbar: Remove Resource Items */
define( 'XOTB_RESOURCES_DISPLAY', FALSE );

/** Xtreme One Toolbar: Remove German Language Items */
define( 'XOTB_DE_DISPLAY', FALSE );

Can the the whole toolbar entry be removed, especially for certain users?

Yes, that's also possible! This could be useful if your site has special user roles/capabilities or other settings that are beyond the default WordPress stuff etc. For example: if you want to disable the display of any "Xtreme One Toolbar" items for all user roles of "Editor" please use this code:

/** Xtreme One Toolbar: Remove all items for "Editor" user role */
if ( current_user_can( 'editor' ) ) {
    define( 'XOTB_DISPLAY', FALSE );
}

To hide only from the user with a user ID of "2":

/** Xtreme One Toolbar: Remove all items for user ID 2 */
if ( 2 == get_current_user_id() ) {
    define( 'XOTB_DISPLAY', FALSE );
}

To hide items only in frontend use this code:

/** Xtreme One Toolbar: Remove all items from frontend */
if ( ! is_admin() ) {
    define( 'XOTB_DISPLAY', FALSE );
}

In general, use this constant do hide any "Xtreme One Toolbar" items:

/** Xtreme One Toolbar: Remove all items */
define( 'XOTB_DISPLAY', FALSE );

Can I remove the original Toolbar items for WordPress SEO by Yoast?

Yes, this is also possible! Since v1.1.0 of my plugin support for Yoast's great plugin is included so if you only want his stuff to appear within "Xtreme One Toolbar" just add this constant to your active child theme's functions.php file or a functionality plugin:

/** Xtreme One Toolbar: Remove original Yoast SEO items */
define( 'XOTB_REMOVE_WPSEO_YOAST_TOOLBAR', true );

Can I remove the original Xtreme One Dashboard widget?

Yes, also possible :) - I've included a helper function for that too!

/** Xtreme One Toolbar: Remove the 'Xtreme News' Dashboard widget */
add_action( 'init', '__xotb_remove_xtreme_dashboard_widget' );

Available Filters to Customize More Stuff

All filters are listed with the filter name in bold and the below additional info, helper functions (if available) as well as usage examples.

xotb_filter_capability_all

  • Default value: edit_posts (needed for the "manage content" stuff...)
  • 5 Predefined helper functions:
    • __xotb_admin_only -- returns 'administrator' role -- usage:
add_filter( 'xotb_filter_capability_all', '__xotb_admin_only' );
  • __xotb_role_editor -- returns 'editor' role -- usage:
add_filter( 'xotb_filter_capability_all', '__xotb_role_editor' );
  • __xotb_cap_edit_theme_options -- returns 'edit_theme_options' capability -- usage:
add_filter( 'xotb_filter_capability_all', '__xotb_cap_edit_theme_options' );
  • __xotb_cap_install_plugins -- returns 'install_plugins' capability -- usage:
add_filter( 'xotb_filter_capability_all', '__xotb_cap_install_plugins' );
  • Another example:
add_filter( 'xotb_filter_capability_all', 'custom_xotb_capability_all' );
/**
 * Xtreme One Toolbar: Change Main Capability
 */
function custom_xotb_capability_all() {
    return 'switch_themes';
}

--> Changes the capability to switch_themes

xotb_filter_main_icon

  • Default value: Xtreme One "X" logo (favicon) :)
  • 10 Predefined helper functions for the 10 included colored icons, returning special colored icon values - the helper function always has this name: __xotb_colornamehere_icon() this results in the following filters ready for usage:
add_filter( 'xotb_filter_main_icon', '__xotb_blue_icon' );

add_filter( 'xotb_filter_main_icon', '__xotb_gray_icon' );

add_filter( 'xotb_filter_main_icon', '__xotb_green_icon' );

add_filter( 'xotb_filter_main_icon', '__xotb_khaki_icon' );

add_filter( 'xotb_filter_main_icon', '__xotb_orange_icon' );

add_filter( 'xotb_filter_main_icon', '__xotb_pink_icon' );

add_filter( 'xotb_filter_main_icon', '__xotb_red_icon' );

add_filter( 'xotb_filter_main_icon', '__xotb_tan_icon' );

add_filter( 'xotb_filter_main_icon', '__xotb_turquoise_icon' );

add_filter( 'xotb_filter_main_icon', '__xotb_yellow_icon' );

add_filter( 'xotb_filter_main_icon', '__xotb_child_images_icon' );

--> Where the last helper function returns the icon file (icon-xotb.png) found in your current child theme's images subfolder

  • Example for using with current child theme:
add_filter( 'xotb_filter_main_icon', 'custom_xotb_main_icon' );
/**
 * Xtreme One Toolbar: Change Main Icon
 */
function custom_xotb_main_icon() {
    return get_stylesheet_directory_uri() . '/images/custom-icon.png';
}

--> Uses a custom image from your active child theme's /images/ folder --> Recommended dimensions are 16px x 16px

xotb_filter_main_icon_display

  • Returning the CSS class for the main item icon
  • Default value: icon-xtreme (class is: .icon-xtreme)
  • 1 Predefined helper function:
    • __xotb_no_icon_display() -- usage:
add_filter( 'xotb_filter_main_icon_display', '__xotb_no_icon_display' );
  • This way you can REMOVE the icon!
    • Another example:
add_filter( 'xotb_filter_main_icon_display', 'custom_xotb_main_icon_display_class' );
/**
 * Xtreme One Toolbar: Change Main Icon CSS Class
 */
function custom_xotb_main_icon_display_class() {
    return 'your-custom-icon-class';
}

--> You then have to define CSS rules in your theme/child theme stylesheet for your own custom class .your-custom-icon-class --> Recommended dimensions are 16px x 16px

xotb_filter_main_item

  • Default value: "Xtreme One"
  • Example code for your child theme's functions.php file:
add_filter( 'xotb_filter_main_item', 'custom_xotb_main_item' );
/**
 * Xtreme One Toolbar: Change Main Item Name
 */
function custom_xotb_main_item() {
    return __( 'Your custom main item', 'your-child-theme-textdomain' );
}

xotb_filter_main_item_tooltip

  • Default value: "Xtreme One Framework"
  • Example code for your child theme's functions.php file:
add_filter( 'xotb_filter_main_item_tooltip', 'custom_xotb_main_item_tooltip' );
/**
 * Xtreme One Toolbar: Change Main Item Name's Tooltip
 */
function custom_xotb_main_item_tooltip() {
    return __( 'Your custom main item tooltip', 'your-child-theme-textdomain' );
}

xotb_filter_xtreme_name

  • Default value: "Xtreme"
  • Used for some items within toolbar links to enable proper branding
  • Change things like in the other examples/principles shown above

xotb_filter_xtreme_name_tooltip

  • Default value: "Xtreme One"
  • Used for some items within toolbar links to enable proper branding
  • Change things like in the other examples/principles shown above

Final note: If you don't like to add your customizations to your child theme's functions.php file you can also add them to a functionality plugin or an mu-plugin. This way you can also use this better for Multisite environments. In general you are then more independent from child theme changes etc.

All the custom & branding stuff code above can also be found as a Gist on Github: https://gist.github.com/2519992 (you can also add your questions/ feedback there :)

Requires: 3.6 or higher
Compatible up to: 3.8.3
Last Updated: 2014-1-22
Downloads: 1,574

Ratings

4 stars
4.6 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,2,2 100,5,5
100,5,5 100,5,5
100,1,1 100,5,5
100,5,5
100,6,6
100,4,4
100,5,5
100,1,1 100,1,1
100,1,1
100,2,2
100,2,2
100,2,2
100,2,2