Filter
wpml_default_language
On this page
Asks WPML for the site's default language code.
This is a WPML hook that RestroPress calls rather than defines. rpress_wpml_translate_setting_value() uses it to skip translation when the requested language is the default one. With WPML active the filter returns the default language code; without a callback the passed null is returned.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$value | null | Default value returned when WPML is not active. |
Return value#
string|null. Default language code, or null when WPML does not provide one.
Example#
$default_lang = apply_filters( 'wpml_default_language', null );
if ( ! empty( $default_lang ) && 'fr' === $default_lang ) {
// The site's default language is French.
}
Notes#
Provided by WPML, not by RestroPress.
Source#
Applied in:
includes/plugin-compatibility.php(line 537), inrpress_wpml_translate_setting_value()
See also#
Was this page helpful?
