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

Handle displaying and storing of admin notices for GravityView. More...

Public Member Functions

 __construct ()
 
 add_hooks ()
 
 admin_notice ()
 Outputs the admin notices generated by the plugin. More...
 
 dismiss_notice ()
 Dismiss a GravityView notice - stores the dismissed notices for 16 weeks. More...
 

Static Public Member Functions

static add_notice ( $notice=array())
 Add a notice to be displayed in the admin. More...
 
static flush_dismissed_notices ()
 Clear out the dismissed notices when the plugin gets activated. More...
 
static get_notices ()
 Get admin notices. More...
 

Private Member Functions

 check_show_multisite_notices ()
 Handle whether to display notices in Multisite based on plugin activation status. More...
 
 is_notice_dismissed ( $notice)
 Has the notice been dismissed already in the admin? More...
 

Static Private Attributes

static $admin_notices = array()
 
static $dismissed_notices = array()
 

Detailed Description

Handle displaying and storing of admin notices for GravityView.

Since
1.12

Definition at line 24 of file class-gravityview-admin-notices.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Definition at line 33 of file class-gravityview-admin-notices.php.

References add_hooks().

Member Function Documentation

◆ add_hooks()

add_hooks ( )

Definition at line 38 of file class-gravityview-admin-notices.php.

Referenced by __construct().

◆ add_notice()

static add_notice (   $notice = array())
static

Add a notice to be displayed in the admin.

Since
1.12 Moved from {
See also
GravityView_Admin::add_notice() }
Since
1.15.1 Allows for cap key, passing capability required to show the message
Parameters
array$notice{ string $class HTML class to be used for the notice. Default: 'error' string $message Notice message, not escaped. Allows HTML. string $dismiss Unique key used to determine whether the notice has been dismissed. Set to false if not dismissable. string|array $cap The capability or caps required for an user to see the notice }
Returns
void

Definition at line 234 of file class-gravityview-admin-notices.php.

References gravityview().

Referenced by GravityView_Admin\add_notice().

◆ admin_notice()

admin_notice ( )

Outputs the admin notices generated by the plugin.

GVCommon::has_cap()

Since
1.12
Returns
void
Runs Filter:
gravityview/admin/notices Modify the notices displayed in the admin
Since
1.12

Definition at line 155 of file class-gravityview-admin-notices.php.

References $output, $url, check_show_multisite_notices(), gravityview(), gravityview_get_floaty(), GVCommon\has_cap(), and is_notice_dismissed().

◆ check_show_multisite_notices()

check_show_multisite_notices ( )
private

Handle whether to display notices in Multisite based on plugin activation status.

::is_network_activated

Since
1.12
Returns
bool True: show the notices; false: don't show

Definition at line 128 of file class-gravityview-admin-notices.php.

References gravityview().

Referenced by admin_notice().

◆ dismiss_notice()

dismiss_notice ( )

Dismiss a GravityView notice - stores the dismissed notices for 16 weeks.

Since
1.12
Returns
void

Definition at line 60 of file class-gravityview-admin-notices.php.

References $dismissed_notices.

◆ flush_dismissed_notices()

static flush_dismissed_notices ( )
static

Clear out the dismissed notices when the plugin gets activated.

See also
register_activation_hook
Since
1.15.1
Returns
void

Definition at line 51 of file class-gravityview-admin-notices.php.

◆ get_notices()

static get_notices ( )
static

Get admin notices.

Since
1.12
Returns
array

Definition at line 115 of file class-gravityview-admin-notices.php.

Referenced by GravityView_Admin\get_notices().

◆ is_notice_dismissed()

is_notice_dismissed (   $notice)
private

Has the notice been dismissed already in the admin?

If the passed notice array has a dismiss key, the notice is dismissable. If it's dismissable, we check against other notices that have already been dismissed.

Since
1.12
See also
GravityView_Admin_Notices::dismiss_notice()
GravityView_Admin_Notices::add_notice()
Parameters
string$noticeNotice array, set using add_notice().
Returns
boolean True: show notice; False: hide notice

Definition at line 97 of file class-gravityview-admin-notices.php.

Referenced by admin_notice().

Field Documentation

◆ $admin_notices

$admin_notices = array()
staticprivate

Definition at line 29 of file class-gravityview-admin-notices.php.

◆ $dismissed_notices

$dismissed_notices = array()
staticprivate

Definition at line 31 of file class-gravityview-admin-notices.php.

Referenced by dismiss_notice().


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