WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

Thesis Toolbar

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

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

Yes, this plugin works really fine with the latest WordPress 3.3+ including latest 3.4-alpha! 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 toolbar/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 Thesis #thesiswp community.

How could my plugin/extension or child theme/skin options page be added to the toolbar/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 child themes. For child 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. For skins I need a certain skin-only function name or class name. (Note: 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 enable" this plugin?

Yes, you could. -- However, it doesn't make much sense. The plugin is intented for a per site use as the admin links refer to the special settings, plugin-support and child theme/skin support for that certain site/blog. So if you have a Multisite install with 5 sites but only 3 would run on "Thesis" then the other 2 sites will only see support links in the Toolbar / Admin Bar... I guess, you got it? :)

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 Thesis Theme and have lots of Thesis-specific plugins. This might be the case if you use Multisite for multilingual projects, especially with that awesome plugin: http://wordpress.org/extend/plugins/multilingual-press/

Can certain sections be removed?

Yes, this is possible! You can remove the following sections: "Child Theme/Skin" 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 custom_functions.php file or child theme's or skin's functions.php or similar file:

/** Thesis Toolbar: Remove Child Theme/Skin Items */
define( 'TSTB_CHILD_SKIN_DISPLAY', FALSE );

/** Thesis Toolbar: Remove Extensions Items */
define( 'TSTB_EXTENSIONS_DISPLAY', FALSE );

/** Thesis Toolbar: Remove Resource Items */
define( 'TSTB_RESOURCES_DISPLAY', FALSE );

/** Thesis Toolbar: Remove German Language Items */
define( 'TSTB_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 "Thesis Toolbar" items for all user roles of "Editor" please use this code:

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

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

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

To hide items only in frontend use this code:

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

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

/** Thesis Toolbar: Remove all items */
define( 'TSTB_DISPLAY', FALSE );

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.

tstb_filter_capability_all

  • Default value: edit_theme_options
  • 4 Predefined helper functions:
    • __tstb_admin_only -- returns 'administrator' role -- usage:
add_filter( 'tstb_filter_capability_all', '__tstb_admin_only' );
  • __tstb_role_editor -- returns 'editor' role -- usage:
add_filter( 'tstb_filter_capability_all', '__tstb_role_editor' );
  • __tstb_cap_switch_themes -- returns 'edit_switch_themes' capability -- usage:
add_filter( 'tstb_filter_capability_all', '__tstb_cap_switch_themes' );
  • __tstb_cap_manage_options -- returns 'manage_options' capability -- usage:
add_filter( 'tstb_filter_capability_all', '__tstb_cap_manage_options' );
  • __tstb_cap_install_plugins -- returns 'install_plugins' capability -- usage:
add_filter( 'tstb_filter_capability_all', '__tstb_cap_install_plugins' );
  • Another example:
add_filter( 'tstb_filter_capability_all', 'custom_tstb_capability_all' );
/**
 * Thesis Toolbar: Change Main Capability
 */
function custom_tstb_capability_all() {
    return 'activate_plugins';
}

--> Changes the capability to activate_plugins

tstb_filter_main_icon

  • Default value: Thesis default graphic like in the admin menu
  • 11 Predefined helper functions for the 11 included colored icons, returning special colored icon values - the helper function always has this name: __tstb_colornamehere_icon() this results in the following filters ready for usage:
add_filter( 'tstb_filter_main_icon', '__tstb_blue_icon' );

add_filter( 'tstb_filter_main_icon', '__tstb_brown_icon' );

add_filter( 'tstb_filter_main_icon', '__tstb_green_icon' );

add_filter( 'tstb_filter_main_icon', '__tstb_green2_icon' );

add_filter( 'tstb_filter_main_icon', '__tstb_grey_icon' );

add_filter( 'tstb_filter_main_icon', '__tstb_khaki_icon' );

add_filter( 'tstb_filter_main_icon', '__tstb_orange_icon' );

add_filter( 'tstb_filter_main_icon', '__tstb_pink_icon' );

add_filter( 'tstb_filter_main_icon', '__tstb_red_icon' );

add_filter( 'tstb_filter_main_icon', '__tstb_turquoise_icon' );

add_filter( 'tstb_filter_main_icon', '__tstb_yellow_icon' );
  • Example for using the "custom" folder in your Thesis install:
add_filter( 'tstb_filter_main_icon', 'custom_folder_tstb_main_icon' );
/**
 * Thesis Toolbar: Change Main Icon ("custom" Folder)
 */
function custom_folder_tstb_main_icon() {
    return THESIS_CUSTOM_FOLDER . '/images/custom-icon.png';
}
  • Another example for using with child themes and Thesis:
add_filter( 'tstb_filter_main_icon', 'custom_child_tstb_main_icon' );
/**
 * Thesis Toolbar: Change Main Icon (Child Theme)
 */
function custom_child_tstb_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

tstb_filter_main_icon_display

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

--> You then have to define CSS rules in your custom.css file or your child theme/skin stylesheet for your own custom class .your-custom-icon-class

tstb_filter_main_item

  • Default value: "Thesis"
  • Example code for your custom_functions.php file or similar file from child theme/skin:
add_filter( 'tstb_filter_main_item', 'custom_tstb_main_item' );
/**
 * Thesis Toolbar: Change Main Item Name
 */
function custom_tstb_main_item() {
    return __( 'Your custom main item', 'your-child-theme-textdomain' );
}

tstb_filter_main_item_tooltip

  • Default value: "Thesis Theme"
  • Example code for your custom_functions.php file or similar file from child theme/skin:
add_filter( 'tstb_filter_main_item_tooltip', 'custom_tstb_main_item_tooltip' );
/**
 * Thesis Toolbar: Change Main Item Name's Tooltip
 */
function custom_tstb_main_item_tooltip() {
    return __( 'Your custom main item tooltip', 'your-child-theme-textdomain' );
}

tstb_filter_thesis_name and tstb_filter_thesis_name_tooltip

  • Default value for both: "Thesis"
  • 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 custom_functions.php file or similar file of child theme/skin 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/2181318

Requires: 3.3 or higher
Compatible up to: 3.4-alpha
Last Updated: 2012-3-25
Downloads: 7,333

Ratings

5 stars
5 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,2,2 100,5,5
100,3,3
100,4,4
100,4,4
100,4,4
100,1,1