get( 'wp_tpg_is_home' ) ) {
$q->is_home = true;
}
}
public function register_sc_scripts() {
$settings = get_option( rtTPG()->options['settings'] );
$caro = $isSinglePopUp = false;
$ajaxurl = '';
if ( in_array( 'sitepress-multilingual-cms/sitepress.php', get_option( 'active_plugins' ) ) ) {
$ajaxurl .= admin_url( 'admin-ajax.php?lang=' . ICL_LANGUAGE_CODE );
} else {
$ajaxurl .= admin_url( 'admin-ajax.php' );
}
$variables = [
'nonceID' => esc_attr( rtTPG()->nonceId() ),
'nonce' => esc_attr( wp_create_nonce( rtTPG()->nonceText() ) ),
'ajaxurl' => esc_url( $ajaxurl ),
];
foreach ( $this->scA as $sc ) {
if ( isset( $sc ) && is_array( $sc ) ) {
if ( $sc['isSinglePopUp'] ) {
$isSinglePopUp = true;
}
if ( $sc['isWooCom'] ) {
$variables['woocommerce_enable_ajax_add_to_cart'] = get_option( 'woocommerce_enable_ajax_add_to_cart' );
$variables['woocommerce_cart_redirect_after_add'] = get_option( 'woocommerce_cart_redirect_after_add' );
}
}
}
if ( count( $this->scA ) ) {
wp_localize_script( 'rt-tpg', 'rttpg', $variables );
do_action( 'tpg_after_script', $isSinglePopUp );
}
if ( $isSinglePopUp && rtTPG()->hasPro() ) {
$html = null;
$html .= '
";
// widget heading.
$heading_tag = isset( $scMeta['tpg_heading_tag'][0] ) ? $scMeta['tpg_heading_tag'][0] : 'h2';
$heading_style = isset( $scMeta['tpg_heading_style'][0] ) && ! empty( $scMeta['tpg_heading_style'][0] ) ? $scMeta['tpg_heading_style'][0] : 'style1';
$heading_alignment = isset( $scMeta['tpg_heading_alignment'][0] ) ? $scMeta['tpg_heading_alignment'][0] : '';
$heading_link = isset( $scMeta['tpg_heading_link'][0] ) ? $scMeta['tpg_heading_link'][0] : '';
if ( ! empty( $arg['items'] ) && in_array( 'heading', $arg['items'] ) ) {
$html .= sprintf( '
';
}
if ( ! $isCarousel && isset( $settings['tpg_enable_preloader'] ) ) {
$html .= '
';
}
if ( ! empty( $filters ) && ( $isGrid || $isOffset || $isWooCom || $isEdd ) ) {
$html .= "
";
$selectedSubTermsForButton = null;
$allText = apply_filters( 'tpg_filter_all_text', esc_html__( 'All', 'the-post-grid' ), $scMeta );
if ( in_array( '_taxonomy_filter', $filters ) && $taxFilter ) {
$filterType = ( ! empty( $scMeta['tgp_filter_type'][0] ) ? $scMeta['tgp_filter_type'][0] : null );
$post_count = ( ! empty( $scMeta['tpg_post_count'][0] ) ? $scMeta['tpg_post_count'][0] : null );
$postCountClass = ( $post_count ? ' has-post-count' : null );
$allSelect = ' selected';
$isTermSelected = false;
if ( $action_term && $taxFilter ) {
$isTermSelected = true;
$allSelect = null;
}
if ( ! $filterType || $filterType == 'dropdown' ) {
$html .= "
";
$termDefaultText = $allText;
$dataTerm = 'all';
$htmlButton = '';
$selectedSubTerms = null;
$pCount = 0;
if ( ! empty( $terms ) ) {
$i = 0;
foreach ( $terms as $id => $term ) {
$pCount = $pCount + $term['count'];
$sT = null;
if ( $taxHierarchical ) {
$subTerms = Fns::rt_get_all_term_by_taxonomy( $taxFilter, true, $id );
if ( ! empty( $subTerms ) ) {
$count = 0;
$item = $allCount = null;
foreach ( $subTerms as $stId => $t ) {
$count = $count + absint( $t['count'] );
$sTPostCount = ( $post_count ? " (
{$t['count']})" : null );
$item .= "
{$t['name']}{$sTPostCount}";
}
if ( $post_count ) {
$allCount = " (
{$count})";
}
$sT .= "
";
$sT .= "
" . $allText . "{$allCount}
";
$sT .= '';
$sT .= $item;
$sT .= '';
$sT .= '
';
}
if ( $action_term === $id ) {
$selectedSubTerms = $sT;
}
}
$postCount = ( $post_count ? " (
{$term['count']})" : null );
if ( $action_term && $action_term == $id ) {
$termDefaultText = $term['name'] . $postCount;
$dataTerm = $id;
}
if ( is_array( $taxFilterTerms ) && ! empty( $taxFilterTerms ) ) {
if ( $taxFilterOperator == 'NOT IN' ) {
if ( ! in_array( $id, $taxFilterTerms ) && $action_term != $id ) {
$htmlButton .= "
{$term['name']}{$postCount}{$sT}";
}
} else {
if ( in_array( $id, $taxFilterTerms ) && $action_term != $id ) {
$htmlButton .= "
{$term['name']}{$postCount}{$sT}";
}
}
} else {
$htmlButton .= "
{$term['name']}{$postCount}{$sT}";
}
$i ++;
}
}
$pAllCount = null;
if ( $post_count ) {
$pAllCount = " (
{$pCount})";
if ( ! $action_term ) {
$termDefaultText = $termDefaultText . $pAllCount;
}
}
if ( ! $hide_all_button ) {
$htmlButton = "
" . $allText . "{$pAllCount}" . $htmlButton;
}
$htmlButton = sprintf( '
%s', $htmlButton );
$showAllhtml = '
' . $termDefaultText . '
';
$html .= $showAllhtml . $htmlButton;
$html .= '
' . $selectedSubTerms;
} else {
$termDefaultText = $allText;
$bCount = 0;
$bItems = null;
if ( ! empty( $terms ) ) {
foreach ( $terms as $id => $term ) {
$bCount = $bCount + absint( $term['count'] );
$sT = null;
if ( $taxHierarchical ) {
$subTerms = Fns::rt_get_all_term_by_taxonomy( $taxFilter, true, $id );
if ( ! empty( $subTerms ) ) {
$sT .= "
";
foreach ( $subTerms as $stId => $t ) {
$sTPostCount = ( $post_count ? " ({$t['count']})" : null );
$sT .= "{$t['name']}{$sTPostCount}";
}
$sT .= '
';
if ( $action_term === $id ) {
$selectedSubTermsForButton = $sT;
}
}
}
$postCount = ( $post_count ? " (
{$term['count']})" : null );
$termSelected = null;
if ( $isTermSelected && $id == $action_term ) {
$termSelected = ' selected';
}
if ( is_array( $taxFilterTerms ) && ! empty( $taxFilterTerms ) ) {
if ( $taxFilterOperator == 'NOT IN' ) {
if ( ! in_array( $id, $taxFilterTerms ) ) {
$bItems .= "
{$term['name']}{$postCount}{$sT}";
}
} else {
if ( in_array( $id, $taxFilterTerms ) ) {
$bItems .= "
{$term['name']}{$postCount}{$sT}";
}
}
} else {
$bItems .= "
{$term['name']}{$postCount}{$sT}";
}
}
}
$html .= "
";
if ( ! $hide_all_button ) {
$pCountH = ( $post_count ? " ({$bCount})" : null );
$html .= "" . $allText . "{$pCountH}";
}
$html .= $bItems;
$html .= '
';
}
}
// Author filter.
if ( in_array( '_author_filter', $filters ) ) {
$filterType = ( ! empty( $scMeta['tgp_filter_type'][0] ) ? $scMeta['tgp_filter_type'][0] : null );
$post_count = ( ! empty( $scMeta['tpg_post_count'][0] ) ? $scMeta['tpg_post_count'][0] : null );
$users = get_users( apply_filters( 'tpg_author_arg', [] ) );
$allSelect = ' selected';
$isTermSelected = false;
if ( $action_term && $taxFilter ) {
$isTermSelected = true;
$allSelect = null;
}
if ( ! $filterType || $filterType == 'dropdown' ) {
$html .= "
";
$termDefaultText = $allText;
$dataAuthor = 'all';
$htmlButton = '';
$htmlButton .= '';
if ( ! empty( $users ) ) {
foreach ( $users as $user ) {
if ( is_array( $filterAuthors ) && ! empty( $filterAuthors ) ) {
if ( in_array( $user->ID, $filterAuthors ) ) {
if ( $action_term == $user->ID ) {
$termDefaultText = $user->display_name;
$dataTerm = $user->ID;
} else {
$htmlButton .= "{$user->display_name}";
}
}
} else {
if ( $action_term == $user->ID ) {
$termDefaultText = $user->display_name;
$dataTerm = $user->ID;
} else {
$htmlButton .= "{$user->display_name}";
}
}
}
}
if ( $isTermSelected ) {
$htmlButton .= "" . $allText . "{$pAllCount}";
}
$htmlButton .= '';
$showAllhtml = '
' . $termDefaultText . '
';
$html .= $showAllhtml . $htmlButton;
$html .= '
';
} else {
$bCount = 0;
$bItems = null;
if ( ! empty( $users ) ) {
foreach ( $users as $user ) {
if ( is_array( $filterAuthors ) && ! empty( $filterAuthors ) ) {
if ( in_array( $user->ID, $filterAuthors ) ) {
$bItems .= "
ID}'>{$user->display_name}";
}
} else {
$bItems .= "
ID}'>{$user->display_name}";
}
}
}
$html .= "
";
if ( ! $hide_all_button ) {
$pCountH = ( $post_count ? " ({$bCount})" : null );
$html .= "" . $allText . "{$pCountH}";
}
$html .= $bItems;
$html .= '
';
}
}
if ( in_array( '_search', $filters ) ) {
$html .= '
';
$html .= sprintf( '', esc_html__( 'Search...', 'the-post-grid' ) );
$html .= "🔍";
$html .= "";
$html .= '
';
}
if ( in_array( '_order_by', $filters ) ) {
$wooFeature = ( $postType == 'product' ? true : false );
$orders = Options::rtPostOrderBy( $wooFeature );
$action_orderby = ( ! empty( $args['orderby'] ) ? trim( $args['orderby'] ) : 'none' );
if ( $action_orderby == 'ID' ) {
$action_orderby = 'title';
}
if ( $action_orderby == 'none' ) {
$action_orderby_label = esc_html__( 'Sort By None', 'the-post-grid' );
} else if ( in_array( $action_orderby, array_keys( Options::rtMetaKeyType() ) ) ) {
$action_orderby_label = esc_html__( 'Meta value', 'the-post-grid' );
} else {
$action_orderby_label = isset( $orders[ $action_orderby ] ) ? $orders[ $action_orderby ] : '';
}
if ( $action_orderby !== 'none' ) {
$orders['none'] = esc_html__( 'Sort By None', 'the-post-grid' );
}
$html .= '
';
$html .= "
{$action_orderby_label}
";
$html .= '';
foreach ( $orders as $orderKey => $order ) {
$html .= '' . $order . '';
}
$html .= '';
$html .= '
';
}
if ( in_array( '_sort_order', $filters ) ) {
$action_order = ( ! empty( $args['order'] ) ? strtoupper( trim( $args['order'] ) ) : 'DESC' );
$html .= '
';
$html .= " ";
$html .= '
';
}
$html .= "
$selectedSubTermsForButton
";
}
$is_gallery_layout = ' ';
if ( $layout === 'layout17' ) {
$is_gallery_layout = 'grid-layout7';
}
$html .= "
";
$not_found_text = isset( $scMeta['tgp_not_found_text'][0] ) && ! empty( $scMeta['tgp_not_found_text'][0] ) ? esc_html( $scMeta['tgp_not_found_text'][0] ) : esc_html__( 'No post found', 'the-post-grid' );
if ( $gridQuery->have_posts() ) {
$is_lazy_load = '';
if ( $isCarousel ) {
$cOpt = ! empty( $scMeta['carousel_property'] ) ? $scMeta['carousel_property'] : [];
$slider_js_options = apply_filters(
'rttpg_slider_js_options',
[
'speed' => ! empty( $scMeta['tpg_carousel_speed'][0] ) ? absint( $scMeta['tpg_carousel_speed'][0] ) : 250,
'autoPlayTimeOut' => ! empty( $scMeta['tpg_carousel_autoplay_timeout'][0] ) ? absint( $scMeta['tpg_carousel_autoplay_timeout'][0] ) : 5000,
'autoPlay' => in_array( 'auto_play', $cOpt ),
'stopOnHover' => in_array( 'stop_hover', $cOpt ),
'nav' => in_array( 'nav_button', $cOpt ),
'dots' => in_array( 'pagination', $cOpt ),
'loop' => in_array( 'loop', $cOpt ),
'lazy' => in_array( 'lazy_load', $cOpt ),
'autoHeight' => in_array( 'auto_height', $cOpt ),
'rtl' => in_array( 'rtl', $cOpt ) ? 'rtl' : 'ltr',
],
$scMeta
);
$html .= sprintf(
'
',
htmlspecialchars( wp_json_encode( $slider_js_options ) ),
$slider_js_options['rtl']
);
if ( in_array( 'lazy_load', $cOpt ) ) {
$is_lazy_load = 'swiper-lazy';
}
}
$isotope_filter = null;
if ( $isIsotope ) {
$isotope_filter = isset( $scMeta['isotope_filter'][0] ) ? $scMeta['isotope_filter'][0] : null;
$isotope_dropdown_filter = isset( $scMeta['isotope_filter_dropdown'][0] ) ? $scMeta['isotope_filter_dropdown'][0] : null;
$selectedTerms = [];
if ( isset( $scMeta['post_filter'] )
&& in_array(
'tpg_taxonomy',
$scMeta['post_filter']
)
&& isset( $scMeta['tpg_taxonomy'] )
&& in_array(
$isotope_filter,
$scMeta['tpg_taxonomy']
)
) {
$selectedTerms = ( isset( $scMeta[ 'term_' . $isotope_filter ] ) ? $scMeta[ 'term_' . $isotope_filter ] : [] );
}
$termArgs = [
'taxonomy' => $isotope_filter,
'orderby' => 'meta_value_num',
'order' => 'ASC',
'hide_empty' => false,
'include' => $selectedTerms,
];
if ( rtTPG()->hasPro() ) {
$termArgs['meta_key'] = '_rt_order';
}
$terms = get_terms( $termArgs );
$html .= '
';
$htmlButton = $drop = null;
$fSelectTrigger = false;
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
foreach ( $terms as $term ) {
$tItem = ! empty( $scMeta['isotope_default_filter'][0] ) ? $scMeta['isotope_default_filter'][0] : null;
$fSelected = null;
if ( $tItem == $term->term_id ) {
$fSelected = 'selected';
$fSelectTrigger = true;
}
$htmlButton .= sprintf(
'
',
esc_attr( $term->slug ),
$fSelected ? ' ' . $fSelected : '',
$term->term_id,
$term->name
);
$drop .= "
";
}
}
if ( ! empty( $scMeta['isotope_filter_show_all'][0] ) ) {
$is_select_iso_term = ! empty( $scMeta['isotope_default_filter'][0] ) ? '' : 'selected';
$fSelect = ( $fSelectTrigger ? null : 'class="selected"' );
$htmlButton = "
' . $htmlButton;
$drop = "
" . $drop;
}
$filter_count = ! empty( $scMeta['isotope_filter_count'][0] ) ? true : false;
$filter_url = ! empty( $scMeta['isotope_filter_url'][0] ) ? true : false;
$htmlButton = "
{$htmlButton}
";
if ( $isotope_dropdown_filter ) {
$html .= "
";
} else {
$html .= $htmlButton;
}
if ( ! empty( $scMeta['isotope_search_filter'][0] ) ) {
$html .= "
";
}
$html .= '
';
$html .= "
";
}
$l = $offLoop = 0;
$offsetBigHtml = $offsetSmallHtml = null;
$gridPostCount = 0;
$arg['totalPost'] = $gridQuery->post_count;
while ( $gridQuery->have_posts() ) :
$gridQuery->the_post();
if ( $colStore == $l ) {
if ( $this->l4toggle ) {
$this->l4toggle = false;
} else {
$this->l4toggle = true;
}
$l = 0;
}
$pID = get_the_ID();
$external_link = get_post_meta($pID, 'tpg_read_more', true);
$arg['postCount'] = $gridPostCount ++;
$arg['pID'] = $pID;
$arg['title'] = Fns::get_the_title( $pID, $arg );
$arg['pLink'] = $external_link['url'] ?? get_permalink();
$arg['toggle'] = $this->l4toggle;
$arg['layoutID'] = $layoutID;
$arg['author'] = apply_filters(
'rttpg_author_link',
sprintf( '
%s', get_author_posts_url( get_the_author_meta( 'ID' ) ), get_the_author() )
);
$comments_number = get_comments_number( $pID );
$comments_text = sprintf( '(%s)', number_format_i18n( $comments_number ) );
$arg['date'] = get_the_date();
$arg['excerpt'] = Fns::get_the_excerpt( $pID, $arg );
$arg['categories'] = Fns::rt_get_the_term_list( $pID, 'category', null, '
,' );
$arg['tags'] = get_the_term_list( $pID, 'post_tag', null, '
,' );
$arg['post_count'] = get_post_meta( $pID, Fns::get_post_view_count_meta_key(), true );
$arg['responsiveCol'] = [ $dCol, $tCol, $mCol ];
if ( $isIsotope ) {
$termAs = wp_get_post_terms( $pID, $isotope_filter, [ 'fields' => 'all' ] );
$isoFilter = [];
if ( ! empty( $termAs ) ) {
foreach ( $termAs as $term ) {
$isoFilter[] = 'iso_' . $term->term_id;
$isoFilter[] = 'rt-item-' . esc_attr( $term->slug );
}
}
$arg['isoFilter'] = ! empty( $isoFilter ) ? implode( ' ', $isoFilter ) : '';
}
if ( comments_open() ) {
$arg['comment'] = "
{$comments_text} ";
} else {
$arg['comment'] = "{$comments_text}";
}
$imgSrc = null;
// TODO: Image Thumbnail.
$arg['smallImgSrc'] = ! $fImg ? Fns::getFeatureImageSrc(
$pID,
$fSmallImgSize,
$mediaSource,
$defaultImgId,
$customSmallImgSize,
$is_lazy_load
) : null;
if ( $isOffset ) {
if ( $offLoop == 0 ) {
$arg['imgSrc'] = ! $fImg ? Fns::getFeatureImageSrc(
$pID,
$fImgSize,
$mediaSource,
$defaultImgId,
$customImgSize
) : null;
$arg['offset'] = 'big';
$offsetBigHtml = Fns::get_template_html( 'layouts/' . $layout, $arg );
} else {
$arg['offset'] = 'small';
$arg['offsetCol'] = [ $dCol, $tCol, $mCol ];
$arg['imgSrc'] = ! $fImg ? Fns::getFeatureImageSrc(
$pID,
'thumbnail',
$mediaSource,
$defaultImgId,
$customImgSize
) : null;
$offsetSmallHtml .= Fns::get_template_html( 'layouts/' . $layout, $arg );
}
} else {
$arg['imgSrc'] = ! $fImg ? Fns::getFeatureImageSrc(
$pID,
$fImgSize,
$mediaSource,
$defaultImgId,
$customImgSize,
$is_lazy_load
) : null;
$html .= Fns::get_template_html( 'layouts/' . $layout, $arg );
}
$offLoop ++;
$l ++;
endwhile;
if ( $isOffset ) {
$oDCol = Fns::get_offset_col( $dCol );
$oTCol = Fns::get_offset_col( $tCol );
$oMCol = Fns::get_offset_col( $mCol );
if ( $layout == 'offset03' || $layout == 'offset04' ) {
$oDCol['big'] = $oTCol['big'] = $oDCol['small'] = $oTCol['small'] = 6;
$oMCol['big'] = $oMCol['small'] = 12;
} else if ( $layout == 'offset06' ) {
$oDCol['big'] = 7;
$oDCol['small'] = 5;
}
$html .= "
";
$html .= "
";
}
if ( $isIsotope || $isCarousel ) {
$html .= '
'; // End isotope / Carousel item holder.
if ( $isIsotope ) {
$html .= '
';
}
if ( $isCarousel ) {
$html .= '
';
if ( in_array( 'pagination', $cOpt ) ) {
$html .= '';
}
if ( in_array( 'nav_button', $cOpt ) ) {
$html .= '
';
}
}
}
} else {
$html .= sprintf(
'
%s
',
apply_filters( 'tpg_not_found_text', $not_found_text, $args, $scMeta )
);
}
$html .= $preLoaderHtml;
$html .= '
'; // End row.
$htmlUtility = null;
if ( $pagination && ! $isCarousel ) {
if ( $isOffset || $isGridHover ) {
$posts_loading_type = 'page_prev_next';
$htmlUtility .= "
";
} else {
$hide = ( $gridQuery->max_num_pages < 2 ? ' rt-hidden-elm' : null );
if ( $posts_loading_type == 'pagination' ) {
if ( ( $isGrid || $isWooCom || $isEdd ) && empty( $filters ) ) {
$htmlUtility .= Fns::rt_pagination(
$gridQuery,
$args['posts_per_page']
);
}
} else if ( $posts_loading_type == 'pagination_ajax' && ! $isIsotope ) {
$htmlUtility .= "
";
} else if ( $posts_loading_type == 'load_more' && rtTPG()->hasPro() ) {
$load_more_btn_text = ( ! empty( $scMeta['load_more_text'][0] ) ? $scMeta['load_more_text'][0] : '' );
$load_more_text = $load_more_btn_text ? esc_html( $load_more_btn_text ) : esc_html__( 'Load More', 'the-post-grid' );
$htmlUtility .= "
";
} else if ( $posts_loading_type == 'load_on_scroll' && rtTPG()->hasPro() ) {
$htmlUtility .= "
";
}
}
}
if ( $htmlUtility ) {
$l4toggle = null;
if ( $layout == 'layout4' ) {
$l4toggle = "data-l4toggle='{$this->l4toggle}'";
}
$html .= "';
}
$html .= '
'; // container rt-tpg.
wp_reset_postdata();
$scriptGenerator = [];
$scriptGenerator['layout'] = $layoutID;
$scriptGenerator['rand'] = $rand;
$scriptGenerator['scMeta'] = $scMeta;
$scriptGenerator['isCarousel'] = $isCarousel;
$scriptGenerator['isSinglePopUp'] = $isSinglePopUp;
$scriptGenerator['isWooCom'] = $isWooCom;
$this->scA[] = $scriptGenerator;
add_action( 'wp_footer', [ $this, 'register_sc_scripts' ] );
// Script Load Conditionally
$script = [];
$style = [];
array_push( $script, 'jquery' );
array_push( $style, 'rt-fontawsome' );
array_push( $style, 'rt-flaticon' );
if ( 'masonry' == $gridType || $isIsotope ) {
array_push( $script, 'rt-isotope-js' );
}
array_push( $script, 'imagesloaded' );
array_push( $script, 'rt-tpg' );
// Pro Scripts and Styles.
if ( rtTPG()->hasPro() ) {
if ( isset( $posts_loading_type ) && 'pagination_ajax' == $posts_loading_type ) {
array_push( $script, 'rt-pagination' );
}
if ( $layout == 'layout17' || 'popup' == $linkType ) {
array_push( $style, 'rt-magnific-popup' );
array_push( $script, 'rt-magnific-popup' );
}
if ( 'popup' == $linkType ) {
array_push( $script, 'rt-scrollbar' );
}
if ( class_exists( 'WooCommerce' ) ) {
array_push( $script, 'rt-jzoom' );
}
}
array_push( $style, 'rt-tpg-shortcode' );
if ( ( $isCarousel && rtTPG()->hasPro() ) || $isWooCom ) {
array_push( $style, 'swiper' );
array_push( $script, 'swiper' );
}
if ( rtTPG()->hasPro() ) {
array_push( $script, 'rt-tpg-pro' );
}
if ( isset( $settings['tpg_load_script'] ) ) {
wp_enqueue_style( $style );
}
wp_enqueue_script( $script );
} else {
$html .= '
' . esc_html__( 'No shortCode found', 'the-post-grid' ) . '
';
}
// restriction issue.
$restriction = ( ! empty( $scMeta['restriction_user_role'] ) ? $scMeta['restriction_user_role'] : [] );
if ( ! empty( $restriction ) ) {
if ( is_user_logged_in() ) {
$currentUserRoles = Fns::getCurrentUserRoles();
if ( in_array( 'administrator', $currentUserRoles ) ) {
$html = $html;
} else {
if ( count( array_intersect( $restriction, $currentUserRoles ) ) ) {
$html = $html;
} else {
$html = '
' . esc_html__(
'You are not permitted to view this content.',
'the-post-grid'
) . '
';
}
}
} else {
$html = '
' . esc_html__( 'This is a restricted content, you need to logged in to view this content.', 'the-post-grid' ) . '
';
}
}
return $html;
}
}