apply_filters( 'script_loader_src', string $src, string $handle )
- Since
- 2.2.0
Filters the script loader source.
Compatibility
- WordPress
- since 2.2.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$srcstring- Script loader source path.
$handlestring- Script handle.
Where this hook fires · 6
wp-includes/class-wp-scripts.php:356WP_Scripts::do_item()wp-includes/class-wp-scripts.php:412WP_Scripts::do_item()wp-includes/formatting.php:5934_print_emoji_detection_script()wp-includes/formatting.php:5936_print_emoji_detection_script()wp-includes/formatting.php:5941_print_emoji_detection_script()wp-includes/script-loader.php:199wp_get_script_polyfill()
Source code
* * @since 2.2.0 * * @param string $src Script loader source path. * @param string $handle Script handle. */ $filtered_src = apply_filters( 'script_loader_src', $src, $handle ); if ( $this->in_default_dir( $filtered_src ) && ( $before_script || $after_script || $translations_stop_concat || $this->is_delayed_strategy( $strategy ) ) ) { $this->do_concat = false;Changelog
Introduced in 2.2.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.