Archives

Add More Date/Time Format Options

Tell me what you think

If you find that you need to offer some non-standard date or time formats to the general settings page, this will help.

add_filter('date_formats', 'add_date_format');
function add_date_format($original) {
        $more = array('D, M jS, Y');
        return array_merge($original, $more);
                        
}

add_filter('time_formats', 'add_time_format');
function add_time_format($original) {
        $more = array('H:i:s a');
        return array_merge($original, $more);
                        
}
0
0

Created by Gabriele Cirulli. Based on 1024 by Veewo Studio and conceptually similar to Threes by Asher Vollmer.