Metabox date month number to word

I use custom metabox with date (day, month and year). The problem is when I try to transform date number to date word – for example 10 to be October. I use this code:

function eventposttype_get_the_month_abbr($month) {
global $wp_locale;
for ( $i = 1; $i < 13; $i = $i +1 ) {
            if ( $i == $month )
                $monthabbr = $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) );
            }
return $monthabbr;
}

But now the month is displayed only with three symbols – Oct. I like to be full month name. Is there any way to define it?

Read More

Thank you in advance!

Related posts

Leave a Reply

1 comment

  1. The code you are using is specifically for the month abbreviation, (Oct). You should be using this:

    function eventposttype_get_the_month($month) {
    global $wp_locale;
    for ( $i = 1; $i < 13; $i = $i +1 ) {
                if ( $i == $month )
                    $month =$wp_locale->get_month( $i ) ;
                }
    return $monthabbr;
    }