Skip to main content

Gravity_Forms\Gravity_Forms\Environment_Config\GF_Environment_Config_Handler

Class GF_Environment_Config_Handler

Since: 2.6.7 (Provides functionality for handling environment configuration options.)

Source: includes/environment-config/class-gf-environment-config-handler.php:17

Details

  • Kind: class
  • Namespace: Gravity_Forms\Gravity_Forms\Environment_Config

Properties

PropertyTypeDescription
$cache\GFCacheProvides caching service.

Methods

MethodDescription
__construct()GF_Environment_Config_Handler constructor.
get_environment_setting()Gets an environment setting from wp_options.
get_license_key()Gets the license_key config value.
get_hide_license()Gets the hide_license config value.
get_hide_background_updates()Gets the hide_background_updates config value.
get_hide_install_wizard()Gets the hide_install_wizard config value.
get_hide_update_message()Gets the hide_update_message config value.
get_support_url()Gets the support_url config value.
get_unregistered_license_message()Gets the unregistered_license_message config value.
maybe_override_gform_pending_installation()Target of the pre_option_gform_pending_installation filter. Bypasses the installation wizard by returning 0 for the gform_pending_installation option.
maybe_hide_plugin_page_message()Maybe hides the automatic update message on the plugin's page.
maybe_hide_update_page_message()Maybe hides the automatic update message on the Update page.
maybe_override_rg_gforms_key()Target of the pre_option_rg_gforms_key filter. Uses the license key configured by the environment settings if one is set.
maybe_hide_setting()Target of the gform_plugin_settings_fields filter. Removes sections from the settings page that are configured to be hidden.

Method Reference

__construct()

public function __construct( $cache )

GF_Environment_Config_Handler constructor.

Parameters

NameTypeDefaultDescription
$cache\GFCacheProvides caching service.

Since: 2.6.7

Source: includes/environment-config/class-gf-environment-config-handler.php:33

get_environment_setting()

public function get_environment_setting( $name, $default=false )

Gets an environment setting from wp_options.

Parameters

NameTypeDefaultDescription
$namestringThe environment setting name. Don't include the "gf_env_" prefix.
$defaultmixedfalseDefault value to be returned if option is not set.

Returns

  • mixed

Since: 2.6.7

Source: includes/environment-config/class-gf-environment-config-handler.php:48

get_license_key()

public function get_license_key()

Gets the license_key config value.

Returns

  • string — The license key config.

Since: 2.6.7

Source: includes/environment-config/class-gf-environment-config-handler.php:65

get_hide_license()

public function get_hide_license()

Gets the hide_license config value.

Returns

  • bool — Returns true if license is supposed to be hidden from the UI, false otherwise.

Since: 2.6.7

Source: includes/environment-config/class-gf-environment-config-handler.php:76

get_hide_background_updates()

public function get_hide_background_updates()

Gets the hide_background_updates config value.

Returns

  • bool — Returns true if the background updates setting is supposed to be hidden from the UI. Returns false otherwise.

Since: 2.6.9

Source: includes/environment-config/class-gf-environment-config-handler.php:87

get_hide_install_wizard()

public function get_hide_install_wizard()

Gets the hide_install_wizard config value.

Returns

  • bool — Returns true if install wizard is supposed to be hidden. Returns false otherwise.

Since: 2.6.7

Source: includes/environment-config/class-gf-environment-config-handler.php:98

get_hide_update_message()

public function get_hide_update_message()

Gets the hide_update_message config value.

Returns

  • bool — Returns true if install wizard is supposed to be hidden. Returns false otherwise.

Since: 2.6.7

Source: includes/environment-config/class-gf-environment-config-handler.php:109

get_support_url()

public function get_support_url()

Gets the support_url config value.

Returns

  • string — The support link config value.

Since: 2.6.7

Source: includes/environment-config/class-gf-environment-config-handler.php:120

get_unregistered_license_message()

public function get_unregistered_license_message()

Gets the unregistered_license_message config value.

Returns

  • string — The message to be displayed when the license is unregistered.

Since: 2.6.7

Source: includes/environment-config/class-gf-environment-config-handler.php:131

maybe_override_gform_pending_installation()

public function maybe_override_gform_pending_installation()

Target of the pre_option_gform_pending_installation filter. Bypasses the installation wizard by returning 0 for the gform_pending_installation option.

Returns

  • int — Returns 0 if the install wizard is set to be hidden by environment settings. Otherwise return false so that option is not overridden.

Source: includes/environment-config/class-gf-environment-config-handler.php:142

maybe_hide_plugin_page_message()

public function maybe_hide_plugin_page_message()

Maybe hides the automatic update message on the plugin's page.

Since: 2.6.8

Source: includes/environment-config/class-gf-environment-config-handler.php:154

maybe_hide_update_page_message()

public function maybe_hide_update_page_message( $updates )

Maybe hides the automatic update message on the Update page.

Parameters

NameTypeDefaultDescription
$updatesarrayUpdates array being filtered.

Since: 2.6.8

Source: includes/environment-config/class-gf-environment-config-handler.php:171

maybe_override_rg_gforms_key()

public function maybe_override_rg_gforms_key()

Target of the pre_option_rg_gforms_key filter. Uses the license key configured by the environment settings if one is set.

Returns

  • string — Returns the environment license key if one is set. If not set, return false so that value is not overridden.

Since: 2.6.7

Source: includes/environment-config/class-gf-environment-config-handler.php:196

maybe_hide_setting()

public function maybe_hide_setting( $fields )

Target of the gform_plugin_settings_fields filter. Removes sections from the settings page that are configured to be hidden.

Parameters

NameTypeDefaultDescription
$fieldsarrayThe settings fields to be filtered.

Returns

  • array — Returns the filtered $fields array.

Since: 2.6.9

Source: includes/environment-config/class-gf-environment-config-handler.php:213