Plugin / Gravity Forms Toolbar

David Decker - DECKERWEB / Milan Petrovic - Dev4Press

Frequently Asked Questions (FAQ)

Yes, this plugin works really fine with WordPress 3.3 and 3.3.1! It also works great with WP 3.2 – and also should with WP 3.1 – but we only tested extensively with WP 3.3+ this time. So you always should run the latest WordPress version for a lot of reasons.
Just drop me a note on my Twitter @deckerweb or via my contact page and I’ll add the link(s) if it is useful for admins/ webmasters and the Gravity Forms 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). I also need the correct name of the main PHP class or function (to check if the plugin extension exists or not). (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!)
Simple answer: Linking/ adding is only possible where a plugin has its own admin pages and these are properly accessable.
Yes, this is possible since version 1.5 of the plugin! There are 3 action hooks available for hooking custom menu items in — gftb_custom_main_items for the main section, gftb_custom_extension_items for the exentensions section plus gftb_custom_group_items for the resource group section. Here’s an example code: add_action( 'gftb_custom_group_items', 'gftb_custom_additional_group_item' ); /** * Gravity Forms Toolbar: Custom Resource Group Items * * @global mixed $wp_admin_bar */ function gftb_custom_additional_group_item() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( 'parent' => 'ddw-gravityforms-gfgroup', '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' ) ) ) ); }
Of course, just via plugin options! — Additionally, you can use some constants – which can come in handy for customizing stuff for clients etc. You can remove the following sections: Official “Add-Ons” (all items) / “Extensions” area (all items) / “Resources link group” at the bottom (all items) / “German language stuff” (all items) / “Dutch language stuff” (all items) To achieve this add one, some or all of the following constants to your theme’s/child theme’s functions.php file: /** Gravity Forms Toolbar: Remove Add-On Items */ define( 'GFTB_ADDONS_DISPLAY', FALSE ); /** Gravity Forms Toolbar: Remove Extensions Items */ define( 'GFTB_EXTENSIONS_DISPLAY', FALSE ); /** Gravity Forms Toolbar: Remove Resource Items */ define( 'GFTB_RESOURCES_DISPLAY', FALSE ); /** Gravity Forms Toolbar: Remove German Language Items */ define( 'GFTB_DE_DISPLAY', FALSE ); /** Gravity Forms Toolbar: Remove Dutch Language Items */ define( 'GFTB_NL_DISPLAY', FALSE ); /** Gravity Forms Toolbar: Remove Spanish Language Items */ define( 'GFTB_ES_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 “Gravity Forms Toolbar” items for all user roles of “Editor” please use this code: /** Gravity Forms Toolbar: Remove all items for "Editor" user role */ if ( current_user_can( 'editor' ) ) { define( 'GFTB_DISPLAY', FALSE ); } To hide only from the user with a user ID of “2”: /** Gravity Forms Toolbar: Remove all items for user ID 2 */ if ( 2 == get_current_user_id() ) { define( 'GFTB_DISPLAY', FALSE ); } To hide items only in frontend use this code: /** Gravity Forms Toolbar: Remove all items from frontend */ if ( ! is_admin() ) { define( 'GFTB_DISPLAY', FALSE ); } In general, use this constant do hide any “Gravity Forms Toolbar” items: /** Gravity Forms Toolbar: Remove all items */ define( 'GFTB_DISPLAY', FALSE );
All filters are listed with the filter name in bold and the below additional info, helper functions (if available) as well as usage examples. gftb_filter_capability_all Default value: gravityforms_edit_forms (set by Gravity Forms plugin itself!) 6 Predefined helper functions: __gftb_admin_only — returns 'administrator' role — usage: add_filter( ‘gftb_filter_capability_all’, ‘__gftb_admin_only’ ); __gftb_role_editor — returns 'editor' role — usage: add_filter( ‘gftb_filter_capability_all’, ‘__gftb_role_editor’ ); __gftb_cap_manage_options — returns 'manage_options' capability — usage: add_filter( ‘gftb_filter_capability_all’, ‘__gftb_cap_manage_options’ ); __gftb_cap_install_plugins — returns 'install_plugins' capability — usage: add_filter( ‘gftb_filter_capability_all’, ‘__gftb_cap_install_plugins’ ); __gftb_cap_activate_plugins — returns 'activate_plugins' capability — usage: add_filter( ‘gftb_filter_capability_all’, ‘__gftb_cap_activate_plugins’ ); __gftb_cap_edit_theme_options — returns 'edit_theme_options' capability — usage: add_filter( ‘gftb_filter_capability_all’, ‘__gftb_cap_edit_theme_options’ ); Another example: add_filter( ‘gftb_filter_capability_all’, ‘custom_gftb_capability_all’ ); /** Gravity Forms Toolbar: Change Main Capability */ function custom_gftb_capability_all() { return ‘switch_themes’; } –> Changes the capability to switch_themes gftb_filter_main_icon Default value: Gravity Forms logo (favicon) 🙂 10 Predefined helper functions for the 11 included colored icons, returning special colored icon values – the helper function always has this name: __gftb_colornamehere_icon() this results in the following filters ready for usage: add_filter( ‘gftb_filter_main_icon’, ‘__gftb_blue_icon’ ); add_filter( ‘gftb_filter_main_icon’, ‘__gftb_lightgreen_icon’ ); add_filter( ‘gftb_filter_main_icon’, ‘__gftb_lightgrey_icon’ ); add_filter( ‘gftb_filter_main_icon’, ‘__gftb_orange_icon’ ); add_filter( ‘gftb_filter_main_icon’, ‘__gftb_pink_icon’ ); add_filter( ‘gftb_filter_main_icon’, ‘__gftb_red_icon’ ); add_filter( ‘gftb_filter_main_icon’, ‘__gftb_turquoise_icon’ ); add_filter( ‘gftb_filter_main_icon’, ‘__gftb_yellow_icon’ ); add_filter( ‘gftb_filter_main_icon’, ‘__gftb_theme_images_icon’ ); –> Where the last helper function returns the icon file (icon-gftb.png) found in your current theme’s/child theme’s /images/ subfolder Example for using with current child theme: add_filter( ‘gftb_filter_main_icon’, ‘custom_gftb_main_icon’ ); /** Gravity Forms Toolbar: Change Main Icon */ function custom_gftb_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 gftb_filter_main_icon_display Returning the CSS class for the main item icon Default value: icon-gravityforms (class is: .icon-gravityforms) 1 Predefined helper function: __gftb_no_icon_display() — usage: add_filter( ‘gftb_filter_main_icon_display’, ‘__gftb_no_icon_display’ ); –> This way you can REMOVE the icon! Another example: add_filter( ‘gftb_filter_main_icon_display’, ‘custom_gftb_main_icon_display_class’ ); /** Gravity Forms Toolbar: Change Main Icon CSS Class */ function custom_gftb_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 gftb_filter_main_item Default value: “Gravity Forms” Example code for your theme’s/child theme’s functions.php file: add_filter( ‘gftb_filter_main_item’, ‘custom_gftb_main_item’ ); /** Gravity Forms Toolbar: Change Main Item Name */ function custom_gftb_main_item() { return __( ‘Your custom main item title’, ‘your-textdomain’ ); } gftb_filter_main_item_tooltip Default value: “Gravity Forms” Example code for your theme’s/child theme’s functions.php file: add_filter( ‘gftb_filter_main_item_tooltip’, ‘custom_gftb_main_item_tooltip’ ); /** Gravity Forms Toolbar: Change Main Item Name’s Tooltip */ function custom_gftb_main_item_tooltip() { return __( ‘Your custom main item title tooltip’, ‘your-textdomain’ ); } Final note: I DON’T recommend to add customization code snippets to your main theme’s/child theme’s functions.php file! Please use a functionality plugin or an MU-plugin instead! This way you can also use this better for Multisite environments. In general you are then more independent from theme/child theme changes etc. If you don’t know how to create such a plugin yourself just use one of my recommended ‘Code Snippets’ plugins. Read & bookmark these Sites: “What is a functionality plugin and how to create one?” – blog post by WPCandy “Creating a custom functions plugin for end users” – blog post by Justin Tadlock DON’T hack your functions.php file: Resource One – Resource Two (both by Thomas Griffin Media) “Code Snippets” plugin by Shea Bunge – also network wide! “Code With WP Code Snippets” plugin by Thomas Griffin – Note: Plugin currently in development at GitHub. “Toolbox Modules” plugin by Sergej Müller – see also his plugin instructions. All the custom & branding stuff code above can also be found as a Gist on Github: https://gist.github.com/2732242 (you can also add your questions/ feedback there 🙂

Ratings

5
3 reviews

Rating breakdown

Details Information

Version

1.7.0

First Released

16 Jan, 2012

Total Downloads

55,859

Wordpress Version

3.6 or higher

Tested up to:

5.1.3

Require PHP Version:

-

Tags

Contributors

Languages

DIRECTORY DISCLAIMER

The information provided in this THEME/PLUGIN DIRECTORY is made available for information purposes only, and intended to serve as a resource to enable visitors to select a relevant theme or plugin. wpSocket gives no warranty of any kind, express or implied with regard to the information, including without limitation any warranty that the particular theme or plugin that you select is qualified on your situation.

The information in the individual theme or plugin displayed in the Directory is provided by the owners and contributors themselves. wpSocket gives no warranty as to the accuracy of the information and will not be liable to you for any loss or damage suffered by you as a consequence of your reliance on the information.

Links to respective sites are offered to assist in accessing additional information. The links may be outdated or broken. Connect to outside sites at your own risk. The Theme/Plugin Directory does not endorse the content or accuracy of any listing or external website.

While information is made available, no guarantee is given that the details provided are correct, complete or up-to-date.

wpSocket is not related to the theme or plugin, and also not responsible and expressly disclaims all liability for, damages of any kind, arising out of the use, reference to, or reliance on, any information or business listed throughout our site.

Keep Leading Your Followers!
Share it for them.