WP_Styles::in_default_dir │ public │ WP 2.8.0

Whether a handle's source is in a default directory.

Метод класса: WP_Styles{}

Хуков нет.

Возвращает

bool. True if found, false if not.

Использование

global $wp_styles;
$wp_styles->in_default_dir( $src );
$src(строка) (обязательный)
The source of the enqueued style.

Список изменений

С версии 2.8.0 Введена.

Код WP_Styles::in_default_dir() WP 7.1.3

public function in_default_dir( $src ) {
	if ( ! $this->default_dirs ) {
		return true;
	}

	return array_any( (array) $this->default_dirs, fn( $test ) => str_starts_with( $src, $test ) );
}