wpseo_notification_capabilities

Filter capabilities that enable the displaying of this notification.

Description

(array) apply_filters( 'wpseo_notification_capabilities', (array) $this_options_capabilities, (Yoast_Notification) $instance ); 

Returns (array)

of capabilities or empty for no restrictions.

Parameters (2)

0. $this_options_capabilities (array)
The capabilities that must be present for this Notification.
1. $instance (Yoast_Notification)
The notification object.

Usage

To run the hook, copy the example below.
  1. $this_options_capabilities = apply_filters( 'wpseo_notification_capabilities', $this_options_capabilities, $instance ); 
  2.  
  3. if ( !empty( $this_options_capabilities ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wpseo_notification_capabilities callback 
  2. function filter_wpseo_notification_capabilities( $this_options_capabilities, $instance ) { 
  3. // make filter magic happen here... 
  4. return $this_options_capabilities
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'wpseo_notification_capabilities', 'filter_wpseo_notification_capabilities', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'wpseo_notification_capabilities', 'filter_wpseo_notification_capabilities', 10, 2 ); 

Defined (1)

The filter is defined in the following location(s).

/admin/class-yoast-notification.php  
  1. $capabilities = apply_filters( 'wpseo_notification_capabilities', $this->options['capabilities'], $this );