wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



has_translation › WordPress Function

Da6.7.0
Deprecaton/a
has_translation ( $singular, $textdomain = 'default', $locale = null )
Parametri: (3)
  • (string) $singular Singular translation to check.
    Richiesto:
  • (string) $textdomain Optional. Text domain. Default 'default'.
    Richiesto: No
    Default: 'default'
  • (?string) $locale Optional. Locale. Default current locale.
    Richiesto: No
    Default: null
Ritorna:
  • (bool) True if the translation exists, false otherwise.
Definito a:
Codex:

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



Sorgenti

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