_monsterinsights_apply_filters_deprecated

Fires functions attached to a deprecated filter hook.

Description

_monsterinsights_apply_filters_deprecated( (string) $tag, (array) $args, (string) $version, (null) $message = null ); 

When a filter hook is deprecated, the apply_filters() call is replaced with apply_filters_deprecated(), which triggers a deprecation notice and then fires the original filter hook. Note, this is a copy of WordPress core's _apply_filters_deprecated function, that we've copied into MonsterInsights so that we can use it on WordPress versions older than 6.0.0 (when it was introduced to core). If we ever bump our minimum WP version requirements above 6.0.0, we'll remove this function.

Parameters (4)

0. $tag (string)
The name of the filter hook.
1. $args (array)
Array of additional function arguments to be passed to apply_filters().
2. $version (string)
The version of WordPress that deprecated the hook.
3. $message — Optional. (null) => null
A message regarding the change. Default null.

Usage

  1. if ( !function_exists( '_monsterinsights_apply_filters_deprecated' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/includes/deprecated.php'; 
  3.  
  4. // The name of the filter hook. 
  5. $tag = ''; 
  6.  
  7. // Array of additional function arguments to be passed to apply_filters(). 
  8. $args = array(); 
  9.  
  10. // The version of WordPress that deprecated the hook. 
  11. $version = ''; 
  12.  
  13. // Optional. A message regarding the change. Default null. 
  14. $message = null; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = _monsterinsights_apply_filters_deprecated($tag, $args, $version, $message); 
  18.  

Defined (1)

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

/includes/deprecated.php  
  1. function _monsterinsights_apply_filters_deprecated( $tag, $args, $version, $message = null ) { 
  2. if ( ! has_filter( $tag ) ) { 
  3. return $args[0]; 
  4.  
  5. _monsterinsights_deprecated_hook( $tag, $version, $message ); 
  6.  
  7. return apply_filters_ref_array( $tag, $args );