Support » Plugin: Contact Form 7 » _time to include seconds

  • Resolved kender

    (@kender)


    Looking to include the seconds to the [_time] shortcode, is there a way we can do this via hook or filter?

    Or, how would I go about adding my own?

Viewing 1 replies (of 1 total)
  • Resolved, I looked at your existing shortcode and modified slightly in my functions file

    for anyone looking to do this (create custom special mail tag)

    function jwbs_special_mail_tag( $output, $name, $html ) {
      $submission = WPCF7_Submission::get_instance();
      if ( ! $submission ) { return $output; }
    
      if ( '_time_secs' == $name ) {
        if ( $timestamp = $submission->get_meta( 'timestamp' ) ) {
          return date_i18n( 'g:i:s a', $timestamp );
        }
        return '';
      }
      return $output;
    }
    add_filter( 'wpcf7_special_mail_tags', 'jwbs_special_mail_tag', 10, 3 );
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.