GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
Public Member Functions | Static Public Member Functions | Data Fields | Private Member Functions | Private Attributes | Static Private Attributes
Core Class Reference

Public Member Functions

 __call ( $name, array $arguments=[])
 Magic method to get private class instances. More...
 
 configure_settings ()
 Configures general GravityKit settings. More...
 
 display_foundation_information ()
 Outputs an HTML comment with the Foundation version and the plugin that loaded it. More...
 
 get_registered_plugins ()
 Returns a list of plugins that have instantiated Foundation. More...
 
 init ()
 Initializes Foundation. More...
 
 inline_scripts_and_styles ()
 Inlines scripts/styles. More...
 
 process_ajax_request ()
 Processes AJAX request and routes it to the appropriate endpoint. More...
 
 set_registered_plugins ( $plugins)
 Sets a list of plugins that have instantiated Foundation. More...
 

Static Public Member Functions

static __callStatic ( $name, array $arguments=[])
 Magic method to get private class instances as static methods. More...
 
static get_ajax_params ( $router)
 Registers the GravityKit admin menu. More...
 
static get_instance ()
 Returns class instance. More...
 
static get_request_unique_string ()
 Returns a unique value that was generated for this request. More...
 
static register ( $plugin_file)
 Registers class instance. More...
 

Data Fields

 $_registered_plugins = []
 
const AJAX_ROUTER = 'core'
 
const ID = 'gk_foundation'
 
const INIT_PRIORITY = 100
 
const VERSION = '1.0.8'
 
const WP_AJAX_ACTION = 'gk_foundation_do_ajax'
 

Private Member Functions

 __construct ( $plugin_file)
 Class constructor. More...
 

Private Attributes

 $_components = []
 
 $_plugin_activation_handler
 

Static Private Attributes

static $_instance
 
static $_request_unique_string
 

Detailed Description

Definition at line 25 of file Core.php.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $plugin_file)
private

Class constructor.

Since
1.0.0
Parameters
string$plugin_fileAbsolute path to the main plugin file.
Returns
void

Controls whether the Foundation standalone plugin instance should always be returned regardless of the version.

Runs Filter:
gk/foundation/force-standalone-foundation-instance
Since
1.0.2
Parameters
bool$force_standalone_instanceDefault: true.

Definition at line 90 of file Core.php.

References Arr\get().

Member Function Documentation

◆ __call()

__call (   $name,
array  $arguments = [] 
)

Magic method to get private class instances.

Since
1.0.0
Parameters
string$nameComponent/class name.
array$argumentsOptional and not used.
Returns
mixed

Definition at line 642 of file Core.php.

References Core\$_plugin_activation_handler, and $name.

◆ __callStatic()

static __callStatic (   $name,
array  $arguments = [] 
)
static

Magic method to get private class instances as static methods.

Since
1.0.0
Parameters
string$nameComponent/class name.
array$argumentsOptional and not used.
Returns
mixed

Definition at line 679 of file Core.php.

References $name.

◆ configure_settings()

configure_settings ( )

Configures general GravityKit settings.

Since
1.0.0
Returns
void

Modifies the GravityKit general settings object.

Runs Filter:
gk/foundation/settings
Since
1.0.0
Parameters
array$all_settingsGravityKit general settings.

Definition at line 275 of file Core.php.

References Arr\get(), and GV_PLUGIN_VERSION.

Referenced by Core\init().

◆ display_foundation_information()

display_foundation_information ( )

Outputs an HTML comment with the Foundation version and the plugin that loaded it.

Since
1.0.1
Returns
void

Controls the display of HTML comment with Foundation information.

Runs Filter:
gk/foundation/display_foundation_information
Since
1.0.1
Parameters
bool$display_foundation_informationWhether to display the information.

Definition at line 704 of file Core.php.

References Arr\get().

◆ get_ajax_params()

static get_ajax_params (   $router)
static

Registers the GravityKit admin menu.

Since
1.0.0
Parameters
string$routerAJAX router that will be handling the request.
Returns
array

Definition at line 469 of file Core.php.

◆ get_instance()

static get_instance ( )
static

Returns class instance.

Since
1.0.0
Returns
Core

Definition at line 182 of file Core.php.

Referenced by GravityForms\modify_system_report().

◆ get_registered_plugins()

get_registered_plugins ( )

