- Timestamp:
- 09/17/2024 08:56:03 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n/class-wp-translation-controller.php
r58155 r59029 435 435 return $this->loaded_translations[ $locale ][ $textdomain ] ?? array(); 436 436 } 437 438 /** 439 * Returns a boolean to indicate whether a translation exists for a given string with optional text domain and locale. 440 * 441 * @since 6.7.0 442 * 443 * @param string $singular Singular translation to check. 444 * @param string $textdomain Optional. Text domain. Default 'default'. 445 * @param ?string $locale Optional. Locale. Default current locale. 446 * @return bool True if the translation exists, false otherwise. 447 */ 448 public function has_translation( string $singular, string $textdomain = 'default', ?string $locale = null ): bool { 449 if ( null === $locale ) { 450 $locale = $this->current_locale; 451 } 452 453 return false !== $this->locate_translation( $singular, $textdomain, $locale ); 454 } 437 455 }
Note: See TracChangeset
for help on using the changeset viewer.