On this page
WP_Scripts::in_default_dir( string $src ): bool
Whether a handle’s source is in a default directory.
Parameters
$srcstring Required-
The source of the enqueued script.
Return
bool True if found, false if not.
Source
File: wp-includes/class-wp-scripts.php. View all references
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;
}
Related
Used By
| Used By | Description |
|---|---|
| WP_Scripts::do_item() wp-includes/class-wp-scripts.php | Processes a script dependency. |
Changelog
| Version | Description |
|---|---|
| 2.8.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_scripts/in_default_dir