WP_Scripts::in_default_dir( string $src )

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


Parameters Parameters

$src

(string) (Required) The source of the enqueued script.


Top ↑

Return Return

(bool) True if found, false if not.


Top ↑

Source Source

File: wp-includes/class.wp-scripts.php

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

		if ( 0 === strpos( $src, '/' . WPINC . '/js/l10n' ) ) {
			return false;
		}

		foreach ( (array) $this->default_dirs as $test ) {
			if ( 0 === strpos( $src, $test ) ) {
				return true;
			}
		}
		return false;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.