HTTP/2 301
server: nginx
date: Fri, 26 Dec 2025 14:55:07 GMT
content-type: text/html; charset=UTF-8
x-olaf: ⛄
vary: accept, content-type
x-redirect-by: WordPress
location: https://developer.wordpress.org/reference/classes/wp_scripts/in_default_dir/
x-frame-options: SAMEORIGIN
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
HTTP/2 200
server: nginx
date: Fri, 26 Dec 2025 14:55:08 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
x-olaf: ⛄
vary: accept, content-type
link:
; rel="https://api.w.org/"
link:
; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
x-frame-options: SAMEORIGIN
content-encoding: gzip
alt-svc: h3=":443"; ma=86400
x-nc: MISS ord 2
WP_Scripts::in_default_dir() – Method | Developer.WordPress.org
WordPress Developer Resources
WP_Scripts::in_default_dir()
WP_Scripts::in_default_dir( string $src ): bool
Whether a handle’s source is in a default directory.
$srcstringrequiredThe source of the enqueued script.
bool True if found, false if not.
public function in_default_dir( $src ) {
if ( ! $this->default_dirs ) {
return true;
}
if ( str_starts_with( $src, '/' . WPINC . '/js/l10n' ) ) {
return false;
}
foreach ( (array) $this->default_dirs as $test ) {
if ( str_starts_with( $src, $test ) ) {
return true;
}
}
return false;
}
View all references View on Trac View on GitHub
| Version | Description |
|---|
| 2.8.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.