apply_filters( 'load_script_textdomain_relative_path', string|false $relative, string $src, bool $is_module )
- Since
- 5.0.2, 7.0.0
Filters the relative path of scripts used for finding translation files.
Compatibility
- WordPress
- since 7.0.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
$relativestring|false- The relative path of the script. False if it could not be determined.
$srcstring- The full source URL of the script.
$is_modulebool- Whether the source belongs to a script module (true) or a classic script (false).
Where this hook fires · 1
wp-includes/l10n.php:1316_load_script_textdomain_from_src()
Source code
* @since 7.0.0 The `$is_module` parameter was added. * * @param string|false $relative The relative path of the script. False if it could not be determined. * @param string $src The full source URL of the script. * @param bool $is_module Whether the source belongs to a script module (true) or a classic script (false). */ $relative = apply_filters( 'load_script_textdomain_relative_path', $relative, $src, $is_module ); // If the source is not from WP. if ( ! is_string( $relative ) ) { return load_script_translations( false, $handle, $domain ); }Changelog
Introduced in 5.0.2. One change between 6.7.7 and 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
7.0.4
Parameter
$is_module added.verified against source7.0.0
The
$is_module parameter was added.from the docblock5.0.2
Introduced.from the docblock
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.