WordPress filter hook · part of WordPress core
load_script_translation_file
A WordPress core filter that 8 plugins also fire themselves, running on 71K+ sites between them.
“This filter is documented in wp-includes/l10n.php”
How to use load_script_translation_file
It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'load_script_translation_file', function( $file, $handle, $domain ) {
// Change $file here.
return $file;
}, 10, 3 );Argument names come from Seraphinite Accelerator's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
This hook is fired by WordPress core too. Official reference on developer.wordpress.org →
8 plugins that fire load_script_translation_file
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Seraphinite Accelerator50,000+ installs
apply_filters( 'load_script_translation_file', $file, $handle, $domain )Cmn/Gen.php:6822 -
Logo Carousel20,000+ installs
apply_filters( 'load_script_translation_file', $file, $handle, $domain )src/Includes/I18n.php:111 -
Seraphinite Post .DOCX Source800+ installs
apply_filters( 'load_script_translation_file', $file, $handle, $domain )Cmn/Gen.php:6642 -
Seraphinite Alternative Slugs Manager20+ installs
apply_filters( 'load_script_translation_file', $file, $handle, $domain )Cmn/Gen.php:5725 -
Seraphinite Bulk Discounts for WooCommerce20+ installs
apply_filters( 'load_script_translation_file', $file, $handle, $domain )Cmn/Gen.php:6038 -
Seraphinite Downloads Statistics10+ installs
apply_filters( 'load_script_translation_file', $file, $handle, $domain )Cmn/Gen.php:6477 -
Crypto Coin Market Prices10+ installs
apply_filters( 'load_script_translation_file', $file, $handle, $domain )Cmn/Gen.php:2135 -
Digispot AIFewer than 10 installs
apply_filters( 'load_script_translation_file', $candidate, $handle, self::DOMAIN )includes/core/class-script-translations.php:111
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.