[wp-trac] [WordPress Trac] #58658: WP_Locale add get_month_genitive() method

WordPress Trac noreply at wordpress.org
Wed Jun 28 14:07:50 UTC 2023


#58658: WP_Locale add get_month_genitive() method
-------------------------+-----------------------------
 Reporter:  Tkama        |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  6.2.2
 Severity:  minor        |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 The `WP_Locale` class has `get_month()` and `get_month_abbrev()` methods,
 but does not have `get_month_genitive()`. It should be there as well.

 We should add such a code:
 {{{

         /**
          * Retrieves the full translated month in genitive case by month
 number.
          *
          * @since 6.2.3
          *
          * @param string|int $month_number  From 1 to 12. If a number less
 than 10 is
          *                                  passed in integer or string
 format, a '0' will be added before it.
          *
          * @return string Translated full month name in genitive case.
          */
         public function get_month_genitive( $month_number ) {
                 return $this->month_genitive[ zeroise( $month_number, 2 )
 ];
         }

 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58658>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list