开发者 |
daveshine
deckerweb GDragoN |
---|---|
更新时间 | 2019年2月22日 06:25 |
捐献地址: | 去捐款 |
PHP版本: | 3.6 及以上 |
WordPress版本: | 5.1 |
版权: | GPL-2.0+ |
版权网址: | 版权信息 |
Quick Access to Gravity Forms Resources - Time Saver & Helper Tool! This small and lightweight plugin just adds a lot Gravity Forms related resources to your toolbar / admin bar. Also links to all admin settings pages pages of the plugin are included, making the life of form administrators/ developers a lot easier. So you might just switch from the fontend of your site to read current 'Entries' or just 'Add a new Form' etc. How cool is that? :) Also, support for all official and lots of third-party add-ons is included!Please note: The plugin requires the Gravity Forms base plugin, a paid premium product released by Rocketgenius Inc. (via gravityforms.com). General Features
gravity-forms-toolbar.pot
) for translators is also always included :)gravity-forms-toolbar
folder to the /wp-content/plugins/
directory/wp-content/languages/gravity-forms-toolbar/
(just create this folder) - This enables you to use fully custom translations that won't be overridden on plugin updates. Also, complete custom English wording is possible with that as well, just use a language file like gravity-forms-toolbar-en_US.mo/.po
to achieve that.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' );
/**
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
gravityforms_edit_forms
(set by Gravity Forms plugin itself!)__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' );
--> Changes the capability to
switch_themes`__gftb_colornamehere_icon()
this results in the following filters ready for usage:
`
add_filter( 'gftb_filter_main_icon', '__gftb_blue_icon' );--> Where the last helper function returns the icon file (
icon-gftb.png) found in your current theme's/child theme's
/images/` subfolder
--> Uses a custom image from your active child theme's
/images/` foldericon-gravityforms
(class is: .icon-gravityforms
)__gftb_no_icon_display()
-- usage:
add_filter( 'gftb_filter_main_icon_display', '__gftb_no_icon_display' );
--> This way you can REMOVE the icon!--> You then have to define CSS rules in your theme/child theme stylesheet for your own custom class
.your-custom-icon-class`functions.php
file:
`
add_filter( 'gftb_filter_main_item', 'custom_gftb_main_item' );
/**functions.php
file:
`
add_filter( 'gftb_filter_main_item_tooltip', 'custom_gftb_main_item_tooltip' );
/**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:
functions.php
file: Resource One - Resource Two (both by Thomas Griffin Media)constants
in your active theme/child theme -- this way you can customize for your staff members or clients if you need some more users with extended or restricted admin bar/toolbar access (See "FAQ" section here) -- this is additional to the existing settings via plugin's options page!/wp-content/languages/gravity-forms-toolbar/
(just create this folder) - this enables you to use complete custom wording or translations.