Returns a list of plugins that have instantiated Foundation.

Since
1.0.0
Returns
array

Definition at line 193 of file Core.php.

References Core\$_registered_plugins.

◆ get_request_unique_string()

static get_request_unique_string ( )
static

Returns a unique value that was generated for this request.

This value can be used, among other purposes, as a random initialization vector for encryption operations performed during the request (e.g., encrypting a license key in various places will result in the same encrypted value).

Since
1.0
Returns
string

Definition at line 693 of file Core.php.

Referenced by ProductManager\ajax_get_products_data(), and LicenseManager\modify_license_data_for_frontend_output().

◆ init()

init ( )

Initializes Foundation.

Since
1.0.0
Returns
void

Fires when the class has finished initializing.

Runs Actions:
gk/foundation/initialized
Since
1.0.0
Parameters
$this

Definition at line 217 of file Core.php.

References Core\configure_settings(), GravityForms\get_instance(), HelpScout\get_instance(), AdminMenu\get_instance(), Encryption\get_instance(), and TrustedLogin\get_instance().

◆ inline_scripts_and_styles()

inline_scripts_and_styles ( )

Inlines scripts/styles.

Since
1.0.0
Returns
void

Modifies scripts inlined by Foundation.

Runs Filter:
gk/foundation/inline-scripts
Since
1.0.0
Parameters
array$inline_scriptsScripts inlined by Foundation.

Modifies styles inlined by Foundation.

Runs Filter:
gk/foundation/inline-styles
Since
1.0.0
Parameters
array$inline_stylesStyles inlined by Foundation.

Definition at line 570 of file Core.php.

◆ process_ajax_request()

process_ajax_request ( )

Processes AJAX request and routes it to the appropriate endpoint.

Since
1.0.0
Exceptions
Exception
Returns
void|mixed Send JSON response if an AJAX request or return the response as is.

Modifies a list of AJAX routes that map to backend functions/class methods. $router groups routes to avoid a name collision (e.g., 'settings', 'licenses').

Runs Filter:
gk/foundation/ajax/{$router}/routes
Since
1.0.0
Parameters
array[]$routes AJAX route to function/class method map.

Modifies AJAX payload before the route is processed.

Runs Filter:
gk/foundation/ajax/payload
Since
1.0.3
Parameters
array$payload
string$router
string$route

Modifies AJAX response after the route is processed.

Runs Filter:
gk/foundation/ajax/result
Since
1.0.3
Parameters
mixed | Exception$result
string$router
string$route
array$payload

Definition at line 487 of file Core.php.

References Arr\get().

◆ register()

static register (   $plugin_file)
static

Registers class instance.

Since
1.0.0
Parameters
string$plugin_fileAbsolute path to the main plugin file.
Returns
void

Definition at line 167 of file Core.php.

◆ set_registered_plugins()

set_registered_plugins (   $plugins)

Sets a list of plugins that have instantiated Foundation.

Since
1.0.0
Parameters
array$pluginsArray of absolute paths to the plugin files that instantiated this class.
Returns
void

Definition at line 206 of file Core.php.

Field Documentation

◆ $_components

$_components = []
private

Definition at line 70 of file Core.php.

◆ $_instance

$_instance
staticprivate

Definition at line 43 of file Core.php.

◆ $_plugin_activation_handler

$_plugin_activation_handler
private

Definition at line 52 of file Core.php.

Referenced by Core\__call().

◆ $_registered_plugins

$_registered_plugins = []

Definition at line 61 of file Core.php.

Referenced by Core\get_registered_plugins().

◆ $_request_unique_string

$_request_unique_string
staticprivate

Definition at line 79 of file Core.php.

◆ AJAX_ROUTER

const AJAX_ROUTER = 'core'

Definition at line 32 of file Core.php.

◆ ID

const ID = 'gk_foundation'

Definition at line 28 of file Core.php.

Referenced by LicenseManager\get_site_data().

◆ INIT_PRIORITY

const INIT_PRIORITY = 100

Definition at line 34 of file Core.php.

◆ VERSION

const VERSION = '1.0.8'

Definition at line 26 of file Core.php.

◆ WP_AJAX_ACTION

const WP_AJAX_ACTION = 'gk_foundation_do_ajax'

Definition at line 30 of file Core.php.


The documentation for this class was generated from the following file: