max_num_pages;
$localize['pagination'] = $blog_pagination;
$localize['infinite_scroll_event'] = $blog_infinite_scroll_event;
$localize['no_more_post_message'] = apply_filters( 'astra_blog_no_more_post_text', __( 'No more posts to show.', 'astra-addon' ) );
$localize['grid_layout'] = $grid_layout;
$localize['site_url'] = get_site_url();
$localize['blogArchiveTitleLayout'] = astra_get_option( 'ast-dynamic-archive-post-layout' );
$localize['blogArchiveTitleOn'] = astra_get_option( 'ast-dynamic-archive-post-banner-on-blog' );
$localize['show_comments'] = __( 'Show Comments', 'astra-addon' );
// If woocommerce page template.
if ( function_exists( 'is_woocommerce' ) && is_woocommerce() ) {
$localize['masonryEnabled'] = false;
} else {
$localize['masonryEnabled'] = $blog_masonry;
$localize['blogMasonryBreakPoint'] = absint( apply_filters( 'astra_blog_masonry_break_point', 0 ) );
}
return $localize;
}
/**
* Astra Blog Pagination
*
* @since 1.0
* @param html $output Pagination markup.
* @return html
*/
public function astra_blog_pagination( $output ) {
global $wp_query;
$pagination = astra_get_option( 'blog-pagination' );
$infinite_event = astra_get_option( 'blog-infinite-scroll-event' );
$load_more_text = astra_get_option( 'blog-load-more-text' );
if ( '' === $load_more_text ) {
$load_more_text = __( 'Load More', 'astra-addon' );
}
if ( 'infinite' == $pagination ) {
ob_start();
?>
$post_link,
),
'https://www.facebook.com/sharer.php'
);
break;
case 'twitter':
case 'twitter-x':
$link = add_query_arg(
array(
'url' => $post_link,
'text' => rawurlencode( html_entity_decode( wp_strip_all_tags( $post_title ), ENT_COMPAT, 'UTF-8' ) ),
'hashtags' => $post_categories,
),
'http://twitter.com/share'
);
break;
case 'email':
$link = add_query_arg(
array(
'subject' => wp_strip_all_tags( $email_title ),
'body' => $post_link,
),
'mailto:'
);
break;
case 'pinterest':
$link = 'https://pinterest.com/pin/create/bookmarklet/?media=' . get_the_post_thumbnail_url() . '&url=' . $post_link . '&description=' . $post_title;
break;
case 'linkedin':
$link = 'https://www.linkedin.com/shareArticle?mini=true&url=' . $post_link . '&title=' . urlencode( $post_title ) . '&source=' . urlencode( get_bloginfo( 'name' ) ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
break;
case 'tumblr':
$link = 'http://www.tumblr.com/share/link?url=' . $post_link . '&title=' . $post_title;
break;
case 'reddit':
$link = 'https://reddit.com/submit?url=' . $post_link . '&title=' . $post_title;
break;
case 'whatsapp':
$link = 'https://wa.me/?text=' . $post_link;
break;
case 'sms':
$link = 'sms://?&body=' . $post_title . ' - ' . $post_link;
break;
case 'vk':
$link = 'http://vk.com/share.php?url=' . urlencode( $post_link ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.urlencode_urlencode
break;
case 'telegram':
// The `Post_link` variable has already been encoded above.
$link = 'https://t.me/share/url?url=' . $post_link . '&text=' . rawurlencode( $post_title );
break;
}
$aria_label = $item['label'] ? $item['label'] : $item['id'];
$is_phone_or_email = 'phone' === $item['id'] || 'email' === $item['id'];
$add_target = $is_phone_or_email ? '' : '_blank';
$add_rel = $is_phone_or_email ? '' : apply_filters( 'astra_social_rel_attribute', 'noopener noreferrer' );
?>
true,
);
} else {
$term_args = array(
'hide_empty' => true,
);
}
}
if ( is_tag() || ( is_home() && 'tags' === $blog_filter_by ) ) {
$taxonomy_name = 'post_tag';
if ( isset( $tag_include ) ) {
$term_args = array(
'hide_empty' => true,
);
} else {
$term_args = array(
'hide_empty' => true,
);
}
}
$terms = get_terms( $taxonomy_name, $term_args ); // Get all terms of a taxonomy.
if ( $terms && ! is_wp_error( $terms ) ) {
if ( is_category() && 'tags' === $blog_filter_by ) {
return false;
}
if ( is_tag() && 'categories' === $blog_filter_by ) {
return false;
}
if ( is_category() && in_array( get_queried_object_id(), $category_include_array ) ) {
return false;
}
if ( is_tag() && in_array( get_queried_object_id(), $tag_include_array ) ) {
return false;
}
ob_start();
?>