wp_should_disable_pings_for_environment
Filters whether pings should be disabled for the current environment.
Returning false re-enables pings in non-production environments. Returning true disables pings even in production.
Usage
add_filter( 'wp_should_disable_pings_for_environment', 'wp_kama_should_disable_pings_for_environment_filter', 10, 2 );
/**
* Function for `wp_should_disable_pings_for_environment` filter-hook.
*
* @param bool $should_disable Whether pings should be disabled.
* @param string $environment_type The current environment type as returned by wp_get_environment_type().
*
* @return bool
*/
function wp_kama_should_disable_pings_for_environment_filter( $should_disable, $environment_type ){
// filter...
return $should_disable;
}
- $should_disable(true|false)
- Whether pings should be disabled.
Default: true for non-production environments, false for production - $environment_type(string)
- The current environment type as returned by wp_get_environment_type().
Changelog
| Since 7.1.0 | Introduced. |
Where the hook is called
wp_should_disable_pings_for_environment
wp-includes/comment.php 3453
return apply_filters( 'wp_should_disable_pings_for_environment', $should_disable, $environment_type );