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

Abstract class that makes it easy for plugins and themes to register no-conflict scripts and styles, as well as add post meta keys for GravityView to parse when checking for the existence of shortcodes in content. More...

Inheritance diagram for GravityView_Plugin_and_Theme_Hooks:
GravityView_Plugin_Hooks_ACF GravityView_Plugin_Hooks_All_In_One_SEO GravityView_Plugin_Hooks_Code_Snippets GravityView_Plugin_Hooks_Debug_Bar GravityView_Plugin_Hooks_Gravity_Flow GravityView_Plugin_Hooks_Gravity_Forms GravityView_Plugin_Hooks_Gravity_Forms_Chained_Selects GravityView_Plugin_Hooks_Gravity_Forms_Coupon GravityView_Plugin_Hooks_Gravity_Forms_Directory GravityView_Plugin_Hooks_Gravity_Forms_Dropbox GravityView_Plugin_Hooks_Gravity_Forms_Partial_Entries GravityView_Plugin_Hooks_Gravity_Forms_Polls GravityView_Plugin_Hooks_Gravity_Forms_Quiz GravityView_Plugin_Hooks_Gravity_Forms_Signature GravityView_Plugin_Hooks_Gravity_Forms_Survey GravityView_Plugin_Hooks_Gravity_PDF GravityView_Plugin_Hooks_Gravity_Perks GravityView_Plugin_Hooks_GravityMaps GravityView_Plugin_Hooks_Leco_Client_Portal GravityView_Plugin_Hooks_Members GravityView_Plugin_Hooks_Pageviews GravityView_Plugin_Hooks_Query_Monitor GravityView_Plugin_Hooks_Wicked_Folders GravityView_Plugin_Hooks_WooCommerce GravityView_Plugin_Hooks_Yoast_SEO GravityView_Theme_Hooks_Avada GravityView_Theme_Hooks_Avia GravityView_Theme_Hooks_Church_Themes GravityView_Theme_Hooks_Elegant_Themes GravityView_Theme_Hooks_Elementor GravityView_Theme_Hooks_GeneratePress GravityView_Theme_Hooks_Genesis GravityView_Theme_Hooks_RCP GravityView_Theme_Hooks_SiteOrigin GravityView_Theme_Hooks_Ultimate_Member GravityView_Theme_Hooks_WooThemes GravityView_Theme_Hooks_WPML

Public Member Functions

 __construct ()
 GravityView_Theme_Support constructor. More...
 
 _wp_loaded ()
 Fired when all themes and plugins have been loaded. More...
 
 merge_content_meta_keys ( $meta_keys=array(), $post=null, & $views=null)
 Merge plugin or theme meta keys that store shortcode data with existing keys to check. More...
 
 merge_meta_keys ( $meta_keys=array(), $post_id=0)
 Merge plugin or theme meta keys that store shortcode data with existing keys to check. More...
 
 merge_noconflict_scripts ( $handles)
 Merge plugin or theme scripts with existing no-conflict scripts. More...
 
 merge_noconflict_styles ( $handles)
 Merge plugin or theme styles with existing no-conflict styles. More...
 
 merge_post_type_support ( $supports=array(), $is_hierarchical=false)
 Merge plugin or theme post type support definitions with existing support values. More...
 

Protected Member Functions

 add_hooks ()
 Add filters for meta key and script/style handles, if defined. More...
 

Protected Attributes

 $class_name = false
 string Optional. More...
 
 $constant_name = false
 string Optional. More...
 
 $content_meta_keys = array()
 Define the keys to be parsed by the gravityview/view_collection/from_post/meta_keys hook. More...
 
 $function_name = false
 string Optional. More...
 
 $meta_keys = array()
 Define the keys to be parsed by the gravityview/data/parse/meta_keys hook. More...
 
 $post_type_support = array()
 Define features in the admin editor used by the theme or plugin to be used when registering the GravityView post type. More...
 
 $script_handles = array()
 Define script handles used by the theme or plugin to be added to allowed no-conflict scripts. More...
 
 $style_handles = array()
 Define style handles used by the theme or plugin to be added to allowed no-conflict styles. More...
 

Private Member Functions

 maybe_add_hooks ()
 Check whether plugin or theme exists. More...
 

Detailed Description

Abstract class that makes it easy for plugins and themes to register no-conflict scripts and styles, as well as add post meta keys for GravityView to parse when checking for the existence of shortcodes in content.

Since
1.15.2

Definition at line 22 of file abstract-gravityview-plugin-and-theme-hooks.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

GravityView_Theme_Support constructor.

Returns
void

Definition at line 87 of file abstract-gravityview-plugin-and-theme-hooks.php.

Member Function Documentation

◆ _wp_loaded()

_wp_loaded ( )

Fired when all themes and plugins have been loaded.

This makes sure we can reliably detect functions and classes.

Definition at line 97 of file abstract-gravityview-plugin-and-theme-hooks.php.

References maybe_add_hooks().

◆ add_hooks()

add_hooks ( )
protected

Add filters for meta key and script/style handles, if defined.

Since
1.15.2
Returns
void

Definition at line 125 of file abstract-gravityview-plugin-and-theme-hooks.php.

Referenced by maybe_add_hooks().

