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



wp_get_speculative_loading_override › WordPress Function

Desde7.1.0
Obsoleton/a
› wp_get_speculative_loading_override ( $name )
Acesso:
  • private
Parâmetros:
  • (string) $name Name of the constant and environment variable to look up.
    Required: Yes
Retorna:
  • (string|null) The override value, or null if neither is set.
Definido em:
Codex:

Returns the value of a speculative loading override, as supplied by a constant or an environment variable.

The constant takes precedence over the environment variable, consistent with Ver página de detalhe para wp_get_environment_type »

" href="https://pt.wpseek.com/function/%5Cwp_get_environment_type/">wp_get_environment_type
.


Fonte

function wp_get_speculative_loading_override( string $name ): ?string {
	$value = null;

	// Check if the environment variable has been set, if `getenv` is available on the system.
	if ( function_exists( 'getenv' ) ) {
		$has_env = getenv( $name );
		if ( false !== $has_env ) {
			$value = $has_env;
		}
	}

	// Fetch the value from a constant, which overrides the environment variable.
	if ( defined( $name ) ) {
		$has_constant = constant( $name );
		if ( is_string( $has_constant ) ) {
			$value = $has_constant;
		}
	}

	return $value;
}