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.


Top ↑

Source

File: wp-includes/l10n.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.0.2Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.