wpseek.com
A WordPress-centric search engine for devs and theme authors



has_translation › WordPress Function

Since6.7.0
Deprecatedn/a
has_translation ( $singular, $textdomain = 'default', $locale = null )
Parameters: (3)
  • (string) $singular Singular translation to check.
    Required: Yes
  • (string) $textdomain Optional. Text domain. Default 'default'.
    Required: No
    Default: 'default'
  • (?string) $locale Optional. Locale. Default current locale.
    Required: No
    Default: null
Returns:
  • (bool) True if the translation exists, false otherwise.
Defined at:
Codex:

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



Source

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