Skip to main content

GV\Plugin

The GravityView WordPress plugin class.

Contains functionality related to GravityView being a WordPress plugin and doing WordPress pluginy things.

Accessible via gravityview()->plugin

Source: future/includes/class-gv-plugin.php:21

Details

  • Kind: class
  • Namespace: GV

Properties

PropertyTypeDescription
$versionstringThe plugin version.
$min_gf_versionstringMinimum Gravity Forms version. GravityView requires at least this version of Gravity Forms to function properly.
$settings\GV\Plugin_SettingsThe plugin settings.

Methods

MethodDescription
get()Get the global instance of \GV\Plugin.
is_GF_25()Check whether Gravity Forms is v2.5-beta or newer
is_network_activated()Check whether GravityView `is network activated.
include_legacy_frontend()Include more legacy stuff.
include_legacy_core()Load more legacy core files.
register_activation_hooks()Register hooks that are fired when the plugin is activated and deactivated.
dir()Retrieve an absolute path within the GravityView plugin directory.
relpath()Retrieve a relative path to the GravityView plugin directory from the WordPress plugin directory
url()Retrieve a URL within the GravityView plugin directory.
is_compatible()Is everything compatible with this version of GravityView?
is_compatible_future_php()Is this version of GravityView compatible with the future required version of PHP?
is_compatible_wordpress()Is this version of GravityView compatible with the current version of WordPress?
is_compatible_future_wordpress()Is this version of GravityView compatible with the future version of WordPress?
is_compatible_gravityforms()Is this version of GravityView compatible with the current version of Gravity Forms?
is_compatible_future_gravityforms()Is this version of GravityView compatible with the future version of Gravity Forms?
supports()Feature support detection.
uninstall()Delete GravityView Views, settings, roles, caps, etc.
setup_gravitykit_admin_menu_redirects()Redirects GravityKit's GravityView submenu pages to the appropriate custom post endpoints.
get_link_to_new_view()Returns the URL to the "All Views" page.
get_link_to_all_views()Returns the URL to the "New View" page.
add_to_gravitykit_admin_menu()Adds "All Views" and "New View" as submenus to the GravityKit menu.

Method Reference

get()

public static function get()

Get the global instance of \GV\Plugin.

Returns

  • \GV\Plugin — The global instance of GravityView Plugin.

Source: future/includes/class-gv-plugin.php:107

is_GF_25()

public function is_GF_25()

Check whether Gravity Forms is v2.5-beta or newer

Returns

  • bool

Source: future/includes/class-gv-plugin.php:149

is_network_activated()

public static function is_network_activated()

Check whether GravityView `is network activated.

Returns

  • bool — Whether it's network activated or not.

Source: future/includes/class-gv-plugin.php:159

include_legacy_frontend()

public function include_legacy_frontend( $force=false )

Include more legacy stuff.

Parameters

NameTypeDefaultDescription
$forcebooleanfalseWhether to force the includes.

Returns

  • void

Source: future/includes/class-gv-plugin.php:173

include_legacy_core()

public function include_legacy_core()

Load more legacy core files.

Returns

  • void

Source: future/includes/class-gv-plugin.php:202

register_activation_hooks()

public function register_activation_hooks()

Register hooks that are fired when the plugin is activated and deactivated.

Returns

  • void

Source: future/includes/class-gv-plugin.php:276

dir()

public function dir( $path='' )

Retrieve an absolute path within the GravityView plugin directory.

Parameters

NameTypeDefaultDescription
$pathstring''Optional. Append this extra path component.

Returns

  • string — The absolute path to the plugin directory.

Since: 2.0

Source: future/includes/class-gv-plugin.php:338

relpath()

public function relpath( $path='' )

Retrieve a relative path to the GravityView plugin directory from the WordPress plugin directory

Parameters

NameTypeDefaultDescription
$pathstring''Optional. Append this extra path component.

Returns

  • string — The relative path to the plugin directory from the plugin directory.

Since: 2.2.3

Source: future/includes/class-gv-plugin.php:352

url()

public function url( $path='/' )

Retrieve a URL within the GravityView plugin directory.

Parameters

NameTypeDefaultDescription
$pathstring'/'Optional. Extra path appended to the URL.

Returns

  • string — The URL to this plugin, with trailing slash.

Since: 2.0

Source: future/includes/class-gv-plugin.php:368

is_compatible()

public function is_compatible()

Is everything compatible with this version of GravityView?

Returns

  • bool

Since: 2.0

Source: future/includes/class-gv-plugin.php:381

is_compatible_future_php()

public function is_compatible_future_php(): bool

Is this version of GravityView compatible with the future required version of PHP?

Returns

  • bool — true if compatible, false otherwise.

Since: 2.0

Source: future/includes/class-gv-plugin.php:394

is_compatible_wordpress()

public function is_compatible_wordpress( $version=null )

Is this version of GravityView compatible with the current version of WordPress?

Parameters

NameTypeDefaultDescription
$versionstringnullVersion to check against; otherwise uses GV_MIN_WP_VERSION

Returns

  • bool — true if compatible, false otherwise.

Since: 2.0

Source: future/includes/class-gv-plugin.php:408

is_compatible_future_wordpress()

public function is_compatible_future_wordpress()

Is this version of GravityView compatible with the future version of WordPress?

Returns

  • bool — true if compatible, false otherwise

Since: 2.9.3

Source: future/includes/class-gv-plugin.php:425

is_compatible_gravityforms()

public function is_compatible_gravityforms()

Is this version of GravityView compatible with the current version of Gravity Forms?

Returns

  • bool — true if compatible, false otherwise (or not active/installed).

Since: 2.0

Source: future/includes/class-gv-plugin.php:440

is_compatible_future_gravityforms()

public function is_compatible_future_gravityforms()

Is this version of GravityView compatible with the future version of Gravity Forms?

Returns

  • bool — true if compatible, false otherwise (or not active/installed).

Since: 2.0

Source: future/includes/class-gv-plugin.php:455

supports()

public function supports( $feature )

Feature support detection.

Parameters

NameTypeDefaultDescription
$featurestringFeature name. Check FEATURE_* class constants.

Returns

  • boolean

Source: future/includes/class-gv-plugin.php:501

uninstall()

public function uninstall()

Delete GravityView Views, settings, roles, caps, etc.

Returns

  • void

Source: future/includes/class-gv-plugin.php:534

setup_gravitykit_admin_menu_redirects()

public function setup_gravitykit_admin_menu_redirects()

Redirects GravityKit's GravityView submenu pages to the appropriate custom post endpoints.

Returns

  • void

Since: 2.16

Source: future/includes/class-gv-plugin.php:637

public function get_link_to_new_view()

Returns the URL to the "All Views" page.

Returns

  • string

Since: 2.17

Source: future/includes/class-gv-plugin.php:670

public function get_link_to_all_views()

Returns the URL to the "New View" page.

Returns

  • string

Since: 2.17

Source: future/includes/class-gv-plugin.php:684

add_to_gravitykit_admin_menu()

public function add_to_gravitykit_admin_menu( $foundation )

Adds "All Views" and "New View" as submenus to the GravityKit menu.

Parameters

NameTypeDefaultDescription
$foundationGravityKitFoundationFoundation instance.

Returns

  • void

Since: 2.16

Source: future/includes/class-gv-plugin.php:700