Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.98 KB | None | 0 0
  1. $html .= '<div class="srpw-meta">';
  2.  
  3.                                 if ( $args['date'] ) :
  4.                                     $date = get_the_date();
  5.                                     if ( $args['date_relative'] ) :
  6.                                         $date = sprintf( esc_html__( '%s ago', 'smart-recent-posts-widget' ), human_time_diff( get_the_date( 'U' ), current_time( 'timestamp' ) ) );
  7.                                     endif;
  8.                                     $html .= '<time class="srpw-time published" datetime="' . esc_html( get_the_date( 'c' ) ) . '">' . esc_html( $date ) . '</time>';
  9.                                 elseif ( $args['date_modified'] ) : // if both date functions are provided, we use date to be backwards compatible
  10.                                     $date = get_the_modified_date();
  11.                                     if ( $args['date_relative'] ) :
  12.                                         $date = sprintf( esc_html__( '%s ago', 'smart-recent-posts-widget' ), human_time_diff( get_the_modified_date( 'U' ), current_time( 'timestamp' ) ) );
  13.                                     endif;
  14.                                     $html .= '<time class="srpw-time modified" datetime="' . esc_html( get_the_modified_date( 'c' ) ) . '">' . esc_html( $date ) . '</time>';
  15.                                 endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement