Skip to main content

Gravity_Forms\Gravity_Forms\Messages\Dismissable_Messages

Source: includes/messages/class-dismissable-messages.php:5

Details

  • Kind: class
  • Namespace: Gravity_Forms\Gravity_Forms\Messages

Methods

MethodDescription
add_internal()Add an internal (one we manage within the codebase) dismissible message to the array of dismissible messages.
add()Add a dismissible message to the array of dismissible messages.
remove()Remove a dismissible message from the array of sticky dismissible messages.
display()Outputs dismissible messages on the page.
dismiss()Adds a dismissible message to the user meta of the current user so it's not displayed again.
ajax_dismiss()Target for the wp_ajax_gf_dismiss_message ajax action requested from the Gravity Forms admin pages.

Method Reference

add_internal()

public function add_internal( $key, $type='warning', $capabilities=false, $sticky=false, $page=null )

Add an internal (one we manage within the codebase) dismissible message to the array of dismissible messages.

Parameters

NameTypeDefaultDescription
$keystring
$typestring'warning'
$capabilitiesstring | array | boolfalseA string containing a capability. Or an array or capabilities. Or FALSE for no capability check.
$stickyboolfalseWhether to keep displaying the message until it's dismissed.
$pagestring | nullnullThe page on which to display the sticky message. NULL will display on all pages available.

Since: 2.5.7

Source: includes/messages/class-dismissable-messages.php:20

add()

public function add( $text, $key, $type='warning', $capabilities=false, $sticky=false, $page=null )

Add a dismissible message to the array of dismissible messages.

Parameters

NameTypeDefaultDescription
$textstring
$keystring
$typestring'warning'
$capabilitiesstring | array | boolfalseA string containing a capability. Or an array or capabilities. Or FALSE for no capability check.
$stickyboolfalseWhether to keep displaying the message until it's dismissed.
$pagestring | nullnullThe page on which to display the sticky message. NULL will display on all pages available.

Since: 2.5.7

Source: includes/messages/class-dismissable-messages.php:42

remove()

public function remove( $key )

Remove a dismissible message from the array of sticky dismissible messages.

Parameters

NameTypeDefaultDescription
$keystring

Since: 2.5.7

Source: includes/messages/class-dismissable-messages.php:69

display()

public function display( $messages=false, $page=null )

Outputs dismissible messages on the page.

Parameters

NameTypeDefaultDescription
$messagesarray | boolfalseA predetermined set of messages to display instead of retrieving them.
$pagestring | nullnullDefaults to current Gravity Forms page from \GFForms::get_page().

Since: 2.5.7

Source: includes/messages/class-dismissable-messages.php:124

dismiss()

public function dismiss( $key )

Adds a dismissible message to the user meta of the current user so it's not displayed again.

Parameters

NameTypeDefaultDescription
$keystringThe message key.

Since: 2.5.7

Source: includes/messages/class-dismissable-messages.php:213

ajax_dismiss()

public function ajax_dismiss()

Target for the wp_ajax_gf_dismiss_message ajax action requested from the Gravity Forms admin pages.

Returns

  • void

Since: 2.5.7

Source: includes/messages/class-dismissable-messages.php:255