Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End WordPress Human Time Diff

  • This topic is empty.
Viewing 10 posts - 16 through 25 (of 25 total)
  • Author
    Posts
  • #165867
    Alen
    Participant

    All of the post types extend the class I mentioned above so I’m not sure you can “make a custom column and use the_time()”, unless you extend it and add functionality…

    #165869
    Alen
    Participant

    Just to clarify, you’re talking about this:

    #165870
    gilgimech
    Participant

    Sure you can. You can output any kind of content you want.

    Theoretically you could make a column that outputs your latest tweets.

    #165871
    gilgimech
    Participant

    Yes, but with the latest version of WordPress.

    #165872
    Andy Howells
    Participant

    AHhhhhhhh. Inside the admin area – thank you for the screenshot Alen, I was proper confused about the problem.

    I’ll have a think and a play see if I can come up with a solution.

    #165875
    gilgimech
    Participant

    I got it.

    Using the post_date_column_time filter.

    add_filter( 'post_date_column_time', 'customize_date_column', 10, 4 );
    function customize_date_column( $t_time, $post, $column_name, $mode ) {
        $t_time = the_time('F j, Y');
        return  $t_time;
    }
    
    #165878
    Alen
    Participant

    I was researching for legit 30min to find that filer… Good find.

    Also, you could shorten the code little, you don;t need to pass all those arguments…

    so something like this would work:

    add_filter( 'post_date_column_time', 'customize_date_column', 10, 1 );
    function customize_date_column( $t_time ) {
        return $t_time = the_time('F j, Y');
    }
    
    #165879
    gilgimech
    Participant

    Yeah, I’m still playing with it.

    I might have to write up a blog post about this one.

    #165881
    Alen
    Participant

    You def should. WP needs better documentation.

    #165893
    gilgimech
    Participant

    No worries,
    I’ve just always seen them called the admin tables. I thought that was the norm.

Viewing 10 posts - 16 through 25 (of 25 total)
  • The forum ‘Back End’ is closed to new topics and replies.