Skip to content

Instantly share code, notes, and snippets.

@deckerweb
Created March 24, 2012 11:28
Show Gist options
  • Save deckerweb/2181318 to your computer and use it in GitHub Desktop.
Save deckerweb/2181318 to your computer and use it in GitHub Desktop.
Thesis Toolbar plugin v1.1+ -- filters and constants for customizing and branding
<?php
/** Capability filters & helper functions */
add_filter( 'tstb_filter_capability_all', '__tstb_admin_only' );
add_filter( 'tstb_filter_capability_all', '__tstb_role_editor' );
add_filter( 'tstb_filter_capability_all', '__tstb_cap_switch_themes' );
add_filter( 'tstb_filter_capability_all', '__tstb_cap_manage_options' );
add_filter( 'tstb_filter_capability_all', '__tstb_cap_install_plugins' );
add_filter( 'tstb_filter_capability_all', 'custom_tstb_capability_all' );
/**
* Thesis Toolbar: Change Main Capability
*/
function custom_tstb_capability_all() {
return 'activate_plugins';
}
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';
}
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';
}
/** Icon filters & helper functions */
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' );
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';
}
/** Remove main icon completely */
add_filter( 'tstb_filter_main_icon_display', '__tstb_no_icon_display' );
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' );
}
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' );
}
/**
* Filter: tstb_filter_thesis_name
* Filter: tstb_filter_thesis_name_tooltip
* For these 2 see the last two above - same principle/scheme
*/
@deckerweb
Copy link
Author

Note: The above codes work with plugin version 1.1 or higher!

Extended explanation can be found at the plugin's page "FAQ" section at the bottom:
http://wordpress.org/extend/plugins/thesis-toolbar/faq/

Download "Thesis Toolbar" plugin at wordpress.org:
http://wordpress.org/extend/plugins/thesis-toolbar/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment