• Resolved jeremiasz

    (@jeremiasz)


    Hello,

    I would like the date of publication to be in real time. Currently, when he wants to publish a movie from 2016, the post appears somewhere in the archive instead of “added a moment ago”. Can you set it somewhere?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey there –

    You can modify the date (and title, content, author, type, etc) prior to posting with the tube_vc_filter_post_pre_insert filter.

    Code below isn’t tested but should work in a functions file or plugin…

    add_filter( 'tube_vc_filter_post_pre_insert', 'my_tube_vc_filter_post_pre_insert' );
    
    function my_tube_vc_filter_post_pre_insert( $my_post ){
    
      $my_post['post_date_gmt'] = date( 'Y-m-d H:i:s', time() );
    
      return $my_post;
    
    }

    Drop if a reply if that doesn’t work for you. Otherwise, please mark as resolved.

    TL

    P.S. May turn this into a setting on a future update.

    Thread Starter jeremiasz

    (@jeremiasz)

    Thank you. The code is correct.

    Great to hear.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Publication date of the post’ is closed to new replies.