GFAddOn
Class GFAddOn
Handles all tasks mostly common to any Gravity Forms Add-On, including third party ones.
Source: includes/addon/class-gf-addon.php:24
Details
- Kind:
class - Namespace:
(global)
Properties
| Property | Type | Description |
|---|---|---|
$_version | string | Version number of the Add-On |
$_min_gravityforms_version | string | Gravity Forms minimum version requirement |
$_min_compatible_gravityforms_version | string | Gravity Forms minimum version for supporting all features. |
$_slug | string | URL-friendly identifier used for form settings, add-on settings, text domain localization... |
$_path | string | Relative path to the plugin from the plugins folder. Example "gravityforms/gravityforms.php" |
$_full_path | string | Full path to the plugin. Example: FILE |
$_url | string | URL to the Gravity Forms website. Example: 'http://www.gravityforms.com' OR affiliate link. |
$_title | string | Title of the plugin to be used on the settings page, form settings and plugins page. Example: 'Gravity Forms Mailchimp Add-On' |
$_short_title | string | Short version of the plugin title to be used on menus and other places where a less verbose string is useful. Example: 'Mailchimp' |
$_capabilities | array | Members plugin integration. List of capabilities to add to roles. |
$app_hook_suffix | string | The hook suffix for the app menu |
$_asset_min | string | The '.min' suffix to append to asset files in production mode. |
$_capabilities_settings_page | string | array | A string or an array of capabilities or roles that have access to the settings page |
$_capabilities_form_settings | string | array | A string or an array of capabilities or roles that have access to the form settings |
$_capabilities_plugin_page | string | array | A string or an array of capabilities or roles that have access to the plugin page |
$_capabilities_app_menu | string | array | A string or an array of capabilities or roles that have access to the app menu |
$_capabilities_app_settings | string | array | A string or an array of capabilities or roles that have access to the app settings page |
$_capabilities_uninstall | string | array | A string or an array of capabilities or roles that can uninstall the plugin |
$_enable_rg_autoupgrade | bool | Used by Rocketgenius plugins to activate auto-upgrade. |
Methods
| Method | Description |
|---|---|
__construct() | Class constructor which hooks the instance into the WordPress init action |
bootstrap() | Attaches any filters or actions needed to bootstrap the addon. |
init_theme_layer() | Initializes the theme layer process for the add-on. |
get_theme_layer_styles() | Helper method that returns the theme styles that should be enqueued for the add-on. Returns an array in the format accepted by the Gravity Forms theme layer set_styles() method |
get_themes_to_enqueue() | Helper method that returns the themes that should be enqueued for the add-on. Returns an array of theme slugs. |
register() | Registers an addon so that it gets initialized appropriately |
get_registered_addons() | Gets all active, registered Add-Ons. |
get_addon_by_slug() | Finds a registered add-on by its slug and return its instance. |
init_addons() | Initializes all addons. |
pre_init() | Gets executed before all init functions. Override this function to perform initialization tasks that must be done prior to init |
init() | Plugin starting point. Handles hooks and loading of language files. |
init_admin() | Override this function to add initialization code (i.e. hooks) for the admin site (WP dashboard) |
get_results_addon() | Returns instances of the add-ons that implement the results/sales pages. |
get_registered_scripts() | Returns a list of the registered scripts that will be enqueued. |
get_registered_styles() | Returns a list of the registered styles. |
init_frontend() | Override this function to add initialization code (i.e. hooks) for the public (customer facing) site |
init_ajax() | Override this function to add AJAX hooks or to add initialization code when an AJAX request is being performed |
minimum_requirements() | Override this function to provide a list of requirements needed to use Add-On. |
meets_minimum_requirements() | Performs a check to see if WordPress environment meets minimum requirements need to use Add-On. |
failed_requirements_init() | Register failed requirements page under Gravity Forms settings. |
setup() | Performs upgrade tasks when the version of the Add-On changes. To add additional upgrade tasks, override the upgrade() function, which will only get executed when the plugin version has changed. |
upgrade() | Override this function to add to add database update scripts or any other code to be executed when the Add-On version changes |
post_gravityforms_upgrade() | Gets called when Gravity Forms upgrade process is completed. This function is intended to be used internally, override the upgrade() function to execute database update scripts. |
styles() | Override this function to provide a list of styles to be enqueued. |
scripts() | Override this function to provide a list of scripts to be enqueued. |
enqueue_scripts() | Target of admin_enqueue_scripts and gform_enqueue_scripts hooks. |
enqueue_preview_styles() | Target of gform_preview_styles. Enqueue styles to the preview page. |
enqueue_print_styles() | Target of gform_print_styles. Enqueue styles to the print entry page. |
theme_layer_title() | The title to display for this theme layer - defaults to the addon short title. |
theme_layer_slug() | The slug to display for this theme layer - defaults to the addon slug. |
theme_layer_icon() | The icon to use for displaying on settings pages, etc. Defaults to user icon. |
theme_layer_priority() | Provides the priority for this theme layer. |
theme_layer_settings_fields() | Defines the various setting fields to display on the Form Settings screen for this theme layer. |
theme_layer_overridden_fields() | The fields/views to override for this theme layer. |
theme_layer_form_css_properties() | The form CSS properties to output based on settings, block settings, or arbitrary conditions. |
theme_layer_styles() | An array of styles to enqueue. |
theme_layer_scripts() | An array of scripts to enqueue. |
theme_layer_third_party_styles() | Provides third party styles to apply for this theme layer. |
output_third_party_styles() | Outputs third-party styles to pass to JS-powered widgets like payment modals, etc. |
register_noconflict_scripts() | Target for the gform_noconflict_scripts filter. Adds scripts to the list of white-listed no conflict scripts. |
register_noconflict_styles() | Target for the gform_noconflict_styles filter. Adds styles to the list of white-listed no conflict scripts. |
get_entry_meta() | Override this method to activate and configure entry meta. |
get_results_page_config() | Returns the configuration for the results page. By default this is not activated. |
results_page_init() | Initializes the result page functionality. To activate result page functionality, override the get_results_page_config() function. |
has_members_plugin() | Checks whether the Members plugin is installed and activated. |
members_register_cap_group() | Register the Gravity Forms Add-Ons capabilities group with the Members plugin. |
members_register_caps() | Register the Add-On capabilities and their human readable labels with the Members plugin. |
get_members_caps() | Get Add-On capabilities and their human readable labels. |
filter_ure_capabilities_groups_tree() | Register Gravity Forms Add-Ons capabilities group with User Role Editor plugin. |
filter_ure_custom_capability_groups() | Register Gravity Forms capabilities with Gravity Forms group in User Role Editor plugin. |
current_user_can_any() | Checks whether the current user is assigned to a capability or role. |
get_settings_renderer() | Gets the current instance of Settings handling settings rendering. |
set_settings_renderer() | Sets the current instance of Settings handling settings rendering. |
prepare_settings_sections() | Prepare legacy settings sections for Settings renderer. |
prepare_settings_fields() | Prepare legacy settings fields for Settings renderer. |
single_setting_label() | Displays the label for a field, including the tooltip and requirement indicator. |
set_encryptor() | Sets the current instance of object that handles settings encryption. |
get_encryptor() | Returns the current instance of the settings encryptor. |
checkbox_item() | Returns the markup for an individual checkbox item give the parameters |
checkbox_input() | Returns the markup for an individual checkbox input and its associated label |
choices_have_icon() | Determines if any of the available settings choices have an icon. |
settings_select_custom() | Renders and initializes a drop down field with a input field for custom input based on the $field array. |
get_select_options() | Prepares an HTML string of options for a drop down field. |
get_select_option() | Prepares an HTML string for a single drop down field option. |
settings_generic_map() | Renders and initializes a generic map field based on the $field array whose choices are populated by the fields to be mapped. |
settings_field_map() | Renders and initializes a field map field based on the $field array whose choices are populated by the fields to be mapped. |
settings_dynamic_field_map() | Renders and initializes a dynamic field map field based on the $field array whose choices are populated by the fields to be mapped. |
settings_field_map_select() | Renders a field select field for field maps. |
get_mapping_field() | Prepares the markup for mapping field key and value fields. |
field_map_table_header() | Heading row for field map table. |
field_map_title() | Heading for field map field column. |
get_field_map_choices() | Get field map choices for specific form. |
get_mapped_field_name() | Get input name for field map field. |
get_field_map_fields() | Get mapped key/value pairs for standard field map. |
get_dynamic_field_map_fields() | Get mapped key/value pairs for dynamic field map. |
get_generic_map_fields() | Get mapped key/value pairs for generic map. |
settings_field_select() | Renders and initializes a drop down field based on the $field array whose choices are populated by the form's fields. |
get_default_field_select_field() | Returns the field to be selected by default for field select fields based on matching labels. |
get_form_fields_as_choices() | Retrieve an array of form fields formatted for select, radio and checkbox settings fields. |
settings_checkbox_and_select() | Renders and initializes a checkbox field that displays a select field when checked based on the $field array. |
get_field_attributes() | Parses the properties of the $field meta array and returns a set of HTML attributes to be added to the HTML element. |
get_choice_attributes() | Parses the properties of the $choice meta array and returns a set of HTML attributes to be added to the HTML element. |
validate_settings() | Validates settings fields. |
validate_text_settings() | |
validate_textarea_settings() | |
validate_radio_settings() | |
validate_select_settings() | |
validate_checkbox_settings() | |
validate_select_custom_settings() | |
validate_field_select_settings() | |
validate_field_map_settings() | |
validate_checkbox_and_select_settings() | |
is_choice_valid() | Helper to determine if the current choice is a match for the submitted field value. |
set_field_error() | Sets the validation error message |
get_field_errors() | Gets the validation errors for a field. |
get_error_icon() | Gets the invalid field icon |
maybe_get_tooltip() | Returns the tooltip markup if a tooltip is configured for the supplied item (field/child field/choice). |
get_required_indicator() | Gets the required indicator |
field_failed_validation() | Checks if the specified field failed validation |
filter_settings() | Filter settings fields. |
add_field() | Add a field to existing defined fields. |
remove_field() | Remove a field from existing defined fields. |
replace_field() | Replace a field in existing defined fields. |
get_field() | Get a specific settings field. |
simple_condition() | Helper to create a simple conditional logic set of fields. It creates one row of conditional logic with Field/Operator/Value inputs. |
get_conditional_logic_fields() | Override this to define the array of choices which should be used to populate the Simple Condition fields drop down. |
is_simple_condition_met() | Evaluate the rules defined for the Simple Condition field. |
get_form_settings_capabilities() | Get the capabilities required to access the form settings page. |
form_settings_init() | Initializes form settings page |
plugin_page_init() | Initializes plugin settings page |
create_plugin_page_menu() | Creates plugin page menu item |
form_settings_page() | Renders the form settings page. |
form_settings() | Custom form settings page |
form_settings_page_title() | Custom form settings title |
form_settings_icon() | Override this function to customize the form settings icon |
plugin_page() | Override this function to create a custom plugin page |
plugin_page_icon() | Override this function to customize the plugin page icon |
plugin_page_title() | Override this function to customize the plugin page title |
plugin_page_container() | Plugin page container |
has_app_menu() | Checks whether the current Add-On has a top level app menu. |
create_app_menu() | Creates a top level app menu. Adds the app settings page automatically if it's configured. |
get_app_menu_items() | Override this function to create a top level app menu. |
get_app_menu_icon() | Override this function to specify a custom icon for the top level app menu. |
load_screen_options() | Override this function to load custom screen options. |
app_tab_page() | Handles the rendering of app menu items that implement the tabs UI. |
get_form_settings() | Returns the form settings for the Add-On |
add_form_settings_menu() | Add the form settings tab. |
form_settings_fields() | Override this function to specify the settings fields to be rendered on the form settings page |
plugin_settings_init() | Initialize Plugin Settings page. |
plugin_settings_link() | Add link to Plugin Settings page on Plugins page. |
plugin_settings_page() | Plugin Settings page. |
plugin_settings_title() | Returns title for Plugin Settings page header. |
plugin_settings_icon() | Returns icon for Plugin Settings page header. |
plugin_settings() | Override this function to add a custom settings page. |
has_plugin_settings_page() | Checks whether the current Add-On has a settings page. |
get_plugin_settings() | Returns the currently saved plugin settings |
get_plugin_setting() | Get plugin setting. |
update_plugin_settings() | Updates plugin settings with the provided settings |
maybe_save_plugin_settings() | Saves the plugin settings if the submit button was pressed |
plugin_settings_fields() | Override this function to specify the settings fields to be rendered on the plugin settings page. |
get_app_settings_tabs() | Returns the tabs for the settings app menu item |
app_settings_uninstall_tab() | Renders the app settings uninstall tab. |
app_tab_page_header() | Renders the header for the tabs UI. |
app_tab_page_footer() | Renders the footer for the tabs UI. |
app_settings_title() | Override this function to specific a custom app settings title |
app_settings_icon() | Override this function to specific a custom app settings icon |
has_app_settings() | Checks whether the current Add-On has a settings page. |
app_settings() | Override this function to add a custom app settings page. |
get_app_settings() | Returns the currently saved plugin settings |
get_app_setting() | Get app setting |
update_app_settings() | Updates app settings with the provided settings |
maybe_save_app_settings() | Saves the plugin settings if the submit button was pressed |
app_settings_fields() | Override this function to specify the settings fields to be rendered on the plugin settings page |
settings_fields_only() | Returns an flattened array of field settings for the specified settings type ignoring sections. |
uninstall_message() | Override this function to customize the uninstall message displayed on the uninstall page. |
render_uninstall() | Override this function to customize the markup for the uninstall section on the plugin settings page. |
render_settings_button() | Render a settings button for addons that have overridden the render_uninstall field. Not intended to be called directly or overridden by addons. |
maybe_uninstall() | Not intended to be overridden or called directly by Add-Ons. |
uninstall_addon() | Removes all settings and deactivates the Add-On. |
uninstall() | Called when the user chooses to uninstall the Add-On - after permissions have been checked and before removing |
plugin_row() | Target for the after_plugin_row action hook. Checks whether the current version of Gravity Forms |
plugin_message() | Returns the message that will be displayed if the current version of Gravity Forms is not supported. |
compatibility_message() | Returns the message that will be displayed if the current version of Gravity Forms is not compatible with the add-on. |
display_plugin_message() | Formats and outs a custom message for the plugin row. |
log_error() | Writes an error message to the Gravity Forms log. Requires the Gravity Forms logging Add-On. |
log_debug() | Writes an error message to the Gravity Forms log. Requires the Gravity Forms logging Add-On. |
get_locking_config() | Returns the configuration for locking |
is_locking_edit_page() | Returns TRUE if the current page is the edit page. Otherwise, returns FALSE |
is_locking_list_page() | Returns TRUE if the current page is the list page. Otherwise, returns FALSE |
is_locking_view_page() | Returns TRUE if the current page is the view page. Otherwise, returns FALSE |
get_locking_object_id() | Returns the ID of the object to be locked. E.g. Form ID |
lock_info() | Outputs information about the user currently editing the specified object |
list_row_class() | Outputs class for the row for the specified Object ID on the list page. |
is_object_locked() | Checked whether an object is locked |
get_mapped_field_value() | Returns the value of the mapped field. |
get_field_value() | Returns the value of the selected field. |
maybe_override_field_value() | Enables use of the gform_SLUG_field_value filter to override the field value. Override this function to prevent the filter being used or to implement a custom filter. |
get_full_address() | Returns the combined value of the specified Address field. |
get_full_name() | Returns the combined value of the specified Name field. |
get_list_field_value() | Returns the value of the specified List field. |
get_first_field_by_type() | Returns the field ID of the first field of the desired type. |
note_avatar() | Override this function to specify a custom avatar (i.e. the payment gateway logo) for entry notes created by the Add-On |
add_note() | Adds a note to an entry. |
get_base_url() | Returns the url of the root folder of the current Add-On. |
get_gfaddon_base_url() | Returns the url of the Add-On Framework root folder. |
get_gfaddon_base_path() | Returns the physical path of the Add-On Framework root folder. |
get_base_path() | Returns the physical path of the plugins root folder. |
is_gravityforms_installed() | Checks whether the Gravity Forms is installed. |
is_gravityforms_supported() | Checks whether the current version of Gravity Forms is supported |
is_gravityforms_compatible() | Checks whether the current version of Gravity Forms is compatible with all features of an add-on. |
maybe_display_upgrade_notice() | Display an upgrade notice if the current version of Gravity Forms is not fully supported. |
get_short_title() | Returns this plugin's short title. Used to display the plugin title in small areas such as tabs |
get_menu_icon() | Return the plugin's icon for the plugin/form settings menu. |
get_icon_namespace() | Return the plugin's icon namespace. |
get_version() | Return this plugin's version. |
get_plugin_settings_url() | Returns the unescaped URL for the plugin settings tab associated with this plugin |
get_current_form() | Returns the current form object based on the id query var. Otherwise returns false |
is_postback() | Returns TRUE if the current request is a postback, otherwise returns FALSE |
is_save_postback() | Returns TRUE if the settings "Save" button was pressed |
is_form_editor() | Returns TRUE if the current page is the form editor page. Otherwise, returns FALSE |
is_form_list() | Returns TRUE if the current page is the form list page. Otherwise, returns FALSE |
is_form_settings() | Returns TRUE if the current page is the form settings page, or a specific form settings tab (specified by the $tab parameter). Otherwise returns FALSE |
is_plugin_settings() | Returns TRUE if the current page is the plugin settings main page, or a specific plugin settings tab (specified by the $tab parameter). Otherwise returns FALSE |
is_app_settings() | Returns TRUE if the current page is the app settings main page, or a specific apps settings tab (specified by the $tab parameter). Otherwise returns FALSE |
is_plugin_page() | Returns TRUE if the current page is the plugin page. Otherwise returns FALSE |
is_entry_view() | Returns TRUE if the current page is the entry view page. Otherwise, returns FALSE |
is_entry_edit() | Returns TRUE if the current page is the entry edit page. Otherwise, returns FALSE |
is_results() | Returns TRUE if the current page is the results page. Otherwise, returns FALSE |
is_print() | Returns TRUE if the current page is the print page. Otherwise, returns FALSE |
is_preview() | Returns TRUE if the current page is the preview page. Otherwise, returns FALSE |
is_block_editor() | Determines if the current page is the block editor. |
get_slug() | Returns the slug for the add-on. |
get_short_slug() | Returns the add-on slug with the gravityforms prefix removed. |
get_path() | Returns the path for the add-on. |
update_path() | Fixes the add-on _path property value, if the directory has been renamed. |
get_capabilities() | Get all or a specific capability for Add-On. |
load_text_domain() | Initializing translations. |
init_translations() | Inits the TranslationsPress integration for official add-ons. |
install_translations() | Uses TranslationsPress to install translations for the specified locale. |
get_installed_locales() | Returns an array of locales from the mo files found in the WP_LANG_DIR/plugins directory. |
current_user_can_uninstall() | Determines if the current user has the proper capabilities to uninstall this add-on |
addons_for_uninstall() | Displays all installed addons with their uninstall buttons. |
Method Reference
__construct()
function __construct()
Class constructor which hooks the instance into the WordPress init action
Source: includes/addon/class-gf-addon.php:185
bootstrap()
public function bootstrap()
Attaches any filters or actions needed to bootstrap the addon.
Since: 2.5
Source: includes/addon/class-gf-addon.php:204
init_theme_layer()
public function init_theme_layer()
Initializes the theme layer process for the add-on.
Since: Unknown
Source: includes/addon/class-gf-addon.php:219
get_theme_layer_styles()
public function get_theme_layer_styles( $form, $field_type='', $gravity_theme_path='' )
Helper method that returns the theme styles that should be enqueued for the add-on. Returns an array in the format accepted by the Gravity Forms theme layer set_styles() method
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The current form object to enqueue styles for. | |
$field_type | string | '' | The field type associated with the add-on. Styles will only be enqueued on the frontend if the form has a field with the specified field type. |
$gravity_theme_path | string | '' | The path to the gravity theme style. Optional. Only needed for add-ons that implement the gravity theme outside the default /assets/css/dist/theme.css path. |
Returns
array— Returns and array of styles to enqueue in the format accepted by the Gravity Forms theme layer set_styles() method.
Since: 2.9.0
Source: includes/addon/class-gf-addon.php:246
get_themes_to_enqueue()
public function get_themes_to_enqueue( $form, $field_types='' )
Helper method that returns the themes that should be enqueued for the add-on. Returns an array of theme slugs.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The current form object to enqueue styles for. | |
$field_types | string | array | '' | The field type(s) associated with the add-on. Themes will only be enqueued on the frontend if the form has a field with the specified field type(s). Can be a string with a single field type or an array of strings with multiple field types. |
Returns
array— Returns and array of theme slugs to enqueue.
Since: 2.9.0
Source: includes/addon/class-gf-addon.php:286
register()
public static function register( $class, $overrides=null )
Registers an addon so that it gets initialized appropriately
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$class | string | The class name | |
$overrides | string | null | Specify the class to replace/override |
Source: includes/addon/class-gf-addon.php:296
get_registered_addons()
public static function get_registered_addons( $return_instances=false, $slug_as_key=false )
Gets all active, registered Add-Ons.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$return_instances | bool | false | Indicates if the current instances of the add-ons should be returned. Default is false. |
$slug_as_key | bool | false | Indicates if the add-on slug should be used as the key to the add-on instance. Default is false. |
Returns
string[]|(GFAddOn| GFFeedAddOn |GFPaymentAddOn)[]— An array of class names or instances.
Since:
Source: includes/addon/class-gf-addon.php:330
get_addon_by_slug()
public static function get_addon_by_slug( $slug )
Finds a registered add-on by its slug and return its instance.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$slug | string | The add-on slug. |
Returns
- GFAddOn — Returns an instance of the add-on with the specified slug.
Since: 2.9.1
Source: includes/addon/class-gf-addon.php:367
init_addons()
public static function init_addons()
Initializes all addons.
Since:
Unknown2.5.6(Updated to use get_registered_addons().)
Source: includes/addon/class-gf-addon.php:390
pre_init()
public function pre_init()
Gets executed before all init functions. Override this function to perform initialization tasks that must be done prior to init
Source: includes/addon/class-gf-addon.php:397
init()
public function init()
Plugin starting point. Handles hooks and loading of language files.
Source: includes/addon/class-gf-addon.php:411
init_admin()
public function init_admin()
Override this function to add initialization code (i.e. hooks) for the admin site (WP dashboard)
Source: includes/addon/class-gf-addon.php:451
get_results_addon()
public static function get_results_addon()
Returns instances of the add-ons that implement the results/sales pages.
Returns
array
Since: 2.5.13
Source: includes/addon/class-gf-addon.php:545
get_registered_scripts()
public static function get_registered_scripts()
Returns a list of the registered scripts that will be enqueued.
This contains the scripts that pass _can_enqueue_script.
Returns
array
Since: 2.6
Source: includes/addon/class-gf-addon.php:558
get_registered_styles()
public static function get_registered_styles()
Returns a list of the registered styles.
This contains the styles that pass _can_enqueue_script.
Returns
array
Since: 2.6
Source: includes/addon/class-gf-addon.php:571
init_frontend()
public function init_frontend()
Override this function to add initialization code (i.e. hooks) for the public (customer facing) site
Source: includes/addon/class-gf-addon.php:578
init_ajax()
public function init_ajax()
Override this function to add AJAX hooks or to add initialization code when an AJAX request is being performed
Source: includes/addon/class-gf-addon.php:639
minimum_requirements()
public function minimum_requirements()
Override this function to provide a list of requirements needed to use Add-On.
Custom requirements can be defined by adding a callback to the minimum requirements array. A custom requirement receives and should return an array with two parameters: bool $meets_requirements If the custom requirements check passed. array $errors An array of error messages to present to the user.
Following is an example of the array that is expected to be returned by this function:
Returns
array
Examples
https://gist.github.com/JeffMatson/a8d23e16e333e5116060906c6f091aa7
Since: 2.2
Source: includes/addon/class-gf-addon.php:677
meets_minimum_requirements()
public function meets_minimum_requirements()
Performs a check to see if WordPress environment meets minimum requirements need to use Add-On.
Returns
bool|array
Since: 2.2
Source: includes/addon/class-gf-addon.php:694
failed_requirements_init()
public function failed_requirements_init()
Register failed requirements page under Gravity Forms settings.
Since: 2.2
Source: includes/addon/class-gf-addon.php:914
setup()
public function setup()
Performs upgrade tasks when the version of the Add-On changes. To add additional upgrade tasks, override the upgrade() function, which will only get executed when the plugin version has changed.
Source: includes/addon/class-gf-addon.php:945
upgrade()
public function upgrade( $previous_version )
Override this function to add to add database update scripts or any other code to be executed when the Add-On version changes
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$previous_version |
Source: includes/addon/class-gf-addon.php:966
post_gravityforms_upgrade()
public function post_gravityforms_upgrade( $db_version, $previous_db_version, $force_upgrade )
Gets called when Gravity Forms upgrade process is completed. This function is intended to be used internally, override the upgrade() function to execute database update scripts.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$db_version | Current Gravity Forms database version | ||
$previous_db_version | Previous Gravity Forms database version | ||
$force_upgrade | True if this is a request to force an upgrade. False if this is a standard upgrade (due to version change) |
Source: includes/addon/class-gf-addon.php:977
styles()
public function styles()
Override this function to provide a list of styles to be enqueued.
When overriding this function, be sure to call parent::styles() to ensure the base class scripts are enqueued. See scripts() for an example of the format expected to be returned.
Source: includes/addon/class-gf-addon.php:998
scripts()
public function scripts()
Override this function to provide a list of scripts to be enqueued.
When overriding this function, be sure to call parent::scripts() to ensure the base class scripts are enqueued. Following is an example of the array that is expected to be returned by this function: <pre>
array(
array(
'handle' => 'maskedinput',
'src' => GFCommon::get_base_url() . '/js/jquery.maskedinput-1.3.min.js',
'version' => GFCommon::$version,
'deps' => array( 'jquery' ),
'in_footer' => false,
// Determines where the script will be enqueued. The script will be enqueued if any of the conditions match.
'enqueue' => array(
// admin_page - Specified one or more pages (known pages) where the script is supposed to be enqueued.
// To enqueue scripts in the front end (public website), simply don't define this setting.
array( 'admin_page' => array( 'form_settings', 'plugin_settings' ) ),
// tab - Specifies a form settings or plugin settings tab in which the script is supposed to be enqueued.
// If none are specified, the script will be enqueued in any of the form settings or plugin_settings page
array( 'tab' => 'signature'),
// query - Specifies a set of query string ($_GET) values.
// If all specified query string values match the current requested page, the script will be enqueued
array( 'query' => 'page=gf_edit_forms&view=settings&id=_notempty_' )
// post - Specifies a set of post ($_POST) values.
// If all specified posted values match the current request, the script will be enqueued
array( 'post' => 'posted_field=val' )
// If a nested condition is used, it will be considered a "match" if ALL sub-conditions match.
// In the following example, the condition will match if you are on the plugin settings page AND on the signature tab
array(
'admin_page' => array( 'plugin_settings' )
'tab' => 'signature',
),
)
),
array(
'handle' => 'super_signature_script',
'src' => $this->get_base_url() . '/super_signature/ss.js',
'version' => $this->_version,
'deps' => array( 'jquery'),
'callback' => array( $this, 'localize_scripts' ),
'strings' => array(
// Accessible in JavaScript using the global variable "[script handle]_strings"
'stringKey1' => __( 'The string', 'gravityforms' ),
'stringKey2' => __( 'Another string.', 'gravityforms' )
)
"enqueue" => array(
// field_types - Specifies one or more field types that requires this script.
// The script will only be enqueued if the current form has a field of any of the specified field types.
// Only applies when a current form is available (website front end, but also in the form editor, preview, entry details, results, etc...)
array( 'field_types' => array( 'signature' ) )
)
)
);
</pre>
Source: includes/addon/class-gf-addon.php:1085
enqueue_scripts()
public function enqueue_scripts( $form='', $is_ajax=false )
Target of admin_enqueue_scripts and gform_enqueue_scripts hooks.
Not intended to be overridden by child classes. In order to enqueue scripts and styles, override the scripts() and styles() functions
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | '' | ||
$is_ajax | false |
Source: includes/addon/class-gf-addon.php:1159
enqueue_preview_styles()
public function enqueue_preview_styles( $preview_styles, $form )
Target of gform_preview_styles. Enqueue styles to the preview page.
Not intended to be overridden by child classes
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$preview_styles | |||
$form |
Source: includes/addon/class-gf-addon.php:1216
enqueue_print_styles()
public function enqueue_print_styles( $print_styles, $form )
Target of gform_print_styles. Enqueue styles to the print entry page.
Not intended to be overridden by child classes
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$print_styles | |||
$form |
Source: includes/addon/class-gf-addon.php:1227
theme_layer_title()
public function theme_layer_title()
The title to display for this theme layer - defaults to the addon short title.
Returns
string
Since: 2.7
Source: includes/addon/class-gf-addon.php:1257
theme_layer_slug()
public function theme_layer_slug()
The slug to display for this theme layer - defaults to the addon slug.
Returns
string
Since: 2.7
Source: includes/addon/class-gf-addon.php:1268
theme_layer_icon()
public function theme_layer_icon()
The icon to use for displaying on settings pages, etc. Defaults to user icon.
Returns
string
Since: 2.7
Source: includes/addon/class-gf-addon.php:1279
theme_layer_priority()
public function theme_layer_priority()
Provides the priority for this theme layer.
Returns
int
Since: 2.7
Source: includes/addon/class-gf-addon.php:1290
theme_layer_settings_fields()
public function theme_layer_settings_fields()
Defines the various setting fields to display on the Form Settings screen for this theme layer.
Returns
array[]
Since: 2.7
Source: includes/addon/class-gf-addon.php:1301
theme_layer_overridden_fields()
public function theme_layer_overridden_fields()
The fields/views to override for this theme layer.
Returns
string[]
Since: 2.7
Source: includes/addon/class-gf-addon.php:1312
theme_layer_form_css_properties()
public function theme_layer_form_css_properties( $form_id, $settings, $block_settings )
The form CSS properties to output based on settings, block settings, or arbitrary conditions.
These styles are output as a style block both at the top of every form wrapper, as well as at the top of the Full Screen template.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | |||
$settings | |||
$block_settings |
Returns
array|null[]
Since: 2.7
Source: includes/addon/class-gf-addon.php:1330
theme_layer_styles()
public function theme_layer_styles( $form, $ajax, $settings, $block_settings=[] )
An array of styles to enqueue.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | |||
$ajax | |||
$settings | |||
$block_settings | [] |
Returns
array
Since: 2.7
Source: includes/addon/class-gf-addon.php:1346
theme_layer_scripts()
public function theme_layer_scripts( $form, $ajax, $settings, $block_settings=[] )
An array of scripts to enqueue.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | |||
$ajax | |||
$settings | |||
$block_settings | [] |
Returns
array
Since: 2.7
Source: includes/addon/class-gf-addon.php:1362
theme_layer_third_party_styles()
public function theme_layer_third_party_styles( $form_id, $settings, $block_settings )
Provides third party styles to apply for this theme layer.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | |||
$settings | |||
$block_settings |
Returns
array
Since: 2.7
Source: includes/addon/class-gf-addon.php:1373
output_third_party_styles()
public function output_third_party_styles( $markup, $form )
Outputs third-party styles to pass to JS-powered widgets like payment modals, etc.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$markup | |||
$form |
Returns
mixed|string
Since: 2.7
Source: includes/addon/class-gf-addon.php:1387
register_noconflict_scripts()
public function register_noconflict_scripts( $scripts )
Target for the gform_noconflict_scripts filter. Adds scripts to the list of white-listed no conflict scripts.
Not intended to be overridden or called directed by Add-Ons.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$scripts | array | Array of scripts to be white-listed |
Returns
array
Source: includes/addon/class-gf-addon.php:1625
register_noconflict_styles()
public function register_noconflict_styles( $styles )
Target for the gform_noconflict_styles filter. Adds styles to the list of white-listed no conflict scripts.
Not intended to be overridden or called directed by Add-Ons.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$styles | array | Array of styles to be white-listed |
Returns
array
Source: includes/addon/class-gf-addon.php:1641
get_entry_meta()
public function get_entry_meta( $entry_meta, $form_id )
Override this method to activate and configure entry meta.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry_meta | array | An array of entry meta already registered with the gform_entry_meta filter. | |
$form_id | int | The form id |
Returns
array— The filtered entry meta array.
Source: includes/addon/class-gf-addon.php:1659
get_results_page_config()
public function get_results_page_config()
Returns the configuration for the results page. By default this is not activated.
To activate the results page override this function and return an array with the configuration data.
Example: public function get_results_page_config() { return array( "title" => 'Quiz Results', "capabilities" => array("gravityforms_quiz_results"), "callbacks" => array( "fields" => array($this, 'results_fields'), "calculation" => array($this, 'results_calculation'), "markup" => array($this, 'results_markup'), ) ); }
Returns
array|bool
Source: includes/addon/class-gf-addon.php:1684
results_page_init()
public function results_page_init( $results_page_config )
Initializes the result page functionality. To activate result page functionality, override the get_results_page_config() function.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$results_page_config | configuration returned by get_results_page_config() |
Source: includes/addon/class-gf-addon.php:1693
has_members_plugin()
public function has_members_plugin()
Checks whether the Members plugin is installed and activated.
Not intended to be overridden or called directly by Add-Ons.
Returns
bool
Source: includes/addon/class-gf-addon.php:1731
members_register_cap_group()
public function members_register_cap_group()
Register the Gravity Forms Add-Ons capabilities group with the Members plugin.
Since: 2.4
Source: includes/addon/class-gf-addon.php:1741
members_register_caps()
public function members_register_caps()
Register the Add-On capabilities and their human readable labels with the Members plugin.
Since: 2.4
Source: includes/addon/class-gf-addon.php:1762
get_members_caps()
public function get_members_caps()
Get Add-On capabilities and their human readable labels.
Returns
array
Since: 2.4
Source: includes/addon/class-gf-addon.php:1793
filter_ure_capabilities_groups_tree()
public static function filter_ure_capabilities_groups_tree( $groups=[] )
Register Gravity Forms Add-Ons capabilities group with User Role Editor plugin.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$groups | array | [] | Existing capabilities groups. |
Returns
array
Since: 2.4
Source: includes/addon/class-gf-addon.php:1830
filter_ure_custom_capability_groups()
public function filter_ure_custom_capability_groups( $groups=[], $cap_id='' )
Register Gravity Forms capabilities with Gravity Forms group in User Role Editor plugin.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$groups | array | [] | Current capability groups. |
$cap_id | string | '' | Capability identifier. |
Returns
array
Since: 2.4
Source: includes/addon/class-gf-addon.php:1852
current_user_can_any()
public function current_user_can_any( $caps )
Checks whether the current user is assigned to a capability or role.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$caps | string | array | An string or array of capabilities to check |
Returns
bool— Returns true if the current user is assigned to any of the capabilities.
Since: Unknown
Source: includes/addon/class-gf-addon.php:1876
get_settings_renderer()
public function get_settings_renderer()
Gets the current instance of Settings handling settings rendering.
Returns
false|\Gravity_Forms\Gravity_Forms\Settings
Since: 2.5
Source: includes/addon/class-gf-addon.php:1892
set_settings_renderer()
public function set_settings_renderer( $renderer )
Sets the current instance of Settings handling settings rendering.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$renderer | \Gravity_Forms\Gravity_Forms\Settings\Settings | Settings renderer. |
Returns
bool| WP_Error
Since: 2.5
Source: includes/addon/class-gf-addon.php:1907
prepare_settings_sections()
public function prepare_settings_sections( $sections=[], $type='plugin_settings' )
Prepare legacy settings sections for Settings renderer.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$sections | array | [] | Array of settings fields. |
$type | string | 'plugin_settings' | Settings type: plugin_settings, form_settings, feed_settings, app_settings |
Returns
array
Since: 2.5
Source: includes/addon/class-gf-addon.php:1930
prepare_settings_fields()
public function prepare_settings_fields( &$fields=[] )
Prepare legacy settings fields for Settings renderer.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
&$fields | array | [] | Array of fields. |
Returns
array
Since: 2.5
Source: includes/addon/class-gf-addon.php:1966
single_setting_label()
public function single_setting_label( $field )
Displays the label for a field, including the tooltip and requirement indicator.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field |
Source: includes/addon/class-gf-addon.php:2181
set_encryptor()
public function set_encryptor( $encryptor )
Sets the current instance of object that handles settings encryption.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$encryptor | \Gravity_Forms\Gravity_Forms\Settings\GF_Settings_Encryption | Settings encryptor. |
Returns
void
Since: 2.7.17
Source: includes/addon/class-gf-addon.php:2473
get_encryptor()
public function get_encryptor()
Returns the current instance of the settings encryptor.
Returns
GF_Settings_Encryption— Returns the current instance of the settings encryptor.
Since: 2.7.17
Source: includes/addon/class-gf-addon.php:2485
checkbox_item()
public function checkbox_item( $choice, $horizontal_class, $attributes, $value, $tooltip, $error_icon='' )
Returns the markup for an individual checkbox item give the parameters
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$choice | Choice array with all configured properties | ||
$horizontal_class | CSS class to style checkbox items horizontally | ||
$attributes | String containing all the attributes for the input tag. | ||
$value | Currently selection (1 if field has been checked. 0 or null otherwise) | ||
$tooltip | String containing a tooltip for this checkbox item. | ||
$error_icon | '' |
Returns
string— The markup of an individual checkbox item
Source: includes/addon/class-gf-addon.php:2648
checkbox_input()
public function checkbox_input( $choice, $attributes, $value, $tooltip )
Returns the markup for an individual checkbox input and its associated label
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$choice | Choice array with all configured properties | ||
$attributes | String containing all the attributes for the input tag. | ||
$value | Currently selection (1 if field has been checked. 0 or null otherwise) | ||
$tooltip | String containing a tooltip for this checkbox item. |
Returns
string— The markup of an individual checkbox input and its associated label
Source: includes/addon/class-gf-addon.php:2677
choices_have_icon()
public function choices_have_icon( $choices=[] )
Determines if any of the available settings choices have an icon.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$choices | array | [] | (default: array()) |
Returns
bool
Source: includes/addon/class-gf-addon.php:2725
settings_select_custom()
public function settings_select_custom( $field, $echo=true )
Renders and initializes a drop down field with a input field for custom input based on the $field array.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | Field array containing the configuration options of this field | |
$echo | bool | true | = true - true to echo the output to the screen, false to simply return the contents as a string |
Returns
string— The HTML for the field
Source: includes/addon/class-gf-addon.php:2774
get_select_options()
public function get_select_options( $choices, $selected_value )
Prepares an HTML string of options for a drop down field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$choices | array | Array containing all the options for the drop down field | |
$selected_value | string | The value currently selected for the field |
Returns
string— The HTML for the select options
Source: includes/addon/class-gf-addon.php:2809
get_select_option()
public function get_select_option( $choice, $selected_value )
Prepares an HTML string for a single drop down field option.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$choice | array | Array containing the settings for the drop down option | |
$selected_value | string | The value currently selected for the field |
Returns
string— The HTML for the select choice
Source: includes/addon/class-gf-addon.php:2822
settings_generic_map()
public function settings_generic_map( $field, $echo=true )
Renders and initializes a generic map field based on the $field array whose choices are populated by the fields to be mapped.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | Field array containing the configuration options of this field. | |
$echo | bool | true | Determines if field contents should automatically be displayed. Defaults to true. |
Returns
string— The HTML for the field
Since: 2.2
Source: includes/addon/class-gf-addon.php:2856
settings_field_map()
public function settings_field_map( $field, $echo=true )
Renders and initializes a field map field based on the $field array whose choices are populated by the fields to be mapped.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | Field array containing the configuration options of this field. | |
$echo | bool | true | Determines if field contents should automatically be displayed. Defaults to true. |
Returns
string— The HTML for the field
Since: Unknown
Source: includes/addon/class-gf-addon.php:2893
settings_dynamic_field_map()
public function settings_dynamic_field_map( $field, $echo=true )
Renders and initializes a dynamic field map field based on the $field array whose choices are populated by the fields to be mapped.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | Field array containing the configuration options of this field. | |
$echo | bool | true | Determines if field contents should automatically be displayed. Defaults to true. |
Returns
string— The HTML for the field
Since: 1.9.5.13
Source: includes/addon/class-gf-addon.php:2930
settings_field_map_select()
public function settings_field_map_select( $field, $form_id )
Renders a field select field for field maps.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | Field array containing the configuration options of this field. | |
$form_id | int | Form ID to retrieve fields from. |
Returns
string— The HTML for the field
Since: unknown
Source: includes/addon/class-gf-addon.php:2971
get_mapping_field()
public function get_mapping_field( $type, $select_field, $text_field )
Prepares the markup for mapping field key and value fields.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$type | string | The field type being prepared; key or value. | |
$select_field | array | The drop down field properties. | |
$text_field | array | The text field properties. |
Returns
string
Since: 2.2
Source: includes/addon/class-gf-addon.php:3018
field_map_table_header()
public function field_map_table_header()
Heading row for field map table.
Returns
string
Since: 2.2
Source: includes/addon/class-gf-addon.php:3131
field_map_title()
public function field_map_title()
Heading for field map field column.
Returns
string
Since: 2.2
Source: includes/addon/class-gf-addon.php:3152
get_field_map_choices()
public static function get_field_map_choices( $form_id, $field_type=null, $exclude_field_types=null )
Get field map choices for specific form.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form_id | int | Form ID to display fields for. | |
$field_type | array | string | null | Field types to only include as choices. Defaults to null. |
$exclude_field_types | array | string | null | Field types to exclude from choices. Defaults to null. |
Returns
array
Since: unknown
Source: includes/addon/class-gf-addon.php:3177
get_mapped_field_name()
public function get_mapped_field_name( $parent_field, $field_name )
Get input name for field map field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$parent_field | array | Field map field. | |
$field_name | string | Child field. |
Returns
string
Since: unknown
Source: includes/addon/class-gf-addon.php:3324
get_field_map_fields()
public static function get_field_map_fields( $feed, $field_name )
Get mapped key/value pairs for standard field map.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | Feed object. | |
$field_name | string | Field map field name. |
Returns
array
Since: unknown
Source: includes/addon/class-gf-addon.php:3341
get_dynamic_field_map_fields()
public static function get_dynamic_field_map_fields( $feed, $field_name )
Get mapped key/value pairs for dynamic field map.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | Feed object. | |
$field_name | string | Dynamic field map field name. |
Returns
array
Since: 1.9.9.9
Source: includes/addon/class-gf-addon.php:3375
get_generic_map_fields()
public function get_generic_map_fields( $feed, $field_name, $form=[], $entry=[] )
Get mapped key/value pairs for generic map.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$feed | array | Feed object or settings array. | |
$field_name | string | Generic map field name. | |
$form | array | [] | Form object. Defaults to empty array. |
$entry | array | [] | Entry object. Defaults to empty array. |
Returns
array
Since: 2.2
Source: includes/addon/class-gf-addon.php:3418
settings_field_select()
public function settings_field_select( $field, $echo=true )
Renders and initializes a drop down field based on the $field array whose choices are populated by the form's fields.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | Field array containing the configuration options of this field | |
$echo | bool | true | = true - true to echo the output to the screen, false to simply return the contents as a string |
Returns
string— The HTML for the field
Source: includes/addon/class-gf-addon.php:3473
get_default_field_select_field()
public function get_default_field_select_field( $field )
Returns the field to be selected by default for field select fields based on matching labels.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | Field array containing the configuration options of this field |
Returns
string|null
Source: includes/addon/class-gf-addon.php:3508
get_form_fields_as_choices()
public function get_form_fields_as_choices( $form, $args=[] )
Retrieve an array of form fields formatted for select, radio and checkbox settings fields.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | The form object | |
$args | array | [] | Additional settings to check for (field and input types to include, callback for applicable input type) |
Returns
array— The array of formatted form fields
Source: includes/addon/class-gf-addon.php:3528
settings_checkbox_and_select()
public function settings_checkbox_and_select( $field, $echo=true )
Renders and initializes a checkbox field that displays a select field when checked based on the $field array.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | Field array containing the configuration options of this field | |
$echo | bool | true | = true - true to echo the output to the screen, false to simply return the contents as a string |
Returns
string— The HTML for the field
Source: includes/addon/class-gf-addon.php:3555
get_field_attributes()
public function get_field_attributes( $field, $default=[] )
Parses the properties of the $field meta array and returns a set of HTML attributes to be added to the HTML element.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | current field meta to be parsed. | |
$default | array | [] | default set of properties. Will be appended to the properties specified in the $field array |
Returns
array— resulting HTML attributes ready to be included in the HTML element.
Source: includes/addon/class-gf-addon.php:3630
get_choice_attributes()
public function get_choice_attributes( $choice, $field_attributes, $default_choice_attributes=[] )
Parses the properties of the $choice meta array and returns a set of HTML attributes to be added to the HTML element.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$choice | array | current choice meta to be parsed. | |
$field_attributes | array | current field's attributes. | |
$default_choice_attributes | [] |
Returns
array— resulting HTML attributes ready to be included in the HTML element.
Source: includes/addon/class-gf-addon.php:3659
validate_settings()
public function validate_settings( $fields, $settings )
Validates settings fields.
Validates that all fields are valid. Fields can be invalid when they are blank and marked as required or if it fails a custom validation check. To specify a custom validation, use the 'validation_callback' field meta property and implement the validation function with the custom logic.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$fields | A list of all fields from the field meta configuration | ||
$settings | A list of submitted settings values |
Returns
bool— Returns true if all fields have passed validation, and false otherwise.
Source: includes/addon/class-gf-addon.php:3685
validate_text_settings()
public function validate_text_settings( $field, $settings )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | An array representing the field to validate. | |
$settings | array | The current settings to validate against. |
Returns
void
Source: includes/addon/class-gf-addon.php:3793
validate_textarea_settings()
public function validate_textarea_settings( $field, $settings )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | An array representing the field to validate. | |
$settings | array | The current settings to validate against. |
Returns
void
Source: includes/addon/class-gf-addon.php:3807
validate_radio_settings()
public function validate_radio_settings( $field, $settings )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | An array representing the field to validate. | |
$settings | array | The current settings to validate against. |
Returns
void
Source: includes/addon/class-gf-addon.php:3821
validate_select_settings()
public function validate_select_settings( $field, $settings )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | An array representing the field to validate. | |
$settings | array | The current settings to validate against. |
Returns
void
Source: includes/addon/class-gf-addon.php:3835
validate_checkbox_settings()
public function validate_checkbox_settings( $field, $settings )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | An array representing the field to validate. | |
$settings | array | The current settings to validate against. |
Returns
void
Source: includes/addon/class-gf-addon.php:3849
validate_select_custom_settings()
public function validate_select_custom_settings( $field, $settings )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | An array representing the field to validate. | |
$settings | array | The current settings to validate against. |
Returns
void
Source: includes/addon/class-gf-addon.php:3863
validate_field_select_settings()
public function validate_field_select_settings( $field, $settings )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | An array representing the field to validate. | |
$settings | array | The current settings to validate against. |
Returns
void
Source: includes/addon/class-gf-addon.php:3877
validate_field_map_settings()
public function validate_field_map_settings( $field, $settings )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | An array representing the field to validate. | |
$settings | array | The current settings to validate against. |
Returns
void
Source: includes/addon/class-gf-addon.php:3891
validate_checkbox_and_select_settings()
public function validate_checkbox_and_select_settings( $field, $settings )
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | An array representing the field to validate. | |
$settings | array | The current settings to validate against. |
Returns
void
Source: includes/addon/class-gf-addon.php:3905
is_choice_valid()
public function is_choice_valid( $choice, $value )
Helper to determine if the current choice is a match for the submitted field value.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$choice | array | The choice properties. | |
$value | string | array | The submitted field value. |
Returns
bool
Source: includes/addon/class-gf-addon.php:3921
set_field_error()
public function set_field_error( &$field, $error_message='' )
Sets the validation error message
Sets the error message to be displayed when a field fails validation. When implementing a custom validation callback function, use this function to specify the error message to be displayed.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
&$field | \Gravity_Forms\Gravity_Forms\Settings\Fields\Base | array | Field object. | |
$error_message | string | '' | Error message to be displayed. |
Since: Unknown
Source: includes/addon/class-gf-addon.php:3937
get_field_errors()
public function get_field_errors( $field=false )
Gets the validation errors for a field.
Returns validation errors associated with the specified field or a list of all validation messages (if a field isn't specified)
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | \Gravity_Forms\Gravity_Forms\Settings\Fields\Base | array | boolean | false | Optional. The field meta. When specified, errors for this field will be returned |
Returns
string|array— If a field is specified, a string containing the error message will be returned. Otherwise, an array of all errors will be returned
Since: Unknown
Source: includes/addon/class-gf-addon.php:3960
get_error_icon()
public function get_error_icon( $field )
Gets the invalid field icon
Returns the markup for an alert icon to indicate and highlight invalid fields.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | The field meta. |
Returns
string— The full markup for the icon
Source: includes/addon/class-gf-addon.php:3980
maybe_get_tooltip()
public function maybe_get_tooltip( $item )
Returns the tooltip markup if a tooltip is configured for the supplied item (field/child field/choice).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$item | array | The item properties. |
Returns
string
Since: Unknown
Source: includes/addon/class-gf-addon.php:4001
get_required_indicator()
public function get_required_indicator( $field )
Gets the required indicator
Gets the markup of the required indicator symbol to highlight fields that are required
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | The field meta. |
Returns
string— Returns markup of the required indicator symbol
Source: includes/addon/class-gf-addon.php:4015
field_failed_validation()
public function field_failed_validation( $field )
Checks if the specified field failed validation
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field | array | \Gravity_Forms\Gravity_Forms\Settings\Fields\Base | The field meta to be checked |
Returns
bool|mixed— Returns a validation error string if the field has failed validation. Otherwise returns false
Since: Unknown
Source: includes/addon/class-gf-addon.php:4028
filter_settings()
public function filter_settings( $fields, $settings )
Filter settings fields.
Runs through each field and applies the 'save_callback', if set, before saving the settings. To specify a custom save filter, use the 'save_callback' field meta property and implement the save filter function with the custom logic.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$fields | A list of all fields from the field meta configuration | ||
$settings | A list of submitted settings values |
Returns
$settings— The updated settings values.
Since: Unknown
Deprecated: 2.5 (No longer used by internal code and not recommended.)
Source: includes/addon/class-gf-addon.php:4049
add_field()
public function add_field( $name, $fields, $settings, $pos )
Add a field to existing defined fields.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$name | string | Name of field to insert before/after. | |
$fields | array | Gravity_Forms\Gravity_Forms\Settings\Fields\Base[] | Field(s) to add. | |
$settings | array | Existing fields. | |
$pos | string | Insert field "before" or "after" existing field. |
Returns
array
Since:
Unknown2.5(Uses Settings renderer, $settings parameter deprecated.)
Source: includes/addon/class-gf-addon.php:4076
remove_field()
public function remove_field( $name, $settings )
Remove a field from existing defined fields.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$name | string | Name of field to insert before/after. | |
$settings | array | Existing fields. |
Returns
array
Since:
Unknown2.5(Uses Settings renderer, $settings parameter deprecated.)
Source: includes/addon/class-gf-addon.php:4111
replace_field()
public function replace_field( $name, $fields, $settings )
Replace a field in existing defined fields.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$name | string | Name of field to insert before/after. | |
$fields | array | Gravity_Forms\Gravity_Forms\Settings\Fields\Base[] | Field(s) to add. | |
$settings | array | Existing fields. |
Returns
array
Since:
Unknown2.5(Uses Settings renderer, $settings parameter deprecated.)
Source: includes/addon/class-gf-addon.php:4141
get_field()
public function get_field( $name, $settings )
Get a specific settings field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$name | string | Name of field to retrieve. | |
$settings | array | bool | Array of tabs or sections to search through. Defaults to defined fields. |
Returns
\Gravity_Forms\Gravity_Forms\Settings\Fields\Base|array|bool
Since: 2.5
Source: includes/addon/class-gf-addon.php:4174
simple_condition()
public function simple_condition( $setting_name_root )
Helper to create a simple conditional logic set of fields. It creates one row of conditional logic with Field/Operator/Value inputs.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$setting_name_root | mixed | The root name to be used for inputs. It will be used as a prefix to the inputs that make up the conditional logic fields. |
Returns
string— The HTML
Source: includes/addon/class-gf-addon.php:4222
get_conditional_logic_fields()
public function get_conditional_logic_fields()
Override this to define the array of choices which should be used to populate the Simple Condition fields drop down.
Each choice should have 'label' and 'value' properties.
Returns
array
Source: includes/addon/class-gf-addon.php:4310
is_simple_condition_met()
public function is_simple_condition_met( $setting_name_root, $form, $entry, $feed=[] )
Evaluate the rules defined for the Simple Condition field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$setting_name_root | string | The root name used as the prefix to the inputs that make up the Simple Condition field. | |
$form | array | The form currently being processed. | |
$entry | array | The entry currently being processed. | |
$feed | array | [] | The feed currently being processed or an empty array when the field is stored in the form settings. |
Returns
bool
Source: includes/addon/class-gf-addon.php:4324
get_form_settings_capabilities()
public function get_form_settings_capabilities()
Get the capabilities required to access the form settings page.
Returns
array
Source: includes/addon/class-gf-addon.php:4359
form_settings_init()
public function form_settings_init()
Initializes form settings page
Hooks up the required scripts and actions for the Form Settings page
Source: includes/addon/class-gf-addon.php:4367
plugin_page_init()
public function plugin_page_init()
Initializes plugin settings page
Hooks up the required scripts and actions for the Plugin Settings page
Source: includes/addon/class-gf-addon.php:4429
create_plugin_page_menu()
public function create_plugin_page_menu( $menus )
Creates plugin page menu item
Target of gform_addon_navigation filter. Creates a menu item in the left nav, linking to the plugin page
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$menus | Current list of menu items |
Returns
array— Returns a new list of menu items
Source: includes/addon/class-gf-addon.php:4446
form_settings_page()
public function form_settings_page()
Renders the form settings page.
Sets up the form settings page.
Since: Unknown
Source: includes/addon/class-gf-addon.php:4459
form_settings()
public function form_settings( $form )
Custom form settings page
Override this function to implement a complete custom form settings page. Before overriding this function, consider using the form_settings_fields() and specifying your field meta.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form |
Source: includes/addon/class-gf-addon.php:4546
form_settings_page_title()
public function form_settings_page_title()
Custom form settings title
Override this function to display a custom title on the Form Settings Page. By default, the first section in the configuration done in form_settings_fields() will be used as the page title. Use this function to override that behavior and add a custom page title.
Source: includes/addon/class-gf-addon.php:4555
form_settings_icon()
public function form_settings_icon()
Override this function to customize the form settings icon
Source: includes/addon/class-gf-addon.php:4562
plugin_page()
public function plugin_page()
Override this function to create a custom plugin page
Source: includes/addon/class-gf-addon.php:4578
plugin_page_icon()
public function plugin_page_icon()
Override this function to customize the plugin page icon
Source: includes/addon/class-gf-addon.php:4584
plugin_page_title()
public function plugin_page_title()
Override this function to customize the plugin page title
Source: includes/addon/class-gf-addon.php:4591
plugin_page_container()
public function plugin_page_container()
Plugin page container
Target of the plugin menu left nav icon. Displays the outer plugin page markup and calls plugin_page() to render the actual page. Override plugin_page() in order to provide a custom plugin page
Source: includes/addon/class-gf-addon.php:4600
has_app_menu()
public function has_app_menu()
Checks whether the current Add-On has a top level app menu.
Returns
bool
Source: includes/addon/class-gf-addon.php:4626
create_app_menu()
public function create_app_menu()
Creates a top level app menu. Adds the app settings page automatically if it's configured.
Target of the WordPress admin_menu action. Not intended to be overridden or called directly by add-ons.
Source: includes/addon/class-gf-addon.php:4635
get_app_menu_items()
public function get_app_menu_items()
Override this function to create a top level app menu.
e.g. $menu_item['name'] = 'gravitycontacts'; $menu_item['label'] = __("Contacts", 'gravitycontacts'); $menu_item['permission'] = 'gravitycontacts_view_contacts'; $menu_item['callback'] = array($this, 'app_menu');
Returns
array— The array of menu items
Source: includes/addon/class-gf-addon.php:4743
get_app_menu_icon()
public function get_app_menu_icon()
Override this function to specify a custom icon for the top level app menu.
Accepts a dashicon class or a URL.
Returns
string
Source: includes/addon/class-gf-addon.php:4753
load_screen_options()
public function load_screen_options()
Override this function to load custom screen options.
e.g. $screen = get_current_screen(); if(!is_object($screen) || $screen->id != $this->app_hook_suffix) return;
if($this->is_contact_list_page()){ $args = array( 'label' => __('Contacts per page', 'gravitycontacts'), 'default' => 20, 'option' => 'gcontacts_per_page' ); add_screen_option( 'per_page', $args );
Source: includes/addon/class-gf-addon.php:4773
app_tab_page()
public function app_tab_page()
Handles the rendering of app menu items that implement the tabs UI.
Not intended to be overridden or called directly by add-ons.
Source: includes/addon/class-gf-addon.php:4781
get_form_settings()
public function get_form_settings( $form )
Returns the form settings for the Add-On
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form |
Returns
array
Source: includes/addon/class-gf-addon.php:4864
add_form_settings_menu()
public function add_form_settings_menu( $tabs, $form_id )
Add the form settings tab.
Override this function to add the tab conditionally.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$tabs | |||
$form_id |
Returns
array
Source: includes/addon/class-gf-addon.php:4879
form_settings_fields()
public function form_settings_fields( $form )
Override this function to specify the settings fields to be rendered on the form settings page
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form |
Source: includes/addon/class-gf-addon.php:4896
plugin_settings_init()
public function plugin_settings_init()
Initialize Plugin Settings page.
Since: Unknown
Source: includes/addon/class-gf-addon.php:4911
plugin_settings_link()
public function plugin_settings_link( $links, $file )
Add link to Plugin Settings page on Plugins page.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$links | string[] | An array of plugin action links. | |
$file | string | Path to the plugin file relative to the plugins directory. |
Returns
string[]
Since: Unknown
Source: includes/addon/class-gf-addon.php:4970
plugin_settings_page()
public function plugin_settings_page()
Plugin Settings page.
Since: Unknown
Source: includes/addon/class-gf-addon.php:4986
plugin_settings_title()
public function plugin_settings_title()
Returns title for Plugin Settings page header.
Returns
string
Since: Unknown
Source: includes/addon/class-gf-addon.php:5035
plugin_settings_icon()
public function plugin_settings_icon()
Returns icon for Plugin Settings page header.
Returns
string
Since: Unknown
Source: includes/addon/class-gf-addon.php:5046
plugin_settings()
public function plugin_settings()
Override this function to add a custom settings page.
Since: Unknown
Source: includes/addon/class-gf-addon.php:5055
has_plugin_settings_page()
public function has_plugin_settings_page()
Checks whether the current Add-On has a settings page.
Returns
bool
Since: Unknown
Source: includes/addon/class-gf-addon.php:5065
get_plugin_settings()
public function get_plugin_settings()
Returns the currently saved plugin settings
Returns
array|false— Returns the plugin settings or false if the settings haven't been saved yet.
Since:
Unknown2.7.17(Added caching of plugin settings and encrypting of settings.)
Source: includes/addon/class-gf-addon.php:5085
get_plugin_setting()
public function get_plugin_setting( $setting_name )
Get plugin setting.
Returns the plugin setting specified by the $setting_name parameter.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$setting_name | string | Plugin setting to be returned |
Returns
string|array|int|bool|null— Returns the specified plugin setting or null if the setting doesn't exist
Since: Unknown
Source: includes/addon/class-gf-addon.php:5105
update_plugin_settings()
public function update_plugin_settings( $settings )
Updates plugin settings with the provided settings
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$settings | array | Plugin settings to be saved. |
Since:
Unknown2.7.17(Added caching of plugin settings and encrypting of settings.)
Source: includes/addon/class-gf-addon.php:5120
maybe_save_plugin_settings()
public function maybe_save_plugin_settings()
Saves the plugin settings if the submit button was pressed
Since: Unknown
Deprecated: 2.5 (No longer used by internal code and not recommended.)
Source: includes/addon/class-gf-addon.php:5132
plugin_settings_fields()
public function plugin_settings_fields()
Override this function to specify the settings fields to be rendered on the plugin settings page.
Returns
array
Since: Unknown
Source: includes/addon/class-gf-addon.php:5145
get_app_settings_tabs()
public function get_app_settings_tabs()
Returns the tabs for the settings app menu item
Not intended to be overridden or called directly by add-ons.
Returns
array|mixed|void
Source: includes/addon/class-gf-addon.php:5162
app_settings_uninstall_tab()
public function app_settings_uninstall_tab()
Renders the app settings uninstall tab.
Not intended to be overridden or called directly by add-ons.
Source: includes/addon/class-gf-addon.php:5191
app_tab_page_header()
public function app_tab_page_header( $tabs, $current_tab, $title, $message='' )
Renders the header for the tabs UI.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$tabs | |||
$current_tab | |||
$title | |||
$message | string | '' |
Source: includes/addon/class-gf-addon.php:5240
app_tab_page_footer()
public function app_tab_page_footer()
Renders the footer for the tabs UI.
Source: includes/addon/class-gf-addon.php:5293
app_settings_title()
public function app_settings_title()
Override this function to specific a custom app settings title
Returns
string
Source: includes/addon/class-gf-addon.php:5358
app_settings_icon()
public function app_settings_icon()
Override this function to specific a custom app settings icon
Returns
string
Source: includes/addon/class-gf-addon.php:5367
has_app_settings()
public function has_app_settings()
Checks whether the current Add-On has a settings page.
Returns
bool
Source: includes/addon/class-gf-addon.php:5376
app_settings()
public function app_settings()
Override this function to add a custom app settings page.
Source: includes/addon/class-gf-addon.php:5383
get_app_settings()
public function get_app_settings()
Returns the currently saved plugin settings
Returns
mixed
Source: includes/addon/class-gf-addon.php:5390
get_app_setting()
public function get_app_setting( $setting_name )
Get app setting
Returns the app setting specified by the $setting_name parameter
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$setting_name | string | Plugin setting to be returned |
Returns
mixed— Returns the specified plugin setting or null if the setting doesn't exist
Source: includes/addon/class-gf-addon.php:5402
update_app_settings()
public function update_app_settings( $settings )
Updates app settings with the provided settings
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$settings | array | App settings to be saved |
Source: includes/addon/class-gf-addon.php:5413
maybe_save_app_settings()
public function maybe_save_app_settings()
Saves the plugin settings if the submit button was pressed
Source: includes/addon/class-gf-addon.php:5421
app_settings_fields()
public function app_settings_fields()
Override this function to specify the settings fields to be rendered on the plugin settings page
Returns
array
Source: includes/addon/class-gf-addon.php:5454
settings_fields_only()
public function settings_fields_only( $settings_type='plugin' )
Returns an flattened array of field settings for the specified settings type ignoring sections.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$settings_type | string | 'plugin' | The settings type. e.g. 'plugin' |
Returns
array
Source: includes/addon/class-gf-addon.php:5466
uninstall_message()
public function uninstall_message()
Override this function to customize the uninstall message displayed on the uninstall page.
Returns
string
Since: 2.5.9.4
Source: includes/addon/class-gf-addon.php:5494
render_uninstall()
public function render_uninstall()
Override this function to customize the markup for the uninstall section on the plugin settings page.
Since: Unknown
Source: includes/addon/class-gf-addon.php:5506
render_settings_button()
public function render_settings_button()
Render a settings button for addons that have overridden the render_uninstall field. Not intended to be called directly or overridden by addons.
Since: 2.5
Source: includes/addon/class-gf-addon.php:5576
maybe_uninstall()
public function maybe_uninstall()
Not intended to be overridden or called directly by Add-Ons.
Source: includes/addon/class-gf-addon.php:5619
uninstall_addon()
public function uninstall_addon()
Removes all settings and deactivates the Add-On.
Not intended to be overridden or called directly by Add-Ons.
Source: includes/addon/class-gf-addon.php:5635
uninstall()
public function uninstall()
Called when the user chooses to uninstall the Add-On - after permissions have been checked and before removing
all Add-On settings and Form settings.
Override this method to perform additional functions such as dropping database tables.
Return false to cancel the uninstall request.
Source: includes/addon/class-gf-addon.php:5700
plugin_row()
public function plugin_row( $plugin_name, $plugin_data )
Target for the after_plugin_row action hook. Checks whether the current version of Gravity Forms
is supported and outputs a message just below the plugin info on the plugins page.
Not intended to be overridden or called directly by Add-Ons.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$plugin_name | string | The plugin filename. Immediately overwritten. | |
$plugin_data | array | An array of plugin data. |
Since:
Unknown2.4.15(Update to improve multisite updates.)
Source: includes/addon/class-gf-addon.php:5718
plugin_message()
public function plugin_message()
Returns the message that will be displayed if the current version of Gravity Forms is not supported.
Override this method to display a custom message.
Source: includes/addon/class-gf-addon.php:5772
compatibility_message()
public function compatibility_message()
Returns the message that will be displayed if the current version of Gravity Forms is not compatible with the add-on.
Override this method to display a custom message.
Since: 2.7.12
Source: includes/addon/class-gf-addon.php:5785
display_plugin_message()
public static function display_plugin_message( $message, $custom_style='' )
Formats and outs a custom message for the plugin row.
Not intended to be overridden or called directly by Add-Ons.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message | string | ||
$custom_style | string | '' |
Since:
Unknown2.9.23(Removed $is_error parameter, added $custom_style parameter.)
Source: includes/addon/class-gf-addon.php:5802
log_error()
public function log_error( $message )
Writes an error message to the Gravity Forms log. Requires the Gravity Forms logging Add-On.
Not intended to be overridden by Add-Ons.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
Source: includes/addon/class-gf-addon.php:5822
log_debug()
public function log_debug( $message )
Writes an error message to the Gravity Forms log. Requires the Gravity Forms logging Add-On.
Not intended to be overridden by Add-Ons.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$message |
Source: includes/addon/class-gf-addon.php:5836
get_locking_config()
public function get_locking_config()
Returns the configuration for locking
e.g.
array( "object_type" => 'contact', "capabilities" => array("gravityforms_contacts_edit_contacts"), "redirect_url" => admin_url("admin.php?page=gf_contacts"), "edit_url" => admin_url(sprintf("admin.php?page=gf_contacts&id=%d", $contact_id)), "strings" => $strings );
Override this method to implement locking
Source: includes/addon/class-gf-addon.php:5860
is_locking_edit_page()
public function is_locking_edit_page()
Returns TRUE if the current page is the edit page. Otherwise, returns FALSE
Override this method to implement locking on the edit page.
Source: includes/addon/class-gf-addon.php:5870
is_locking_list_page()
public function is_locking_list_page()
Returns TRUE if the current page is the list page. Otherwise, returns FALSE
Override this method to display locking info on the list page.
Source: includes/addon/class-gf-addon.php:5879
is_locking_view_page()
public function is_locking_view_page()
Returns TRUE if the current page is the view page. Otherwise, returns FALSE
Override this method to display locking info on the view page.
Source: includes/addon/class-gf-addon.php:5888
get_locking_object_id()
public function get_locking_object_id()
Returns the ID of the object to be locked. E.g. Form ID
Override this method to implement locking
Source: includes/addon/class-gf-addon.php:5897
lock_info()
public function lock_info( $object_id, $echo=true )
Outputs information about the user currently editing the specified object
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$object_id | int | The Object ID | |
$echo | bool | true | Whether to echo |
Returns
string— The markup for the lock info
Source: includes/addon/class-gf-addon.php:5909
list_row_class()
public function list_row_class( $object_id, $echo=true )
Outputs class for the row for the specified Object ID on the list page.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$object_id | int | The object ID | |
$echo | bool | true | Whether to echo |
Returns
string— The markup for the class
Source: includes/addon/class-gf-addon.php:5927
is_object_locked()
public function is_object_locked( $object_id )
Checked whether an object is locked
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$object_id | int | mixed | The object ID |
Returns
bool
Source: includes/addon/class-gf-addon.php:5944
get_mapped_field_value()
public function get_mapped_field_value( $setting_name, $form, $entry, $settings=false )
Returns the value of the mapped field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$setting_name | string | ||
$form | array | ||
$entry | array | ||
$settings | mixed | false |
Returns
string
Source: includes/addon/class-gf-addon.php:5962
get_field_value()
public function get_field_value( $form, $entry, $field_id )
Returns the value of the selected field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$form | array | ||
$entry | array | ||
$field_id | string |
Returns
string— field value
Source: includes/addon/class-gf-addon.php:5980
maybe_override_field_value()
public function maybe_override_field_value( $field_value, $form, $entry, $field_id )
Enables use of the gform_SLUG_field_value filter to override the field value. Override this function to prevent the filter being used or to implement a custom filter.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field_value | string | ||
$form | array | ||
$entry | array | ||
$field_id | string |
Returns
string
Source: includes/addon/class-gf-addon.php:6066
get_full_address()
public function get_full_address( $entry, $field_id )
Returns the combined value of the specified Address field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | ||
$field_id | string |
Returns
string
Source: includes/addon/class-gf-addon.php:6085
get_full_name()
public function get_full_name( $entry, $field_id )
Returns the combined value of the specified Name field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | ||
$field_id | string |
Returns
string
Source: includes/addon/class-gf-addon.php:6098
get_list_field_value()
public function get_list_field_value( $entry, $field_id, $field )
Returns the value of the specified List field.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry | array | ||
$field_id | string | ||
$field | GF_Field_List |
Returns
string
Source: includes/addon/class-gf-addon.php:6112
get_first_field_by_type()
public function get_first_field_by_type( $field_type, $subfield_id=null, $form_id=null, $return_first_only=true )
Returns the field ID of the first field of the desired type.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$field_type | string | ||
$subfield_id | int | null | (default: null) |
$form_id | int | null | (default: null) |
$return_first_only | true |
Returns
string
Source: includes/addon/class-gf-addon.php:6126
note_avatar()
public function note_avatar()
Override this function to specify a custom avatar (i.e. the payment gateway logo) for entry notes created by the Add-On
Returns
string— A fully qualified URL for the avatar
Source: includes/addon/class-gf-addon.php:6166
add_note()
public function add_note( $entry_id, $note, $sub_type=null )
Adds a note to an entry.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$entry_id | |||
$note | |||
$sub_type | null | null |
Returns
int— ID of the new note.
Since: 1.9.12
Source: includes/addon/class-gf-addon.php:6189
get_base_url()
public function get_base_url( $full_path='' )
Returns the url of the root folder of the current Add-On.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$full_path | string | '' | Optional. The full path the the plugin file. |
Returns
string
Source: includes/addon/class-gf-addon.php:6228
get_gfaddon_base_url()
final public static function get_gfaddon_base_url()
Returns the url of the Add-On Framework root folder.
Returns
string
Source: includes/addon/class-gf-addon.php:6241
get_gfaddon_base_path()
final public static function get_gfaddon_base_path()
Returns the physical path of the Add-On Framework root folder.
Returns
string
Source: includes/addon/class-gf-addon.php:6250
get_base_path()
public function get_base_path( $full_path='' )
Returns the physical path of the plugins root folder.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$full_path | string | '' |
Returns
string
Source: includes/addon/class-gf-addon.php:6261
is_gravityforms_installed()
public function is_gravityforms_installed()
Checks whether the Gravity Forms is installed.
Returns
bool
Source: includes/addon/class-gf-addon.php:6297
is_gravityforms_supported()
public function is_gravityforms_supported( $min_gravityforms_version='' )
Checks whether the current version of Gravity Forms is supported
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$min_gravityforms_version | '' |
Returns
bool|mixed
Source: includes/addon/class-gf-addon.php:6314
is_gravityforms_compatible()
public function is_gravityforms_compatible( $min_compatible_gravityforms_version='' )
Checks whether the current version of Gravity Forms is compatible with all features of an add-on.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$min_compatible_gravityforms_version | string | '' | The version to compare the current version with. |
Returns
bool|mixed
Since: 2.7.12
Source: includes/addon/class-gf-addon.php:6335
maybe_display_upgrade_notice()
public function maybe_display_upgrade_notice()
Display an upgrade notice if the current version of Gravity Forms is not fully supported.
Since: 2.7.12
Source: includes/addon/class-gf-addon.php:6358
get_short_title()
public function get_short_title()
Returns this plugin's short title. Used to display the plugin title in small areas such as tabs
Source: includes/addon/class-gf-addon.php:6383
get_menu_icon()
public function get_menu_icon()
Return the plugin's icon for the plugin/form settings menu.
Returns
string
Since: 2.5
Source: includes/addon/class-gf-addon.php:6394
get_icon_namespace()
public function get_icon_namespace()
Return the plugin's icon namespace.
For implementation of a custom font icon kit.
Used by GFCommon::get_icon_markup() and assumes your font icon kit
is setup in a similar fashion to Gravity Forms (class="gform-icon gform-icon--icon-name").
The namespace declared here should not include the -icon.
Returns
string|null
Since: 2.6
Source: includes/addon/class-gf-addon.php:6408
get_version()
public function get_version()
Return this plugin's version.
Returns
string
Since: 2.0
Source: includes/addon/class-gf-addon.php:6420
get_plugin_settings_url()
public function get_plugin_settings_url()
Returns the unescaped URL for the plugin settings tab associated with this plugin
Source: includes/addon/class-gf-addon.php:6428
get_current_form()
public function get_current_form()
Returns the current form object based on the id query var. Otherwise returns false
Returns
array|null|false— If ID is found and is valid form, then the populated Form array is returned.
Source: includes/addon/class-gf-addon.php:6437
is_postback()
public function is_postback()
Returns TRUE if the current request is a postback, otherwise returns FALSE
Source: includes/addon/class-gf-addon.php:6445
is_save_postback()
public function is_save_postback()
Returns TRUE if the settings "Save" button was pressed
Source: includes/addon/class-gf-addon.php:6452
is_form_editor()
public function is_form_editor()
Returns TRUE if the current page is the form editor page. Otherwise, returns FALSE
Source: includes/addon/class-gf-addon.php:6459
is_form_list()
public function is_form_list()
Returns TRUE if the current page is the form list page. Otherwise, returns FALSE
Source: includes/addon/class-gf-addon.php:6477
is_form_settings()
public function is_form_settings( $tab=null )
Returns TRUE if the current page is the form settings page, or a specific form settings tab (specified by the $tab parameter). Otherwise returns FALSE
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$tab | string | null | Specifies a specific form setting page/tab |
Returns
bool
Source: includes/addon/class-gf-addon.php:6493
is_plugin_settings()
public function is_plugin_settings( $tab='' )
Returns TRUE if the current page is the plugin settings main page, or a specific plugin settings tab (specified by the $tab parameter). Otherwise returns FALSE
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$tab | string | '' | Specifies a specific plugin setting page/tab. |
Returns
bool
Source: includes/addon/class-gf-addon.php:6530
is_app_settings()
public function is_app_settings( $tab='' )
Returns TRUE if the current page is the app settings main page, or a specific apps settings tab (specified by the $tab parameter). Otherwise returns FALSE
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$tab | string | '' | Specifies a specific app setting page/tab. |
Returns
bool
Source: includes/addon/class-gf-addon.php:6549
is_plugin_page()
public function is_plugin_page()
Returns TRUE if the current page is the plugin page. Otherwise returns FALSE
Returns
bool
Source: includes/addon/class-gf-addon.php:6565
is_entry_view()
public function is_entry_view()
Returns TRUE if the current page is the entry view page. Otherwise, returns FALSE
Returns
bool
Source: includes/addon/class-gf-addon.php:6574
is_entry_edit()
public function is_entry_edit()
Returns TRUE if the current page is the entry edit page. Otherwise, returns FALSE
Returns
bool
Source: includes/addon/class-gf-addon.php:6586
is_results()
public function is_results()
Returns TRUE if the current page is the results page. Otherwise, returns FALSE
Source: includes/addon/class-gf-addon.php:6605
is_print()
public function is_print()
Returns TRUE if the current page is the print page. Otherwise, returns FALSE
Source: includes/addon/class-gf-addon.php:6616
is_preview()
public function is_preview()
Returns TRUE if the current page is the preview page. Otherwise, returns FALSE
Source: includes/addon/class-gf-addon.php:6627
is_block_editor()
public function is_block_editor()
Determines if the current page is the block editor.
Returns
bool— Returns true if this is the block editor page. Otherwise, returns false.
Since: 2.7
Source: includes/addon/class-gf-addon.php:6642
get_slug()
public function get_slug()
Returns the slug for the add-on.
Since: 2.0
Source: includes/addon/class-gf-addon.php:6709
get_short_slug()
public function get_short_slug()
Returns the add-on slug with the gravityforms prefix removed.
Returns
string
Since: 2.4.18
Source: includes/addon/class-gf-addon.php:6723
get_path()
public function get_path()
Returns the path for the add-on.
Since: 2.2
Source: includes/addon/class-gf-addon.php:6732
update_path()
public function update_path()
Fixes the add-on _path property value, if the directory has been renamed.
Since: 2.4.17
Source: includes/addon/class-gf-addon.php:6741
get_capabilities()
public function get_capabilities( $capability='' )
Get all or a specific capability for Add-On.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$capability | string | '' | Capability to return. |
Returns
string|array
Since: 2.2.5.27
Source: includes/addon/class-gf-addon.php:6765
load_text_domain()
public function load_text_domain()
Initializing translations.
Since: 2.0.7
Source: includes/addon/class-gf-addon.php:6780
init_translations()
public function init_translations()
Inits the TranslationsPress integration for official add-ons.
Since: 2.5.6
Source: includes/addon/class-gf-addon.php:6789
install_translations()
public function install_translations( $locale='' )
Uses TranslationsPress to install translations for the specified locale.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$locale | string | '' | The locale the translations are to be installed for. |
Since: 2.5.6
Source: includes/addon/class-gf-addon.php:6804
get_installed_locales()
public function get_installed_locales()
Returns an array of locales from the mo files found in the WP_LANG_DIR/plugins directory.
Used to display the installed locales on the system report.
Returns
array
Since: 2.5.6
Source: includes/addon/class-gf-addon.php:6821
current_user_can_uninstall()
public function current_user_can_uninstall()
Determines if the current user has the proper capabilities to uninstall this add-on
Add-ons that have been network activated can only be uninstalled by a network admin.
Returns
bool— True if current user can uninstall this add-on. False otherwise
Since: 2.3.1.12
Source: includes/addon/class-gf-addon.php:6838
addons_for_uninstall()
public static function addons_for_uninstall( $uninstallable_addons )
Displays all installed addons with their uninstall buttons.
Add-ons which override this method will display a button with a link instead. The add-on's overridden output will be displayed on the settings page for that add-on.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$uninstallable_addons | array | Array of GFAddOn objects. |
See Also
Since: 2.5
Source: includes/addon/class-gf-addon.php:6856