WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 806 | * Filters the preferred file format for translation files. |
| 807 | * |
| 808 | * Can be used to disable the use of PHP files for translations. |
| 809 | * |
| 810 | * @since 6.5.0 |
| 811 | * |
| 812 | * @param string $preferred_format Preferred file format. Possible values: 'php', 'mo'. Default: 'php'. |
| 813 | * @param string $domain The text domain. |
| 814 | */ |
| 815 | $preferred_format = apply_filters( 'translation_file_format', 'php', $domain ); |
| 816 | if ( ! in_array( $preferred_format, array( 'php', 'mo' ), true ) ) { |
| 817 | $preferred_format = 'php'; |
| 818 | } |
| 819 | |
| 820 | $translation_files = array(); |
| 821 | |
| 822 | if ( 'mo' !== $preferred_format ) { |
| 823 | $translation_files[] = substr_replace( $mofile, ".l10n.$preferred_format", - strlen( '.mo' ) ); |
| 824 | } |