wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



has_translation › WordPress Function

Od6.7.0
Przestarzałyn/a
has_translation ( $singular, $textdomain = 'default', $locale = null )
Parametry: (3)
  • (string) $singular Singular translation to check.
    Wymagane: Tak
  • (string) $textdomain Optional. Text domain. Default 'default'.
    Wymagane: Nie
    Domyślny: 'default'
  • (?string) $locale Optional. Locale. Default current locale.
    Wymagane: Nie
    Domyślny: null
Powrót:
  • (bool) True if the translation exists, false otherwise.
Zdefiniowane na:
Codex:

Returns a boolean to indicate whether a translation exists for a given string with optional text domain and locale.



Źródło

function has_translation( string $singular, string $textdomain = 'default', ?string $locale = null ): bool {
	return WP_Translation_Controller::get_instance()->has_translation( $singular, $textdomain, $locale );
}