Changeset 55279 for trunk/src/wp-includes/class-wp-locale.php
- Timestamp:
- 02/07/2023 05:26:14 PM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-locale.php
r55047 r55279 112 112 */ 113 113 public $list_item_separator; 114 115 /** 116 * The word count type of the locale language. 117 * 118 * Default is 'words'. 119 * 120 * @since 6.2.0 121 * @var string 122 */ 123 public $word_count_type; 114 124 115 125 /** … … 237 247 $this->text_direction = 'rtl'; 238 248 } 249 250 // Set the word count type. 251 $this->word_count_type = $this->get_word_count_type(); 239 252 } 240 253 … … 397 410 return $this->list_item_separator; 398 411 } 412 413 /** 414 * Retrieves the localized word count type. 415 * 416 * Options are 'characters_excluding_spaces', 'characters_including_spaces or 'words'. Defaults to 'words'. 417 * 418 * @since 6.2.0 419 * 420 * @return string Localized word count type. 421 */ 422 public function get_word_count_type() { 423 424 /* 425 * translators: If your word count is based on single characters (e.g. East Asian characters), 426 * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'. 427 * Do not translate into your own language. 428 */ 429 $word_count_type = is_null( $this->word_count_type ) ? _x( 'words', 'Word count type. Do not translate!' ) : $this->word_count_type; 430 431 // Check for valid types. 432 if ( 'characters_excluding_spaces' !== $word_count_type && 'characters_including_spaces' !== $word_count_type ) { 433 // Defaults to 'words'. 434 $word_count_type = 'words'; 435 } 436 437 return $word_count_type; 438 } 399 439 }
Note: See TracChangeset
for help on using the changeset viewer.