wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



wp_should_disable_pings_for_environment › WordPress Function

Desde7.1.0
Obsoleton/a
› wp_should_disable_pings_for_environment ( Sem parâmetros )
Retorna:
  • (bool) True if pings should be disabled, false otherwise.
Definido em:
Codex:

Determines whether pings should be disabled for the current environment.

By default, all pings (outgoing pingbacks, trackbacks, and ping service notifications, as well as incoming pingbacks and trackbacks) are disabled for non-production environments ('local', 'development', 'staging').


Fonte

function wp_should_disable_pings_for_environment() {
	$environment_type = wp_get_environment_type();
	$should_disable   = 'production' !== $environment_type;

	/**
	 * 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.
	 *
	 * @since 7.1.0
	 *
	 * @param bool   $should_disable   Whether pings should be disabled. Default true
	 *                                 for non-production environments, false for production.
	 * @param string $environment_type The current environment type as returned by
	 *                                 wp_get_environment_type().
	 */
	return apply_filters( 'wp_should_disable_pings_for_environment', $should_disable, $environment_type );
}