Support » Plugin: Last Modified Timestamp » Reformatting WordPress Admin Table Time

  • Resolved rwfelty


    I am attempting to reformat the time in WordPress admin tables and using this code snippet. What am I doing wrong?

    function my_lmt_defaults( $d ) {
        $d['contexts']['messages']['timef'] = 'm/j/Y \a\t g:ia';
        return $d;
Viewing 1 replies (of 1 total)
  • Plugin Author Evan Mattson


    The timestamp is broken into 3 components: date format (datef), time format (timef), and the separator (sep).

    Here it looks like you’re trying to override the whole format with a new date string but you’re only changing the time format. By default, it displays %date% %sep% %time%

    Your filter works but you would want to change it to modify each component like so:

    $d['contexts']['messages']['datef'] = 'm/j/Y';
    $d['contexts']['messages']['timef'] = 'g:ia';
    $d['contexts']['messages']['sep'] = 'at';

Viewing 1 replies (of 1 total)
  • The topic ‘Reformatting WordPress Admin Table Time’ is closed to new replies.