wppaste
WordPress

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:378WP_Scripts::do_item()
  • wp-includes/class-wp-scripts.php:448WP_Scripts::do_item()
  • wp-includes/formatting.php:5976_print_emoji_detection_script()
  • wp-includes/formatting.php:5978_print_emoji_detection_script()
  • wp-includes/formatting.php:5983_print_emoji_detection_script()
  • wp-includes/script-loader.php:242wp_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 (				is_string( $filtered_src )				&& $this->in_default_dir( $filtered_src )				&& ( $before_script || $after_script || $translations_stop_concat || $this->is_delayed_strategy( $strategy ) )			) {

Changelog

Introduced in 2.2.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.0.4 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.