wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



wp_is_development_mode › WordPress Function

Seit6.3.0
Veraltetn/v
wp_is_development_mode ( $mode )
Parameter:
  • (string) $mode Development mode to check for. Either 'core', 'plugin', 'theme', or 'all'.
    Erforderlich: Ja
Gibt zurück:
  • (bool) True if the given mode is covered by the current development mode, false otherwise.
Definiert in:
Codex:

Checks whether the site is in the given development mode.



Quellcode

function wp_is_development_mode( $mode ) {
	$current_mode = wp_get_development_mode();
	if ( empty( $current_mode ) ) {
		return false;
	}

	// Return true if the current mode encompasses all modes.
	if ( 'all' === $current_mode ) {
		return true;
	}

	// Return true if the current mode is the given mode.
	return $mode === $current_mode;
}