load_script_textdomain_relative_path filter-hookWP 5.0.2

Filters the relative path of scripts used for finding translation files.

Usage

add_filter( 'load_script_textdomain_relative_path', 'wp_kama_load_script_textdomain_relative_path_filter', 10, 3 );

/**
 * Function for `load_script_textdomain_relative_path` filter-hook.
 * 
 * @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).
 *
 * @return string|false
 */
function wp_kama_load_script_textdomain_relative_path_filter( $relative, $src, $is_module ){

	// filter...
	return $relative;
}
$relative(string|false)
The relative path of the script. False if it could not be determined.
$src(string)
The full source URL of the script.
$is_module(true|false)
Whether the source belongs to a script module (true) or a classic script (false).

Changelog

Since 5.0.2 Introduced.
Since 7.0.0 The $is_module parameter was added.

Where the hook is called

_load_script_textdomain_from_src()
load_script_textdomain_relative_path
wp-includes/l10n.php 1316
$relative = apply_filters( 'load_script_textdomain_relative_path', $relative, $src, $is_module );

Where the hook is used in WordPress

Usage not found.