load_script_textdomain_relative_path WordPress Filter Hook
The load_script_textdomain_relative_path hook allows you to load a plugin's text domain by specifying a relative path to the plugin's directory. This is useful if you want to load a plugin's text domain from a different location than the default. To use this hook, you must first specify the relative path to the plugin's directory in the $load_script_textdomain_relative_path variable. Then, you can call the load_script_textdomain() function with the text domain as the first argument and the relative path as the second argument. This hook is useful if you want to load a plugin's text domain from a different location than the default. For example, if you want to load a plugin's text domain from the plugin's directory, you would use the following code:
apply_filters( 'load_script_textdomain_relative_path', string|false $relative , string $src ) #
Filters the relative path of scripts used for finding translation files.
Parameters
- $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.
Source
File: wp-includes/l10n.php
Changelog
Version | Description |
---|---|
5.0.2 | Introduced. |