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

Public Member Functions

 __construct ()
 
 update_user_meta_value ($user_id)
 Update User Profile preferences for GravityView Support. More...
 
 user_field ($user)
 Modify User Profile. More...
 

Static Public Member Functions

static maybe_enqueue_script ($hook)
 Enqueue Support Port script if user has it enabled and we're on a GravityView plugin page. More...
 
static show_for_user ($user=0)
 Check whether to show Support for a user. More...
 

Data Fields

const user_pref_name = 'gravityview_support_port'
 

Private Member Functions

 add_hooks ()
 

Static Private Member Functions

static _localize_script ()
 Localize the Support Port script. More...
 

Detailed Description

Since
1.15

Definition at line 6 of file class-gravityview-support-port.php.

Constructor & Destructor Documentation

__construct ( )

Definition at line 14 of file class-gravityview-support-port.php.

References add_hooks().

Member Function Documentation

static _localize_script ( )
staticprivate

Localize the Support Port script.

wp_localize_script()

Since
1.15
Returns
void

Definition at line 72 of file class-gravityview-support-port.php.

References GV_License_Handler\get_related_plugins_and_extensions(), getSetting(), GVCommon\has_cap(), and GravityView_Plugin\version.

add_hooks ( )
private
Since
1.15

Definition at line 21 of file class-gravityview-support-port.php.

Referenced by __construct().

static maybe_enqueue_script (   $hook)
static

Enqueue Support Port script if user has it enabled and we're on a GravityView plugin page.

gravityview_is_admin_page() wp_enqueue_script()

Since
1.15
Returns
void
Runs Filter:
gravityview/support_port/display Whether to display Support Port
Since
1.15
Parameters
boolean$display_beaconDefault: true

Definition at line 37 of file class-gravityview-support-port.php.

References GRAVITYVIEW_FILE, gravityview_is_admin_page(), and GravityView_Plugin\version.

static show_for_user (   $user = 0)
static

Check whether to show Support for a user.

If the user doesn't have the gravityview_support_port capability, returns false; then If global setting is "hide", returns false; then If user preference is not set, return global setting; then If user preference is set, return that setting.

Since
1.15
1.17.5 Changed behavior to respect global setting
Parameters
int$userOptional. ID of the user to check, defaults to 0 for current user.
Returns
bool Whether to show GravityView support port

Definition at line 174 of file class-gravityview-support-port.php.

References getSetting(), and GVCommon\has_cap().

update_user_meta_value (   $user_id)

Update User Profile preferences for GravityView Support.

Since
1.5
Parameters
int$user_id
Returns
void

Definition at line 207 of file class-gravityview-support-port.php.

user_field (   $user)

Modify User Profile.

Modifies the output of profile.php to add GravityView Support preference

Since
1.15
1.17.5 Only show if global setting is active
Parameters
WP_User$userCurrent user info
Returns
void
Runs Filter:
gravityview/support_port/show_profile_setting Should the "GravityView Support Port" setting be shown on user profiles?
Since
1.15
Parameters
boolean$allow_profile_settingDefault: true, if the user has the gravityview_support_port capability, which defaults to true for Contributors and higher
WP_User$userCurrent user object

Definition at line 225 of file class-gravityview-support-port.php.

References getSetting().

Field Documentation

const user_pref_name = 'gravityview_support_port'

Definition at line 12 of file class-gravityview-support-port.php.


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