I am trying to create a simple wordpress plugin and I have to invoke $wp_locale->get_month($month) function, but it returns a fatal error
function test()
{
global $wp_locale;
echo $wp_locale->get_month($month);
}
Error –> Fatal error: Call to a member function get_month() on a
non-object in…..
.
The global is simply not available yet when you’re trying to call it.
This works:
Create a new instance of the object: