ID );
$image_size = ! empty( $images_settings['size'] ) ? $images_settings['size'] : 'large';
$image_data = aiovg_get_image( $post->ID, $image_size, 'post', true );
$image = $image_data['src'];
$image_alt = ! empty( $image_data['alt'] ) ? $image_data['alt'] : $post->post_title;
$has_access = aiovg_current_user_can( 'play_aiovg_video', $post->ID );
$has_trailer = false;
if ( ! $has_access && ! empty( $trailer_settings['enable_trailers'] ) ) {
$trailer_src = get_post_meta( $post->ID, 'trailer_src', true );
$has_trailer = ! empty( $trailer_src );
}
?>
',
esc_url( get_permalink() ),
esc_attr( $attributes['ratio'] )
);
// Image
echo sprintf(
'

',
esc_url( $image ),
esc_attr( $image_alt ),
( ! empty( $general_settings['lazyloading'] ) ? ' loading="lazy"' : '' )
);
// Duration
if ( $attributes['show_duration'] && ! empty( $post_meta['duration'][0] ) ) {
echo sprintf(
'
%s
',
esc_html( $post_meta['duration'][0] )
);
}
// Play Icon
if ( $has_access || $has_trailer ) {
echo '
';
} else {
echo '
';
}
// After Thumbnail Image
the_aiovg_content_after_thumbnail_image( $attributes );
echo '';
?>
';
$filtered_title .= wp_kses_post( aiovg_truncate( get_the_title(), $attributes['title_length'] ) );
$filtered_title .= '';
$filtered_title = apply_filters( 'aiovg_the_title', $filtered_title, $post->ID );
echo $filtered_title;
?>
%s ',
esc_attr( implode( '; ', $styles ) ),
esc_html( $trailer_settings['trailer_label_text'] )
);
} else {
$restrictions_settings = aiovg_get_option( 'aiovg_restrictions_settings' );
if ( ! empty( $restrictions_settings['show_restricted_label'] ) && ! empty( $restrictions_settings['restricted_label_text'] ) ) {
$styles = array();
if ( $restricted_label_bg_color = $restrictions_settings['restricted_label_bg_color'] ) {
$styles[] = sprintf( 'background-color: %s', $restricted_label_bg_color );
}
if ( $restricted_label_text_color = $restrictions_settings['restricted_label_text_color'] ) {
$styles[] = sprintf( 'color: %s', $restricted_label_text_color );
}
printf(
'
%s
',
esc_attr( implode( '; ', $styles ) ),
esc_html( $restrictions_settings['restricted_label_text'] )
);
}
}
}
?>
';
$author_url = aiovg_get_user_videos_page_url( $post->post_author );
$meta['user'] = sprintf(
'%s
%s',
$icon,
esc_url( $author_url ),
esc_html( get_the_author() )
);
}
// Date
if ( $attributes['show_date'] ) {
$icon = '
';
$meta['date'] = sprintf(
'%s
',
$icon,
esc_html( aiovg_get_the_date() )
);
}
// Views
if ( $attributes['show_views'] ) {
$icon = '
';
$meta['views'] = sprintf(
'%s
%s%s',
$icon,
( isset( $post_meta['views'] ) ? esc_html( aiovg_format_count( $post_meta['views'][0] ) ) : 0 ),
esc_html__( 'views', 'all-in-one-video-gallery' )
);
}
// Likes
if ( $attributes['show_likes'] ) {
$icon = '
';
$meta['likes'] = sprintf(
'%s
%s%s',
$icon,
( isset( $post_meta['likes'] ) ? esc_html( aiovg_format_count( $post_meta['likes'][0] ) ) : 0 ),
esc_html__( 'likes', 'all-in-one-video-gallery' )
);
}
// Dislikes
if ( $attributes['show_dislikes'] ) {
$icon = '
';
$meta['dislikes'] = sprintf(
'%s
%s%s',
$icon,
( isset( $post_meta['dislikes'] ) ? esc_html( aiovg_format_count( $post_meta['dislikes'][0] ) ) : 0 ),
esc_html__( 'dislikes', 'all-in-one-video-gallery' )
);
}
// Comments
if ( $attributes['show_comments'] && comments_open() ) {
$icon = '
';
$meta['comments'] = sprintf(
'%s',
$icon,
esc_html( aiovg_format_count( get_comments_number( $post->ID ) ) ),
esc_html__( 'comments', 'all-in-one-video-gallery' )
);
}
// ...
if ( count( $meta ) ) {
echo '
';
$last_index = count( $meta ) - 1;
$i = 0;
foreach ( $meta as $meta_class => $meta_content ) {
echo '
';
echo $meta_content;
if ( $i < $last_index ) {
echo '•';
}
echo '
';
$i++;
}
echo '
';
}
?>
sanitize_text_field( $attributes['categories_orderby'] ),
'order' => sanitize_text_field( $attributes['categories_order'] )
));
if ( ! empty( $categories ) ) {
$meta = array();
foreach ( $categories as $category ) {
$category_url = aiovg_get_category_page_url( $category );
$meta[] = sprintf(
'
%s',
esc_url( $category_url ),
esc_html( $category->name )
);
}
echo '
';
echo '
';
echo '
' . implode( ',
', $meta ) . '
';
echo '
';
}
}
?>
sanitize_text_field( $attributes['categories_orderby'] ),
'order' => sanitize_text_field( $attributes['categories_order'] )
));
if ( ! empty( $tags ) ) {
$meta = array();
foreach ( $tags as $tag ) {
$tag_url = aiovg_get_tag_page_url( $tag );
$meta[] = sprintf(
'
%s',
esc_url( $tag_url ),
esc_html( $tag->name )
);
}
echo '
';
echo '
';
echo '
' . implode( ',
', $meta ) . '
';
echo '
';
}
}
?>