%2$s';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
$time_string = '';
}
$time_string = sprintf( $time_string,
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_attr( get_the_modified_date( 'c' ) ),
esc_html( get_the_modified_date() )
);
$posted_on = sprintf(
esc_html_x( 'Posted on %s', 'post date', 'dxstore-lite' ),
'' . $time_string . ''
);
$byline = sprintf(
esc_html_x( 'by %s', 'post author', 'dxstore-lite' ),
'' . esc_html( get_the_author() ) . ''
);
echo '' . $posted_on . ' ' . $byline . ''; // WPCS: XSS OK.
if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
echo '';
}
}
endif;
if ( ! function_exists( 'dxstore_lite_entry_footer' ) ) :
function dxstore_lite_entry_footer() {
if ( 'post' === get_post_type() ) {
$categories_list = get_the_category_list( esc_html__( ', ', 'dxstore-lite' ) );
if ( $categories_list && dxstore_lite_categorized_blog() ) {
printf( '' . esc_html__( 'Posted in %1$s', 'dxstore-lite' ) . '', $categories_list ); // WPCS: XSS OK.
}
$tags_list = get_the_tag_list( '', esc_html__( ', ', 'dxstore-lite' ) );
if ( $tags_list ) {
printf( '' . esc_html__( 'Tagged %1$s', 'dxstore-lite' ) . '', $tags_list ); // WPCS: XSS OK.
}
}
edit_post_link(
sprintf(
esc_html__( 'Edit %s', 'dxstore-lite' ),
the_title( '"', '"', false )
),
'',
''
);
}
endif;
function dxstore_lite_categorized_blog() {
if ( false === ( $all_the_cool_cats = get_transient( 'dxstore_lite_categories' ) ) ) {
$all_the_cool_cats = get_categories( array(
'fields' => 'ids',
'hide_empty' => 1,
'number' => 2,
) );
$all_the_cool_cats = count( $all_the_cool_cats );
set_transient( 'dxstore_lite_categories', $all_the_cool_cats );
}
if ( $all_the_cool_cats > 1 ) {
return true;
} else {
return false;
}
}
function dxstore_lite_category_transient_flusher() {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
delete_transient( 'dxstore_lite_categories' );
}
add_action( 'edit_category', 'dxstore_lite_category_transient_flusher' );
add_action( 'save_post', 'dxstore_lite_category_transient_flusher' );