wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



has_translation › WordPress Function

Desde6.7.0
Obsoleton/a
has_translation ( $singular, $textdomain = 'default', $locale = null )
Parâmetros: (3)
  • (string) $singular Singular translation to check.
    Required: Yes
  • (string) $textdomain Optional. Text domain. Default 'default'.
    Required: No
    Padrão: 'default'
  • (?string) $locale Optional. Locale. Default current locale.
    Required: No
    Padrão: null
Retorna:
  • (bool) True if the translation exists, false otherwise.
Definido em:
Codex:

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



Fonte

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