wp core update 6.6
This commit is contained in:
@@ -98,7 +98,7 @@ final class WP_Translation_Controller {
|
||||
* @param string $locale Optional. Locale. Default current locale.
|
||||
* @return bool True on success, false otherwise.
|
||||
*/
|
||||
public function load_file( string $translation_file, string $textdomain = 'default', string $locale = null ): bool {
|
||||
public function load_file( string $translation_file, string $textdomain = 'default', ?string $locale = null ): bool {
|
||||
if ( null === $locale ) {
|
||||
$locale = $this->current_locale;
|
||||
}
|
||||
@@ -153,7 +153,7 @@ final class WP_Translation_Controller {
|
||||
* @param string $locale Optional. Locale. Defaults to all locales.
|
||||
* @return bool True on success, false otherwise.
|
||||
*/
|
||||
public function unload_file( $file, string $textdomain = 'default', string $locale = null ): bool {
|
||||
public function unload_file( $file, string $textdomain = 'default', ?string $locale = null ): bool {
|
||||
if ( is_string( $file ) ) {
|
||||
$file = realpath( $file );
|
||||
}
|
||||
@@ -198,7 +198,7 @@ final class WP_Translation_Controller {
|
||||
* @param string $locale Optional. Locale. Defaults to all locales.
|
||||
* @return bool True on success, false otherwise.
|
||||
*/
|
||||
public function unload_textdomain( string $textdomain = 'default', string $locale = null ): bool {
|
||||
public function unload_textdomain( string $textdomain = 'default', ?string $locale = null ): bool {
|
||||
$unloaded = false;
|
||||
|
||||
if ( null !== $locale ) {
|
||||
@@ -240,7 +240,7 @@ final class WP_Translation_Controller {
|
||||
* @param string $locale Optional. Locale. Default current locale.
|
||||
* @return bool True if there are any loaded translations, false otherwise.
|
||||
*/
|
||||
public function is_textdomain_loaded( string $textdomain = 'default', string $locale = null ): bool {
|
||||
public function is_textdomain_loaded( string $textdomain = 'default', ?string $locale = null ): bool {
|
||||
if ( null === $locale ) {
|
||||
$locale = $this->current_locale;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ final class WP_Translation_Controller {
|
||||
* @param string $locale Optional. Locale. Default current locale.
|
||||
* @return string|false Translation on success, false otherwise.
|
||||
*/
|
||||
public function translate( string $text, string $context = '', string $textdomain = 'default', string $locale = null ) {
|
||||
public function translate( string $text, string $context = '', string $textdomain = 'default', ?string $locale = null ) {
|
||||
if ( '' !== $context ) {
|
||||
$context .= "\4";
|
||||
}
|
||||
@@ -282,19 +282,19 @@ final class WP_Translation_Controller {
|
||||
*
|
||||
* @since 6.5.0
|
||||
*
|
||||
* @param array{0: string, 1: string} $plurals {
|
||||
* @param array $plurals {
|
||||
* Pair of singular and plural translations.
|
||||
*
|
||||
* @type string $0 Singular translation.
|
||||
* @type string $1 Plural translation.
|
||||
* }
|
||||
* @param int $number Number of items.
|
||||
* @param string $context Optional. Context for the string. Default empty string.
|
||||
* @param string $textdomain Optional. Text domain. Default 'default'.
|
||||
* @param string $locale Optional. Locale. Default current locale.
|
||||
* @param int $number Number of items.
|
||||
* @param string $context Optional. Context for the string. Default empty string.
|
||||
* @param string $textdomain Optional. Text domain. Default 'default'.
|
||||
* @param string|null $locale Optional. Locale. Default current locale.
|
||||
* @return string|false Translation on success, false otherwise.
|
||||
*/
|
||||
public function translate_plural( array $plurals, int $number, string $context = '', string $textdomain = 'default', string $locale = null ) {
|
||||
public function translate_plural( array $plurals, int $number, string $context = '', string $textdomain = 'default', ?string $locale = null ) {
|
||||
if ( '' !== $context ) {
|
||||
$context .= "\4";
|
||||
}
|
||||
@@ -394,7 +394,7 @@ final class WP_Translation_Controller {
|
||||
* @type string[] $entries Array of translation entries.
|
||||
* }
|
||||
*/
|
||||
protected function locate_translation( string $singular, string $textdomain = 'default', string $locale = null ) {
|
||||
protected function locate_translation( string $singular, string $textdomain = 'default', ?string $locale = null ) {
|
||||
if ( array() === $this->loaded_translations ) {
|
||||
return false;
|
||||
}
|
||||
@@ -427,7 +427,7 @@ final class WP_Translation_Controller {
|
||||
* @param string $locale Optional. Locale. Default current locale.
|
||||
* @return WP_Translation_File[] List of translation files.
|
||||
*/
|
||||
protected function get_files( string $textdomain = 'default', string $locale = null ): array {
|
||||
protected function get_files( string $textdomain = 'default', ?string $locale = null ): array {
|
||||
if ( null === $locale ) {
|
||||
$locale = $this->current_locale;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user