Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $html .= '<div class="srpw-meta">';
- if ( $args['date'] ) :
- $date = get_the_date();
- if ( $args['date_relative'] ) :
- $date = sprintf( esc_html__( '%s ago', 'smart-recent-posts-widget' ), human_time_diff( get_the_date( 'U' ), current_time( 'timestamp' ) ) );
- endif;
- $html .= '<time class="srpw-time published" datetime="' . esc_html( get_the_date( 'c' ) ) . '">' . esc_html( $date ) . '</time>';
- elseif ( $args['date_modified'] ) : // if both date functions are provided, we use date to be backwards compatible
- $date = get_the_modified_date();
- if ( $args['date_relative'] ) :
- $date = sprintf( esc_html__( '%s ago', 'smart-recent-posts-widget' ), human_time_diff( get_the_modified_date( 'U' ), current_time( 'timestamp' ) ) );
- endif;
- $html .= '<time class="srpw-time modified" datetime="' . esc_html( get_the_modified_date( 'c' ) ) . '">' . esc_html( $date ) . '</time>';
- endif;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement