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
GravityView_Support_Port Class Reference

Public Member Functions

 __construct ()
 
 maybe_add_article_to_tooltip ( $tooltip='', $article=[], $url='', $atts='', $css_class='', $anchor_text='')
 Modify tooltips to add Beacon article. More...
 
 maybe_display_helpscout_beacon ( $display)
 Conditionally displays Help Scout beacon on certain pages. 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 show_for_user ( $user=0)
 Check whether to show Support for a user. More...
 

Data Fields

const HASH_KEY = 'lCXlwbQR707kipR+J0MCqcxrhGOHjGF0ldD6yNbGM0w='
 
const HS_BEACON_KEY = 'b4f6255a-91bc-436c-a5a2-4cca051ad00f'
 
const USER_PREF_NAME = 'gravityview_support_port'
 

Private Member Functions

 add_hooks ()
 

Detailed Description

Since
1.15

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

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

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

References add_hooks().

Member Function Documentation

◆ add_hooks()

add_hooks ( )
private
Since
1.15

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

Referenced by __construct().

◆ maybe_add_article_to_tooltip()

maybe_add_article_to_tooltip (   $tooltip = '',
  $article = [],
  $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 $id Unique ID of article for Beacon API string $url URL of support doc article string $type Type 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 63 of file class-gravityview-support-port.php.

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

◆ maybe_display_helpscout_beacon()

maybe_display_helpscout_beacon (   $display)

Conditionally displays Help Scout beacon on certain pages.

Since
2.16
Parameters
bool$display
Returns
bool
Runs Filter:
gravityview/support_port/display Whether to display Support Port
Since
1.15
Parameters
boolean$display_support_portDefault: true
Runs Filter:
gravityview/support_port/localization_data Filter data passed to the Support Port, before localize_script is run
Since
2.0
2.16 Removed contactEnabled, translation and data keys
Parameters
array$configuration{

array $suggest Article IDs to recommend to the user (per page in the admin) }

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

References $post, and gravityview().

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

References $user, 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 203 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 221 of file class-gravityview-support-port.php.

References $user, and GVCommon\has_cap().

Field Documentation

◆ HASH_KEY

const HASH_KEY = 'lCXlwbQR707kipR+J0MCqcxrhGOHjGF0ldD6yNbGM0w='

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

◆ HS_BEACON_KEY

const HS_BEACON_KEY = 'b4f6255a-91bc-436c-a5a2-4cca051ad00f'

Definition at line 19 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: