wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
wp_get_speculative_loading_override is private and should not be used in themes or plugins directly.
wp_get_speculative_loading_override › WordPress Function
Depuis7.1.0
Dépréciéen/a
› wp_get_speculative_loading_override ( $name )
| Accès: |
|
| Paramètres: |
|
| Retourne: |
|
| Défini(e) dans: |
|
| 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 wp_get_environment_type.Source
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;
}