public
Last active

Genesis Toolbar Extras plugin v1.0+ -- filters and constants for customizing and branding

  • Download Gist
gistfile1.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
<?php
 
// since plugin version v1.0:
 
/** Capability filters & helper functions */
add_filter( 'gtbe_filter_capability_all', '__gtbe_admin_only' );
add_filter( 'gtbe_filter_capability_all', '__gtbe_role_editor' );
add_filter( 'gtbe_filter_capability_all', '__gtbe_cap_edit_theme_options' );
add_filter( 'gtbe_filter_capability_all', '__gtbe_cap_manage_options' );
add_filter( 'gtbe_filter_capability_all', '__gtbe_cap_install_plugins' );
 
add_filter( 'gtbe_filter_capability_all', 'custom_gtbe_capability_all' );
/**
* Genesis Toolbar Extras: Change Main Capability
*/
function custom_gtbe_capability_all() {
return 'switch_themes';
}
 
/** Icon (color) filters & helper functions */
add_filter( 'gtbe_filter_main_icon', '__gtbe_brown_icon' );
add_filter( 'gtbe_filter_main_icon', '__gtbe_darkblue_icon' );
add_filter( 'gtbe_filter_main_icon', '__gtbe_green_icon' );
add_filter( 'gtbe_filter_main_icon', '__gtbe_ivory_icon' );
add_filter( 'gtbe_filter_main_icon', '__gtbe_orange_icon' );
add_filter( 'gtbe_filter_main_icon', '__gtbe_pink_icon' );
add_filter( 'gtbe_filter_main_icon', '__gtbe_red_icon' );
add_filter( 'gtbe_filter_main_icon', '__gtbe_white_icon' );
add_filter( 'gtbe_filter_main_icon', '__gtbe_yellow_icon' );
 
add_filter( 'gtbe_filter_main_icon', 'custom_gtbe_main_icon' );
/**
* Genesis Toolbar Extras: Change Main Icon
*/
function custom_gtbe_main_icon() {
return get_stylesheet_directory_uri() . '/images/custom-icon.png';
}
 
/** Remove main icon completely */
add_filter( 'gtbe_filter_main_icon_display', '__gtbe_no_icon_display' );
 
add_filter( 'gtbe_filter_main_icon_display', 'custom_gtbe_main_icon_display_class' );
/**
* Genesis Toolbar Extras: Change Main Icon CSS Class
*/
function custom_gtbe_main_icon_display_class() {
return 'your-custom-icon-class';
}
 
add_filter( 'gtbe_filter_main_item', 'custom_gtbe_main_item' );
/**
* Genesis Toolbar Extras: Change Main Item Name
*/
function custom_gtbe_main_item() {
return __( 'Your custom main item', 'your-child-theme-textdomain' );
}
 
add_filter( 'gtbe_filter_main_item_tooltip', 'custom_gtbe_main_item_tooltip' );
/**
* Genesis Toolbar Extras: Change Main Item Name's Tooltip
*/
function custom_gtbe_main_item_tooltip() {
return __( 'Your custom main item tooltip', 'your-child-theme-textdomain' );
}
 
/**
* Filter: gtbe_filter_genesis_name
* Filter: gtbe_filter_genesis_name_tooltip
* For these 2 see the last two above - same principle/scheme
*/
 
 
//
// since plugin version v1.1:
//
 
/** Genesis Toolbar Extras: Add Theme Editor support */
add_theme_support( 'gtbe-theme-editor' );
 
/** Genesis Toolbar Extras: Custom Icon from Child Theme "images" folder (icon-gtbe.png 16x16 pixel) */
add_filter( 'gtbe_filter_main_icon', '__gtbe_child_images_icon' );
 
/** Genesis Toolbar Extras: Remove original Yoast SEO items */
define( 'GTBE_REMOVE_WPSEO_YOAST_TOOLBAR', true );
 
add_action( 'gtbe_custom_group_items', 'gtbe_custom_additional_group_item' );
/**
* Genesis Toolbar Extras: Custom Resource Group Items
*
* @global mixed $wp_admin_bar
*/
function gtbe_custom_additional_group_item() {
 
global $wp_admin_bar;
 
$wp_admin_bar->add_menu( array(
'parent' => 'ddw-genesis-genesisgroup',
'id' => 'your-unique-item-id',
'title' => __( 'Custom Menu Item Name', 'your-textdomain' ),
'href' => 'http://deckerweb.de/',
'meta' => array( 'title' => __( 'Custom Menu Item Name Tooltip', 'your-textdomain' ) )
) );
}
 
/**
* The same way you can use the other hooks for adding new items:
* Main section: 'gtbe_custom_main_items'
* Child Theme section: 'gtbe_custom_theme_items'
* Extensions section: 'gtbe_custom_extend_items'
*/
 
 
//
// since plugin version 1.3:
//
 
add_filter( 'gtbe_filter_theme_support_url', 'custom_theme_support_url' );
/**
* Genesis Toolbar Extras: Custom Support URL
*/
function custom_theme_support_url() {
return 'http://genesisfinder.com/';
}
 
add_filter( 'gtbe_filter_theme_docs_url', 'custom_theme_docs_url' );
/**
* Genesis Toolbar Extras: Custom Docs URL
*/
function custom_theme_docs_url() {
return 'http://genesisfinder.com/';
}
 
add_filter( 'gtbe_filter_url_child_readme', 'custom_url_child_readme' );
/**
* Genesis Toolbar Extras: Custom README URL
*/
function custom_url_child_readme() {
return 'http://your-support-site.com/customers/readme.txt';
}
 
add_filter( 'gtbe_filter_url_child_changelog', 'custom_url_child_changelog' );
/**
* Genesis Toolbar Extras: Custom Changelog URL
*/
function custom_url_child_changelog() {
return 'http://your-theme-shop-site.com/theme-xy/changelog.txt';
}
 
 
//
// since plugin version 1.6.0:
//
 
/** Genesis Toolbar Extras: Remove My.StudioPress Items */
define( 'GTBE_MYSP_DISPLAY', FALSE );
 
/** Genesis Toolbar Extras: Remove my.StudioPress Items */
define( 'GTBE_OLDFORUMS_DISPLAY', FALSE );

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

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

Download "Genesis Toolbar Extras" plugin at wordpress.org:
http://wordpress.org/extend/plugins/genesis-toolbar-extras/

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.