This plugin adds useful admin links and resources for the Xtreme One Theme Framework to the WordPress Toolbar / Admin Bar.
Yes, this plugin works really fine with the latest WordPress 3.3+, of course also WordPress 3.4! :-) And sorry, it DOES NOT work with older WordPress versions so please update your install if you haven't done yet :).
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.
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!)
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.
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/extend/plugins/multilingual-press/
Yes, this is possible since version 1.1 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' ) )
) );
}
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 );
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 );
Yes, this is also possible! Since v1.1 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 );
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' );
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
edit_posts (needed for the "manage content" stuff...)__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' );
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
__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
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
icon-xtreme (class is: .icon-xtreme)__xotb_no_icon_display() -- usage:add_filter( 'xotb_filter_main_icon_display', '__xotb_no_icon_display' );
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
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
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
xotb_filter_xtreme_name_tooltip
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.3 or higher
Compatible up to: 3.4-beta3
Last Updated: 2012-4-29
Downloads: 1,028
Got something to say? Need help?