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:

functions.php
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.

  1. Seraphinite Accelerator icon Seraphinite Accelerator50,000+ installs apply_filters( 'load_script_translation_file', $file, $handle, $domain ) Cmn/Gen.php:6822
  2. Logo Carousel icon Logo Carousel20,000+ installs apply_filters( 'load_script_translation_file', $file, $handle, $domain ) src/Includes/I18n.php:111
  3. Seraphinite Post .DOCX Source icon Seraphinite Post .DOCX Source800+ installs apply_filters( 'load_script_translation_file', $file, $handle, $domain ) Cmn/Gen.php:6642
  4. Seraphinite Alternative Slugs Manager icon Seraphinite Alternative Slugs Manager20+ installs apply_filters( 'load_script_translation_file', $file, $handle, $domain ) Cmn/Gen.php:5725
  5. Seraphinite Bulk Discounts for WooCommerce icon Seraphinite Bulk Discounts for WooCommerce20+ installs apply_filters( 'load_script_translation_file', $file, $handle, $domain ) Cmn/Gen.php:6038
  6. Seraphinite Downloads Statistics icon Seraphinite Downloads Statistics10+ installs apply_filters( 'load_script_translation_file', $file, $handle, $domain ) Cmn/Gen.php:6477
  7. Crypto Coin Market Prices icon Crypto Coin Market Prices10+ installs apply_filters( 'load_script_translation_file', $file, $handle, $domain ) Cmn/Gen.php:2135
  8. Digispot AI icon 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.