◆ maybe_add_hooks()

maybe_add_hooks ( )
private

Check whether plugin or theme exists.

If so, add hooks. This is to reduce load time, since apply_filters() isn't free. If the class name or function name or constant exists for a plugin or theme, add hooks If the class/function/definition aren't speicifed add the hooks

Since
1.15.2
Returns
void

Definition at line 110 of file abstract-gravityview-plugin-and-theme-hooks.php.

References add_hooks().

Referenced by _wp_loaded().

◆ merge_content_meta_keys()

merge_content_meta_keys (   $meta_keys = array(),
  $post = null,
$views = null 
)

Merge plugin or theme meta keys that store shortcode data with existing keys to check.

Since
2.0.7
Parameters
array$handlesArray of meta keys to check for existence of shortcodes
\WP_Post$postThe ID being checked by GravityView
Returns
array Meta key array, merged with existing meta keys

Definition at line 217 of file abstract-gravityview-plugin-and-theme-hooks.php.

References $meta_keys.

◆ merge_meta_keys()

merge_meta_keys (   $meta_keys = array(),
  $post_id = 0 
)

Merge plugin or theme meta keys that store shortcode data with existing keys to check.

Since
1.15.2
Parameters
array$handlesArray of meta keys to check for existence of shortcodes
int$post_idThe ID being checked by GravityView
Returns
array Meta key array, merged with existing meta keys

Definition at line 203 of file abstract-gravityview-plugin-and-theme-hooks.php.

References $meta_keys.

◆ merge_noconflict_scripts()

merge_noconflict_scripts (   $handles)

Merge plugin or theme scripts with existing no-conflict scripts.

Since
1.15.2
Parameters
array$handlesArray of script handles, as registered with WordPress
Returns
array Handles, merged with existing scripts

Definition at line 186 of file abstract-gravityview-plugin-and-theme-hooks.php.

◆ merge_noconflict_styles()

merge_noconflict_styles (   $handles)

Merge plugin or theme styles with existing no-conflict styles.

Since
1.15.2
Parameters
array$handlesArray of style handles, as registered with WordPress
Returns
array Handles, merged with existing styles

Definition at line 172 of file abstract-gravityview-plugin-and-theme-hooks.php.

◆ merge_post_type_support()

merge_post_type_support (   $supports = array(),
  $is_hierarchical = false 
)

Merge plugin or theme post type support definitions with existing support values.

Since
1.15.2
Parameters
array$supportsArray of features associated with a functional area of the edit screen.
boolean$is_hierarchicalDo Views support parent/child relationships? See gravityview_is_hierarchical filter.
Returns
array Array of features associated with a functional area of the edit screen, merged with existing values

Definition at line 158 of file abstract-gravityview-plugin-and-theme-hooks.php.

Field Documentation

◆ $class_name

$class_name = false
protected

string Optional.

Class that should be exist in a plugin or theme. Used to check whether plugin is active.

Since
1.15.2

Definition at line 28 of file abstract-gravityview-plugin-and-theme-hooks.php.

◆ $constant_name

$constant_name = false
protected

string Optional.

Constant that should be defined by plugin or theme. Used to check whether plugin is active.

Since
1.15.2

Definition at line 40 of file abstract-gravityview-plugin-and-theme-hooks.php.

◆ $content_meta_keys

$content_meta_keys = array()
protected

Define the keys to be parsed by the gravityview/view_collection/from_post/meta_keys hook.

See also
View_Collection::from_post
Since
2.0 array

Definition at line 48 of file abstract-gravityview-plugin-and-theme-hooks.php.

◆ $function_name

$function_name = false
protected

string Optional.

Function that should be exist in a plugin or theme. Used to check whether plugin is active.

Since
1.15.2

Definition at line 34 of file abstract-gravityview-plugin-and-theme-hooks.php.

◆ $meta_keys

$meta_keys = array()
protected

Define the keys to be parsed by the gravityview/data/parse/meta_keys hook.

See also
GravityView_View_Data::parse_post_meta
Since
1.15.2 array

Definition at line 57 of file abstract-gravityview-plugin-and-theme-hooks.php.

Referenced by GravityView_Plugin_Hooks_ACF\add_meta_keys_from_post(), GravityView_Theme_Hooks_SiteOrigin\merge_content_meta_keys(), merge_content_meta_keys(), and merge_meta_keys().

◆ $post_type_support

$post_type_support = array()
protected

Define features in the admin editor used by the theme or plugin to be used when registering the GravityView post type.

See also
::get_endpoint_name
Since
1.15.2 array

Definition at line 81 of file abstract-gravityview-plugin-and-theme-hooks.php.

◆ $script_handles

$script_handles = array()
protected

Define script handles used by the theme or plugin to be added to allowed no-conflict scripts.

See also
GravityView_Admin::remove_conflicts
Since
1.15.2 array

Definition at line 65 of file abstract-gravityview-plugin-and-theme-hooks.php.

◆ $style_handles

$style_handles = array()
protected

Define style handles used by the theme or plugin to be added to allowed no-conflict styles.

See also
GravityView_Admin::remove_conflicts
Since
1.15.2 array

Definition at line 73 of file abstract-gravityview-plugin-and-theme-hooks.php.


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