WP HOOKS
filtrod 6.5.0

pre_get_language_files_from_path

Args 2Plik wp-includes/class-wp-textdomain-registry.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the translation files retrieved from a specified path before the actual lookup.

Returning a non-null value from the filter will effectively short-circuit the MO files lookup, returning that value instead. This can be useful in situations where the directory contains a large number of files and the default glob() function becomes expensive in terms of performance.

Parametry

ParametrTypOpis
$filesnull | arrayList of translation files. Default null.
$pathstringThe path from which translation files are being fetched.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_get_language_files_from_path', 'twoja_funkcja', 10, 2 );

function twoja_funkcja($param_1, $param_2) {
	// Twój kod
}

Popularne w tej kategorii