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.10
  • 6.8.11
  • 6.9.10
  • 7.0.7
  • 7.1.3

Present in every tracked release (6.7.10 to 7.1.3).

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:6067_print_emoji_detection_script()
  • wp-includes/formatting.php:6069_print_emoji_detection_script()
  • wp-includes/formatting.php:6074_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.10 through 7.1.3.

  1. 6.7.10
  2. 6.8.11
  3. 6.9.10
  4. 7.0.7
  5. 7.1.3

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

About this page

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