[Resolved] Hide Time on Comment

Home Forums Support [Resolved] Hide Time on Comment

Home Forums Support Hide Time on Comment

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #756324
    Rizki

    Hi there,

    Default comment’s metadata is “December 14, 2018 at 05.00 PM”, then how to remove “at 05.00 PM” ?

    Thanks

    #756665
    David
    Staff
    Customer Support

    Hi there,

    go to Dashboard > Settings > General. Under Time Format select custom and leave the field blank.

    #756674
    Rizki

    I already try. When i do that, then metadata become “December 14, 2018 at”. How to remove “at” ?

    #756804
    Tom
    Lead Developer
    Lead Developer

    This function should do it:

    add_filter( 'gettext_with_context', function( $translated, $text, $context, $domain ) {
      if ( '1: date, 2: time' === $context ) {
    	$translated = get_comment_date();
      }
      
      return $translated;
    }, 20, 4 );
    #757038
    Rizki

    It works Tom, very thanks ๐Ÿ™‚

    #757054
    Tom
    Lead Developer
    Lead Developer

    You’re welcome ๐Ÿ™‚

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.