has_translation()
Returns a boolean to indicate whether a translation exists for a given string with optional text domain and locale.
Хуков нет.
Возвращает
true|false
. True if the translation exists, false otherwise.
Использование
has_translation( $singular, $textdomain, ?string $locale ): bool;
- $singular(строка) (обязательный)
- Singular translation to check.
- $textdomain(строка)
- Text domain.
По умолчанию: 'default' - ?string $locale **
- -
По умолчанию: null
Список изменений
С версии 6.7.0 | Введена. |
Код has_translation() has translation WP 6.7.1
function has_translation( string $singular, string $textdomain = 'default', ?string $locale = null ): bool { return WP_Translation_Controller::get_instance()->has_translation( $singular, $textdomain, $locale ); }