GravityView  2.10.1
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 ()
 
 maybe_add_article_to_tooltip ( $tooltip='', $article=array(), $url='', $atts='', $css_class='', $anchor_text='')
 Modify tooltips to add Beacon article. More...
 
 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 beacon_key = 'lCXlwbQR707kipR+J0MCqcxrhGOHjGF0ldD6yNbGM0w='
 
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()

__construct ( )

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

References add_hooks().

Member Function Documentation

◆ _localize_script()

static _localize_script ( )
staticprivate

Localize the Support Port script.

wp_localize_script()

Since
1.15
Returns
void
Runs Filter:
gravityview/support_port/localization_data Filter data passed to the Support Port, before localize_script is run
Since
2.0
Parameters
array$localization_data{
int$contactEnabledCan the user contact support?
array$dataSupport/license info
array$translationi18n strings
array$suggestArticle IDs to recommend to the user (per page in the admin }

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

References $value, Plugin\$version, gravityview(), and GVCommon\has_cap().

◆ add_hooks()

add_hooks ( )
private
Since
1.15

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

Referenced by __construct().

◆ maybe_add_article_to_tooltip()

maybe_add_article_to_tooltip (   $tooltip = '',
  $article = array(),
  $url = '',
  $atts = '',
  $css_class = '',
  $anchor_text = '' 
)

Modify tooltips to add Beacon article.

Since
2.8.1
Parameters
string$tooltipHTML of original tooltip
array$articleOptional. Details about support doc article connected to the tooltip. {
string$idUnique ID of article for Beacon API
string$urlURL of support doc article
string$typeType of Beacon element to open. {
See also
https://developer.helpscout.com/beacon-2/web/javascript-api/#beaconarticle} }
Parameters
string$url
string$atts
string$css_class
string$anchor_text
string$link_text
Returns
string If no article information exists, original tooltip. Otherwise, modified!

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

References $link_text, $url, and Utils\get().

◆ maybe_enqueue_script()

static maybe_enqueue_script (   $hook)
static

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

::is_admin() 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 100 of file class-gravityview-support-port.php.

References gravityview(), and GRAVITYVIEW_FILE.

◆ show_for_user()

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 266 of file class-gravityview-support-port.php.

References $user, gravityview(), and GVCommon\has_cap().

◆ update_user_meta_value()

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 299 of file class-gravityview-support-port.php.

◆ user_field()

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 317 of file class-gravityview-support-port.php.

References $user, gravityview(), and GVCommon\has_cap().

Field Documentation

◆ beacon_key

const beacon_key = 'lCXlwbQR707kipR+J0MCqcxrhGOHjGF0ldD6yNbGM0w='

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

◆ user_pref_name

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: