Skip to main content

GravityKit\GravityView\Core\Plugin

The GravityView WordPress plugin class.

Since:

  • 2.0
  • 3.0.0 (Migrated to GravityKit\GravityView\Core namespace.)

Source: src/Core/Plugin.php:48

Details

  • Kind: class
  • Namespace: GravityKit\GravityView\Core

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 Plugin.
load_settings()Initialize plugin settings.
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 legacy core files and instantiate side-effect classes.
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.
uninstall_hook()Plugin uninstall hook callback.
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 "New View" page.
get_link_to_all_views()Returns the URL to the "All Views" 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 Plugin.

Returns

Source: src/Core/Plugin.php:134

load_settings()

public function load_settings()

Initialize plugin settings.

Since:

  • 2.0
  • 3.0.0 (Removed direct file loading in favor of Composer autoloading.)

Source: src/Core/Plugin.php:166

is_GF_25()

public function is_GF_25()

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

Returns

  • bool

Source: src/Core/Plugin.php:177

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: src/Core/Plugin.php:187

include_legacy_frontend()

public function include_legacy_frontend( $force=false )

Include more legacy stuff.

Parameters

NameTypeDefaultDescription
$forcebooleanfalseWhether to force the includes.

Returns

  • void

Since:

  • 2.0
  • 3.0.0 (Removed direct file loading in favor of Composer autoloading.)

Deprecated: 3.0.0 (Direct file loading removed; classes now resolve via Composer autoloading.)

Source: src/Core/Plugin.php:205

include_legacy_core()

public function include_legacy_core()

Load legacy core files and instantiate side-effect classes.

Class files are resolved via Composer autoloading (PSR-4 and classmap). Only non-class registration scripts are explicitly included here.

Returns

  • void

Since:

  • 2.0
  • 3.0.0 (Removed direct class file loading in favor of Composer autoloading.)

Deprecated: 3.0.0 (Direct file loading removed; classes now resolve via Composer autoloading.)

Source: src/Core/Plugin.php:241

register_activation_hooks()

public function register_activation_hooks()

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

Returns

  • void

Source: src/Core/Plugin.php:298

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: src/Core/Plugin.php:363

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: src/Core/Plugin.php:377

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: src/Core/Plugin.php:393

is_compatible()

public function is_compatible()

Is everything compatible with this version of GravityView?

Returns

  • bool

Since: 2.0

Source: src/Core/Plugin.php:406

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: src/Core/Plugin.php:419

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: src/Core/Plugin.php:433

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: src/Core/Plugin.php:450

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: src/Core/Plugin.php:465

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: src/Core/Plugin.php:480

supports()

public function supports( $feature )

Feature support detection.

Parameters

NameTypeDefaultDescription
$featurestringFeature name. Check FEATURE_* class constants.

Returns

  • boolean

Source: src/Core/Plugin.php:526

uninstall()

public function uninstall()

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

Returns

  • void

Source: src/Core/Plugin.php:559

uninstall_hook()

public static function uninstall_hook()

Plugin uninstall hook callback.

WordPress requires uninstall hook callbacks to be static callables.

Returns

  • void

Since: 3.0.0

Source: src/Core/Plugin.php:666

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: src/Core/Plugin.php:677

public function get_link_to_new_view()

Returns the URL to the "New View" page.

Returns

  • string

Since: 2.17

Source: src/Core/Plugin.php:710

public function get_link_to_all_views()

Returns the URL to the "All Views" page.

Returns

  • string

Since: 2.17

Source: src/Core/Plugin.php:724

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: src/Core/Plugin.php:740