first commit

This commit is contained in:
User A0264400
2026-04-01 23:20:16 +03:00
commit a766acdc90
23071 changed files with 4933189 additions and 0 deletions

View File

@@ -0,0 +1,404 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Duplex_P6_T1' ) ) {
/**
* Gutentor_Duplex_P6_T1 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Duplex_P6_T1 extends Gutentor_Query_Elements {
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Run Block
*
* @access public
* @since 2.0.0
* @return void
*/
public function run() {
add_filter( 'gutentor_post_module_p6_query_data', array( $this, 'template_data' ), 999, 4 );
}
/**
* Get Featured Single item data
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function p6_template1_featured_woo_single_article( $post, $attributes, $index ) {
$output = '';
if ( ! gutentor_is_woocommerce_active() ) {
return $output;
}
$product = wc_get_product( $post->ID );
$rating = $product->get_average_rating();
$count = $product->get_rating_count();
$rating_html = wc_get_rating_html( $rating, $count );
$query_sorting = array_key_exists( 'blockFPSortableItems', $attributes ) ? $attributes['blockFPSortableItems'] : false;
$enable_featured_image = ( isset( $attributes['pOnFPFImg'] ) ) ? $attributes['pOnFPFImg'] : false;
$enable_avatar = ( isset( $attributes['pFPOnAvatar'] ) ) ? $attributes['pFPOnAvatar'] : false;
$avatar_pos = ( isset( $attributes['pFPAvatarPos'] ) ) ? $attributes['pFPAvatarPos'] : false;
$enable_post_format = ( isset( $attributes['pOnFPPostFormatOpt'] ) ) ? $attributes['pOnFPPostFormatOpt'] : false;
$post_format_pos = ( isset( $attributes['pFPPostFormatPos'] ) ) ? $attributes['pFPPostFormatPos'] : false;
$cat_pos = ( isset( $attributes['pFPCatPos'] ) ) ? $attributes['pFPCatPos'] : false;
$enable_featured_cat = ( isset( $attributes['pOnFPFeaturedCat'] ) ) ? $attributes['pOnFPFeaturedCat'] : false;
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_post_module_article_class', gutentor_concat_space( 'gutentor-post', 'gutentor-post-featured', 'gutentor-post-item-' . $index ), $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_p6_featured_post_post_item', 'gutentor-post-featured-item', $attributes ) ) . "'>";
if ( $enable_featured_image ) {
$enable_overlayImage = false;
$overlayImage = ( isset( $attributes['pFPFImgOColor'] ) ) ? $attributes['pFPFImgOColor'] : false;
if ( $overlayImage ) {
$enable_overlayImage = ( isset( $attributes['pFPFImgOColor']['enable'] ) ) ? $attributes['pFPFImgOColor']['enable'] : false;
}
$url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $attributes['pFPFImgSize'] );
$default_url = WC()->plugin_url() . '/assets/images/placeholder.png';
$overlay = $enable_overlayImage ? 'gutentor-overlay' : '';
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_p6_featured_post_post_item_height', gutentor_concat_space( 'gutentor-post-featured-height', 'gutentor-bg-image', $overlay ), $attributes ) ) . "' style='background-image:url(" . esc_url( is_array( $url ) && ! empty( $url ) ? $url[0] : $default_url ) . ")'>";
if ( $enable_avatar && $this->avatar_fp_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_fp_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->featured_post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->p6_fp_new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $this->featured_post_categories_on_image_condition( $cat_pos ) ) {
$output .= $this->p6_fp_get_woo_badge( $post, $product, $attributes );
}
$output .= apply_filters( 'gutentor_p6_featured_image_popup_data', '', $post, $attributes );
$output .= '<div class="gutentor-post-content">';
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
if ( $cat_pos === 'gutentor-fp-cat-pos-before-title' || $post_format_pos === 'gutentor-fp-pf-pos-before-title' ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-title' ) {
$output .= $this->p6_fp_new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-fp-cat-pos-before-title' ) {
$output .= $this->p6_fp_get_woo_badge( $post, $product, $attributes );
}
$output .= $this->get_featured_post_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_title( $post, $attributes );
}
break;
case 'primary-entry-meta':
$output .= $this->get_featured_post_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_featured_post_secondary_meta( $post, $attributes );
break;
case 'price':
$output .= $this->p6_featured_wc_price( $post, $product, $attributes );
break;
case 'rating':
if ( isset( $attributes['fpWooOnRating'] ) && $attributes['fpWooOnRating'] ) {
if ( $rating_html ) {
$output .= '<div class="gutentor-fp-wc-rating">';
$output .= $rating_html;
$output .= '</div>';
}
}
break;
case 'avatar':
$output .= $this->get_fp_avatar_data( $post, $attributes );
break;
case 'description':
if ( $cat_pos === 'gutentor-fp-cat-pos-before-ct-box' || $post_format_pos === 'gutentor-fp-pf-pos-before-ct-box' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-ct-box' ) {
$output .= $this->p6_fp_new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-fp-cat-pos-before-ct-box' ) {
$output .= $this->p6_fp_get_woo_badge( $post, $product, $attributes );
}
$output .= $this->get_featured_post_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_description( $post, $attributes );
}
break;
case 'button':
if ( $cat_pos === 'gutentor-fp-cat-pos-before-button' || $post_format_pos === 'gutentor-fp-pf-pos-before-button' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-button' ) {
$output .= $this->p6_fp_new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-fp-cat-pos-before-button' ) {
$output .= $this->p6_fp_get_woo_badge( $post, $product, $attributes );
}
if ( isset( $attributes['pOnFPBtn'] ) && $attributes['pOnFPBtn'] ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_product_button_class', 'gutentor-woo-add-to-cart wc-block-grid__product-add-to-cart', $post, $attributes ) ) . "'>";
ob_start();
woocommerce_template_loop_add_to_cart(
array(
'gutentor-attributes' => $attributes,
'gutentor-btn-type' => 'featured',
)
);
$output .= ob_get_clean();
$output .= '</div>';
}
$output .= '</div>';
} elseif ( isset( $attributes['pOnFPBtn'] ) && $attributes['pOnFPBtn'] ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_product_button_class', 'gutentor-woo-add-to-cart wc-block-grid__product-add-to-cart', $post, $attributes ) ) . "'>";
ob_start();
woocommerce_template_loop_add_to_cart(
array(
'gutentor-attributes' => $attributes,
'gutentor-btn-type' => 'featured',
)
);
$output .= ob_get_clean();
$output .= '</div>';
}
break;
default:
$output .= '';
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-post-content*/
$output .= '</div>';/*.gutentor-bg-image*/
}
$output .= '</div>';/*.gutentor-post-featured-item*/
$output .= '</article>';/*.article*/
return $output;
}
/**
* Get EDD Featured Single item data
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function p6_template1_featured_edd_single_article( $post, $attributes, $index ) {
if ( ! gutentor_is_edd_active() ) {
return '';
}
$download = edd_get_download( $post->ID );
$output = '';
$query_sorting = array_key_exists( 'blockFPSortableItems', $attributes ) ? $attributes['blockFPSortableItems'] : false;
$enable_featured_image = ( isset( $attributes['pOnFPFImg'] ) ) ? $attributes['pOnFPFImg'] : false;
$enable_avatar = ( isset( $attributes['pFPOnAvatar'] ) ) ? $attributes['pFPOnAvatar'] : false;
$avatar_pos = ( isset( $attributes['pFPAvatarPos'] ) ) ? $attributes['pFPAvatarPos'] : false;
$enable_post_format = ( isset( $attributes['pOnFPPostFormatOpt'] ) ) ? $attributes['pOnFPPostFormatOpt'] : false;
$post_format_pos = ( isset( $attributes['pFPPostFormatPos'] ) ) ? $attributes['pFPPostFormatPos'] : false;
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_post_module_article_class', gutentor_concat_space( 'gutentor-post', 'gutentor-post-featured', 'gutentor-post-item-' . $index ), $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_p6_featured_post_post_item', 'gutentor-post-featured-item', $attributes ) ) . "'>";
if ( $enable_featured_image ) {
$enable_overlayImage = false;
$overlayImage = ( isset( $attributes['pFPFImgOColor'] ) ) ? $attributes['pFPFImgOColor'] : false;
if ( $overlayImage ) {
$enable_overlayImage = ( isset( $attributes['pFPFImgOColor']['enable'] ) ) ? $attributes['pFPFImgOColor']['enable'] : false;
}
$url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $attributes['pFPFImgSize'] );
$default_url = GUTENTOR_URL . 'assets/img/default-image.jpg';
$overlay = $enable_overlayImage ? 'gutentor-overlay' : '';
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_p6_featured_post_post_item_height', gutentor_concat_space( 'gutentor-post-featured-height', 'gutentor-bg-image', $overlay ), $attributes ) ) . "' style='background-image:url(" . esc_url( is_array( $url ) && ! empty( $url ) ? $url[0] : $default_url ) . ")'>";
if ( $enable_avatar && $this->avatar_fp_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_fp_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->featured_post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->p6_fp_edd_new_badge_product( $post, $download );
}
$output .= apply_filters( 'gutentor_p6_featured_image_popup_data', '', $post, $attributes );
$output .= '<div class="gutentor-post-content">';
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
if ( $post_format_pos === 'gutentor-fp-pf-pos-before-title' ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-title' ) {
$output .= $this->p6_fp_edd_new_badge_product( $post, $download );
}
$output .= $this->get_featured_post_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_title( $post, $attributes );
}
break;
case 'primary-entry-meta':
$output .= $this->get_featured_post_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_featured_post_secondary_meta( $post, $attributes );
break;
case 'price':
$output .= $this->p6_featured_edd_price( $post, $attributes );
break;
case 'rating':
if ( isset( $attributes['fpWooOnRating'] ) && $attributes['fpWooOnRating'] ) {
$review = gutentor_custom_edd_review( $post->ID );
if ( $review ) {
$output .= '<div class="gutentor-fp-edd-rating">';
$output .= $review;
$output .= '</div>';
}
}
break;
case 'avatar':
$output .= $this->get_fp_avatar_data( $post, $attributes );
break;
case 'description':
if ( $post_format_pos === 'gutentor-fp-pf-pos-before-ct-box' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-ct-box' ) {
$output .= $this->p6_fp_edd_new_badge_product( $post, $download );
}
$output .= $this->get_featured_post_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_description( $post, $attributes );
}
break;
case 'wishlist':
$output .= $this->get_fp_edd_wish_list( $post, $attributes );
break;
case 'button':
if ( $post_format_pos === 'gutentor-fp-pf-pos-before-button' ) {
$output .= '<div class="gutentor-post-button-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-button' ) {
$output .= $this->p6_fp_edd_new_badge_product( $post, $download );
}
$output .= $this->p6_get_fp_edd_button( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->p6_get_fp_edd_button( $post, $attributes );
}
break;
default:
$output .= '';
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-post-content*/
$output .= '</div>';/*.gutentor-bg-image*/
}
$output .= '</div>';/*.gutentor-post-featured-item*/
$output .= '</article>';/*.article*/
return $output;
}
/**
* Content On Image Template 1
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @param {array} $content
* @return {mix}
*/
public function template_data( $output, $the_query, $attributes, $content ) {
$template = $attributes['p6Temp'] ? $attributes['p6Temp'] : '';
$post_number = $attributes['postsToShow'] ? $attributes['postsToShow'] : '';
$post_type = ( isset( $attributes['pPostType'] ) ) ? $attributes['pPostType'] : 'post';
if ( $template !== 'gutentor_p6_template1' ) {
return $output;
}
$index = 0;
$post_categories = array();
while ( $the_query->have_posts() ) :
$the_query->the_post();
$post_categories = array_merge( $post_categories, wp_get_post_categories( get_the_ID() ) );
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p6_grid_column_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
if ( $post_type === 'product' ) {
$output .= $this->p6_template1_featured_woo_single_article( get_post(), $attributes, $index );
} elseif ( $post_type === 'download' ) {
$output .= $this->p6_template1_featured_edd_single_article( get_post(), $attributes, $index );
} else {
$output .= $this->p6_featured_single_article( get_post(), $attributes, $index );
}
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_column_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index > 0 && $index < $post_number ) {
if ( $post_type === 'product' ) {
$output .= $this->p6_woo_single_article( get_post(), $attributes, $index );
} elseif ( $post_type === 'download' ) {
$output .= $this->p6_edd_single_article( get_post(), $attributes, $index );
} else {
$output .= $this->p6_single_article( get_post(), $attributes, $index );
}
}
if ( $index + 1 === $post_number ) {
$output .= '</div>';
}
++$index;
endwhile;
if ( $post_categories && $content === 'ajax' ) {
$cat_style = gutentor_pm_post_dynamic_categories_color( array_unique( $post_categories ) );
if ( $cat_style ) {
$output .= '<style>' . wp_strip_all_tags( $cat_style ) . '</style>';
}
}
return $output;
}
}
}
Gutentor_Duplex_P6_T1::get_instance()->run();

View File

@@ -0,0 +1,504 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Duplex_P6_T2' ) ) {
/**
* Gutentor_Duplex_P6_T2 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Duplex_P6_T2 extends Gutentor_Query_Elements {
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @return object
* @since 2.0.0
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Run Block
*
* @access public
* @return void
* @since 2.0.0
*/
public function run() {
add_filter( 'gutentor_post_module_p6_query_data', array( $this, 'template_data' ), 999, 4 );
}
/**
* Get Featured Single item data
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function p6_template2_featured_single_article( $post, $attributes, $index ) {
$output = '';
$enable_avatar = isset( $attributes['pFPOnAvatar'] ) && $attributes['pFPOnAvatar'];
$avatar_pos = isset( $attributes['pFPAvatarPos'] ) ? $attributes['pFPAvatarPos'] : false;
$query_sorting = array_key_exists( 'blockFPSortableItems', $attributes ) ? $attributes['blockFPSortableItems'] : false;
$enable_featured_image = isset( $attributes['pOnFPFImg'] ) && $attributes['pOnFPFImg'];
$enable_post_format = isset( $attributes['pOnFPPostFormatOpt'] ) && $attributes['pOnFPPostFormatOpt'];
$post_format_pos = isset( $attributes['pFPPostFormatPos'] ) ? $attributes['pFPPostFormatPos'] : false;
$cat_pos = ( isset( $attributes['pFPCatPos'] ) ) ? $attributes['pFPCatPos'] : false;
$enable_featured_cat = isset( $attributes['pOnFPFeaturedCat'] ) && $attributes['pOnFPFeaturedCat'];
$thumb_class = ( has_post_thumbnail() && $enable_featured_image ) ? '' : 'gutentor-post-no-thumb';
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_post_module_article_class', gutentor_concat_space( 'gutentor-post', 'gutentor-post-featured', $thumb_class, 'gutentor-post-item-' . $index ), $attributes ) ) . "'>";
$output .= '<div class="gutentor-post-featured-item">';
if ( $enable_featured_image && gutentor_has_post_featured( $post ) ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_p6_fp_post_module_post_image_box', 'gutentor-post-image-box', $post, $attributes ) ) . "'>";
$output .= $this->get_featured_post_featured_image( $post, $attributes );
if ( $enable_avatar && $this->avatar_fp_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_fp_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->featured_post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->get_featured_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $this->featured_post_categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_featured_post_module_badges_collection( $post, $attributes );
}
$output .= '</div>';
}
$output .= '<div class="gutentor-post-content">';
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
if ( $cat_pos === 'gutentor-fp-cat-pos-before-title' || $post_format_pos === 'gutentor-fp-pf-pos-before-title' ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-title' ) {
$output .= $this->get_featured_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-fp-cat-pos-before-title' ) {
$output .= $this->get_featured_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_featured_post_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_title( $post, $attributes );
}
break;
case 'primary-entry-meta':
$output .= $this->get_featured_post_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_featured_post_secondary_meta( $post, $attributes );
break;
case 'avatar':
$output .= $this->get_fp_avatar_data( $post, $attributes );
break;
case 'description':
if ( $cat_pos === 'gutentor-fp-cat-pos-before-ct-box' || $post_format_pos === 'gutentor-fp-pf-pos-before-ct-box' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-ct-box' ) {
$output .= $this->get_featured_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-fp-cat-pos-before-ct-box' ) {
$output .= $this->get_featured_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_featured_post_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_description( $post, $attributes );
}
break;
case 'button':
if ( $cat_pos === 'gutentor-fp-cat-pos-before-button' || $post_format_pos === 'gutentor-fp-pf-pos-before-button' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-button' ) {
$output .= $this->get_featured_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-fp-cat-pos-before-button' ) {
$output .= $this->get_featured_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_featured_post_button( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_button( $post, $attributes );
}
break;
default:
$output .= '';
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-post-content*/
$output .= '</div>';/*.gutentor-post-featured-item*/
$output .= '</article>';/*.article*/
return $output;
}
/**
* Get Featured Woo Single item data
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function p6_template2_fp_woo_single_article( $post, $attributes, $index ) {
$output = '';
if ( ! gutentor_is_woocommerce_active() ) {
return $output;
}
$product = wc_get_product( $post->ID );
$rating = $product->get_average_rating();
$count = $product->get_rating_count();
$rating_html = wc_get_rating_html( $rating, $count );
$enable_avatar = isset( $attributes['pFPOnAvatar'] ) && $attributes['pFPOnAvatar'];
$avatar_pos = ( isset( $attributes['pFPAvatarPos'] ) ) ? $attributes['pFPAvatarPos'] : false;
$query_sorting = array_key_exists( 'blockFPSortableItems', $attributes ) ? $attributes['blockFPSortableItems'] : false;
$enable_featured_image = isset( $attributes['pOnFPFImg'] ) && $attributes['pOnFPFImg'];
$enable_post_format = isset( $attributes['pOnFPPostFormatOpt'] ) && $attributes['pOnFPPostFormatOpt'];
$post_format_pos = ( isset( $attributes['pFPPostFormatPos'] ) ) ? $attributes['pFPPostFormatPos'] : false;
$cat_pos = ( isset( $attributes['pFPCatPos'] ) ) ? $attributes['pFPCatPos'] : false;
$enable_featured_cat = isset( $attributes['pOnFPFeaturedCat'] ) && $attributes['pOnFPFeaturedCat'];
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_post_module_article_class', gutentor_concat_space( 'gutentor-post', 'gutentor-post-featured', 'gutentor-post-item-' . $index ), $attributes ) ) . "'>";
$output .= '<div class="gutentor-post-featured-item">';
if ( $enable_featured_image ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_p6_fp_post_module_post_image_box', 'gutentor-post-image-box', $post, $attributes ) ) . "'>";
$output .= $this->p6_fp_get_woo_product_thumbnail( $post, $product, $attributes );
if ( $enable_avatar && $this->avatar_fp_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_fp_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->featured_post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->p6_fp_new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $this->featured_post_categories_on_image_condition( $cat_pos ) ) {
$output .= $this->p6_fp_get_woo_badge( $post, $product, $attributes );
}
$output .= '</div>';
}
$output .= '<div class="gutentor-post-content">';
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
if ( $cat_pos === 'gutentor-fp-cat-pos-before-title' || $post_format_pos === 'gutentor-fp-pf-pos-before-title' ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-title' ) {
$output .= $this->p6_fp_new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-fp-cat-pos-before-title' ) {
$output .= $this->p6_fp_get_woo_badge( $post, $product, $attributes );
}
$output .= $this->get_featured_post_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_title( $post, $attributes );
}
break;
case 'primary-entry-meta':
$output .= $this->get_featured_post_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_featured_post_secondary_meta( $post, $attributes );
break;
case 'price':
$output .= $this->p6_featured_wc_price( $post, $product, $attributes );
break;
case 'rating':
if ( isset( $attributes['fpWooOnRating'] ) && $attributes['fpWooOnRating'] ) {
if ( $rating_html ) {
$output .= '<div class="gutentor-fp-wc-rating">';
$output .= $rating_html;
$output .= '</div>';
}
}
break;
case 'avatar':
$output .= $this->get_fp_avatar_data( $post, $attributes );
break;
case 'description':
if ( $cat_pos === 'gutentor-fp-cat-pos-before-ct-box' || $post_format_pos === 'gutentor-fp-pf-pos-before-ct-box' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-ct-box' ) {
$output .= $this->p6_fp_new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-fp-cat-pos-before-ct-box' ) {
$output .= $this->p6_fp_get_woo_badge( $post, $product, $attributes );
}
$output .= $this->get_featured_post_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_description( $post, $attributes );
}
break;
case 'button':
if ( $cat_pos === 'gutentor-fp-cat-pos-before-button' || $post_format_pos === 'gutentor-fp-pf-pos-before-button' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-button' ) {
$output .= $this->p6_fp_new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-fp-cat-pos-before-button' ) {
$output .= $this->p6_fp_get_woo_badge( $post, $product, $attributes );
}
if ( isset( $attributes['pOnFPBtn'] ) && $attributes['pOnFPBtn'] ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_product_button_class', 'gutentor-woo-add-to-cart wc-block-grid__product-add-to-cart', $post, $attributes ) ) . "'>";
ob_start();
woocommerce_template_loop_add_to_cart(
array(
'gutentor-attributes' => $attributes,
'gutentor-btn-type' => 'featured',
)
);
$output .= ob_get_clean();
$output .= '</div>';
}
$output .= '</div>';
} elseif ( isset( $attributes['pOnFPBtn'] ) && $attributes['pOnFPBtn'] ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_product_button_class', 'gutentor-woo-add-to-cart wc-block-grid__product-add-to-cart', $post, $attributes ) ) . "'>";
ob_start();
woocommerce_template_loop_add_to_cart(
array(
'gutentor-attributes' => $attributes,
'gutentor-btn-type' => 'featured',
)
);
$output .= ob_get_clean();
$output .= '</div>';
}
break;
default:
$output .= '';
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-post-content*/
$output .= '</div>';/*.gutentor-post-featured-item*/
$output .= '</article>';/*.article*/
return $output;
}
/**
* Get Featured Edd Single item data
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function p6_template2_fp_edd_single_article( $post, $attributes, $index ) {
if ( ! gutentor_is_edd_active() ) {
return '';
}
$download = edd_get_download( $post->ID );
$output = '';
$enable_avatar = isset( $attributes['pFPOnAvatar'] ) && $attributes['pFPOnAvatar'];
$avatar_pos = ( isset( $attributes['pFPAvatarPos'] ) ) ? $attributes['pFPAvatarPos'] : false;
$query_sorting = array_key_exists( 'blockFPSortableItems', $attributes ) ? $attributes['blockFPSortableItems'] : false;
$enable_featured_image = isset( $attributes['pOnFPFImg'] ) && $attributes['pOnFPFImg'];
$enable_post_format = isset( $attributes['pOnFPPostFormatOpt'] ) && $attributes['pOnFPPostFormatOpt'];
$post_format_pos = ( isset( $attributes['pFPPostFormatPos'] ) ) ? $attributes['pFPPostFormatPos'] : false;
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_post_module_article_class', gutentor_concat_space( 'gutentor-post', 'gutentor-post-featured', 'gutentor-post-item-' . $index ), $attributes ) ) . "'>";
$output .= '<div class="gutentor-post-featured-item">';
if ( $enable_featured_image ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_p6_fp_post_module_post_image_box', 'gutentor-post-image-box', $post, $attributes ) ) . "'>";
$output .= $this->p6_fp_get_edd_thumbnail( $post, $attributes );
if ( $enable_avatar && $this->avatar_fp_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_fp_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->featured_post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->p6_fp_edd_new_badge_product( $post, $download );
}
$output .= '</div>';
}
$output .= '<div class="gutentor-post-content">';
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
if ( $post_format_pos === 'gutentor-fp-pf-pos-before-title' ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-title' ) {
$output .= $this->p6_fp_edd_new_badge_product( $post, $download );
}
$output .= $this->get_featured_post_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_title( $post, $attributes );
}
break;
case 'primary-entry-meta':
$output .= $this->get_featured_post_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_featured_post_secondary_meta( $post, $attributes );
break;
case 'price':
$output .= $this->p6_featured_edd_price( $post, $attributes );
break;
case 'rating':
if ( isset( $attributes['fpWooOnRating'] ) && $attributes['fpWooOnRating'] ) {
if ( gutentor_custom_edd_review( $post->ID ) ) {
$output .= '<div class="gutentor-fp-edd-rating">';
$output .= gutentor_custom_edd_review( $post->ID );
$output .= '</div>';
}
}
break;
case 'avatar':
$output .= $this->get_fp_avatar_data( $post, $attributes );
break;
case 'description':
if ( $post_format_pos === 'gutentor-fp-pf-pos-before-ct-box' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-ct-box' ) {
$output .= $this->p6_fp_edd_new_badge_product( $post, $download );
}
$output .= $this->get_featured_post_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_featured_post_description( $post, $attributes );
}
break;
case 'wishlist':
$output .= $this->get_fp_edd_wish_list( $post, $attributes );
break;
case 'button':
if ( $post_format_pos === 'gutentor-fp-pf-pos-before-button' ) {
$output .= '<div class="gutentor-post-button-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-fp-pf-pos-before-button' ) {
$output .= $this->p6_fp_edd_new_badge_product( $post, $download );
}
$output .= $this->p6_get_fp_edd_button( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->p6_get_fp_edd_button( $post, $attributes );
}
break;
default:
$output .= '';
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-post-content*/
$output .= '</div>';/*.gutentor-post-featured-item*/
$output .= '</article>';/*.article*/
return $output;
}
/**
* Content On Image Template 1
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @param {array} $content
* @return {mix}
*/
public function template_data( $output, $the_query, $attributes, $content ) {
$template = $attributes['p6Temp'] ? $attributes['p6Temp'] : '';
$post_number = $attributes['postsToShow'] ? $attributes['postsToShow'] : '';
$post_type = ( isset( $attributes['pPostType'] ) ) ? $attributes['pPostType'] : 'post';
if ( $template !== 'gutentor_p6_template2' ) {
return $output;
}
$index = 0;
$post_categories = array();
while ( $the_query->have_posts() ) :
$the_query->the_post();
$post_categories = array_merge( $post_categories, wp_get_post_categories( get_the_ID() ) );
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p6_grid_column_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
if ( $post_type === 'product' ) {
$output .= $this->p6_template2_fp_woo_single_article( get_post(), $attributes, $index );
} elseif ( $post_type === 'download' ) {
$output .= $this->p6_template2_fp_edd_single_article( get_post(), $attributes, $index );
} else {
$output .= $this->p6_template2_featured_single_article( get_post(), $attributes, $index );
}
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_column_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index > 0 && $index < $post_number ) {
if ( $post_type === 'product' ) {
$output .= $this->p6_woo_single_article( get_post(), $attributes, $index );
} elseif ( $post_type === 'download' ) {
$output .= $this->p6_edd_single_article( get_post(), $attributes, $index );
} else {
$output .= $this->p6_single_article( get_post(), $attributes, $index );
}
}
if ( $index + 1 === $post_number ) {
$output .= '</div>';
}
++$index;
endwhile;
if ( $post_categories && $content === 'ajax' ) {
$cat_style = gutentor_pm_post_dynamic_categories_color( array_unique( $post_categories ) );
if ( $cat_style ) {
$output .= '<style>' . wp_strip_all_tags( $cat_style ) . '</style>';
}
}
return $output;
}
}
}
Gutentor_Duplex_P6_T2::get_instance()->run();

View File

@@ -0,0 +1,560 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured' ) ) {
/**
* Gutentor_Featured Class For Gutentor
*
* @package Gutentor
* @since 2.0.5
*/
class Gutentor_Featured extends Gutentor_Query_Elements {
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Run Block
*
* @access public
* @since 2.0.0
* @return void
*/
public function run() {
add_filter( 'gutentor_post_module_p2_query_data', array( $this, 'post_template' ), 999, 3 );
add_filter( 'gutentor_term_module_t2_query_data', array( $this, 'term_template' ), 999, 3 );
}
/**
* Load Dependencies
* Used for blog template loading
*
* @since 1.0.1
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function load_dependencies() {
/*Load file once*/
static $loaded = false;
if ( ! $loaded ) {
$loaded = true;
/*Template 1*/
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-1/t-1.php';
/*Template 2*/
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-2/t-1.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-2/t-2.php';
/*Template 3*/
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-3/t-1.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-3/t-2.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-3/t-3.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-3/t-4.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-3/t-5.php';
/*Template 4*/
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-4/t-1.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-4/t-2.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-4/t-3.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-4/t-4.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-4/t-5.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-4/t-6.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-4/t-7.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-4/t-8.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-4/t-9.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-4/t-10.php';
/*Template 5*/
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-1.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-2.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-3.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-4.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-5.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-6.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-7.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-8.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-9.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-10.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-11.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-5/t-12.php';
/*Template 6*/
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-6/t-1.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-6/t-2.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-6/t-3.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-6/t-4.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-6/t-5.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-6/t-6.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-6/t-7.php';
require_once GUTENTOR_PATH . 'includes/block-templates/featured/n-6/t-8.php';
}
}
/**
* Check if P2
*
* @param {array} output
*
* @return {boolean}
*/
public function isP2( $attributes ) {
$block_name = ( isset( $attributes['gName'] ) ) ? $attributes['gName'] : '';
if ( 'gutentor/p2' !== $block_name ) {
return false;
}
$template = ( isset( $attributes['p2Temp'] ) ) ? $attributes['p2Temp'] : '';
if ( $this->template !== $template ) {
return false;
}
$number = ( isset( $attributes['postsToShow'] ) ) ? $attributes['postsToShow'] : '';
if ( $this->number !== $number ) {
return false;
}
return true;
}
/**
* Check if T2
*
* @param {array} output
*
* @return {boolean}
*/
public function isT2( $attributes ) {
$block_name = ( isset( $attributes['gName'] ) ) ? $attributes['gName'] : '';
if ( 'gutentor/t2' !== $block_name ) {
return false;
}
$template = ( isset( $attributes['t2Temp'] ) ) ? $attributes['t2Temp'] : '';
if ( $this->template !== $template ) {
return false;
}
$number = ( isset( $attributes['t2Number'] ) ) ? $attributes['t2Number'] : '';
if ( $this->number !== $number ) {
return false;
}
return true;
}
/**
* Get Single block
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function p2_single_article( $post, $attributes, $index ) {
$output = '';
$enable_post_format = isset( $attributes['pOnPostFormatOpt'] ) && $attributes['pOnPostFormatOpt'];
$post_format_pos = ( isset( $attributes['pPostFormatPos'] ) ) ? $attributes['pPostFormatPos'] : false;
$cat_pos = ( isset( $attributes['pPostCatPos'] ) ) ? $attributes['pPostCatPos'] : false;
$enable_featured_cat = isset( $attributes['pOnFeaturedCat'] ) && $attributes['pOnFeaturedCat'];
$enable_avatar = isset( $attributes['pOnAvatar'] ) && $attributes['pOnAvatar'];
$avatar_pos = ( isset( $attributes['pAvatarPos'] ) ) ? $attributes['pAvatarPos'] : false;
$thumb_class = has_post_thumbnail() ? '' : 'gutentor-post-no-thumb gtf-no-thumb';
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_post_module_article_class', gutentor_concat_space( 'gutentor-post gtf-item-wrap', $thumb_class, 'gutentor-post-item-' . $index, 'gtf-item-' . $index ), $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_item', gutentor_concat_space( 'gutentor-post-item', 'gtf-item' ), $attributes ) ) . "'>";
if ( has_post_thumbnail( $post->ID ) ) {
$enable_overlayImage = false;
$overlayImage = ( isset( $attributes['pFImgOColor'] ) ) ? $attributes['pFImgOColor'] : false;
if ( $overlayImage ) {
$enable_overlayImage = ( isset( $attributes['pFImgOColor']['enable'] ) ) ? $attributes['pFImgOColor']['enable'] : false;
}
$url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $attributes['pFImgSize'] );
$background = '';
if ( isset( $url[0] ) ) {
$background = 'style="background-image:url(' . esc_url( $url[0] ) . ')"';
}
$overlay = $enable_overlayImage ? 'gutentor-overlay g-overlay' : '';/*gutentor-overlay for bc*/
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_item_height', gutentor_concat_space( 'gutentor-bg-image gtf-bg-image', 'gutentor-post-height gtf-item-height', $overlay ), $attributes ) ) . "' " . $background . '>';
if ( $enable_avatar && $this->avatar_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $this->categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= apply_filters( 'gutentor_edit_post_module_featured_image_popup_data', '', $post, $attributes );
$output .= '<div class="gutentor-post-content gtf-content">';/*gutentor-post-content for bc*/
$output .= $this->get_primary_meta( $post, $attributes );
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-title' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-title' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_title( $post, $attributes );
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-content' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-ct-box' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_description( $post, $attributes );
$output .= $this->get_secondary_meta( $post, $attributes );
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-button' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-button' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_button( $post, $attributes );
$output .= '</div>';/*.gtf-content*/
$output .= apply_filters( 'gutentor_post_type_featured_after_content', '', $post, $attributes );
$output .= '</div>';/*.gtf-bg-image*/
} else {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_item_height', gutentor_concat_space( 'gutentor-post-height', 'gtf-item-height' ), $attributes ) ) . "'>";
if ( $enable_avatar && $this->avatar_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $this->categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= apply_filters( 'gutentor_edit_post_module_featured_image_popup_data', '', $post, $attributes );
$output .= '<div class="gutentor-post-content gtf-content">';/*gutentor-post-content for bc*/
$output .= $this->get_primary_meta( $post, $attributes );
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-title' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-title' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_title( $post, $attributes );
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-content' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-ct-box' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_description( $post, $attributes );
$output .= $this->get_secondary_meta( $post, $attributes );
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-button' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-button' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_button( $post, $attributes );
$output .= '</div>';/*.gtf-content*/
$output .= apply_filters( 'gutentor_post_type_featured_after_content', '', $post, $attributes );
$output .= '</div>';/*.gtf-item-height*/
}
$output .= '</div>';/*.gutentor-post-item*/
$output .= '</article>';/*.article*/
return $output;
}
/**
* Get Woo Single block
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function p2_woo_single_article( $post, $attributes, $index ) {
$output = '';
if ( ! gutentor_is_woocommerce_active() ) {
return $output;
}
$product = wc_get_product( $post->ID );
$rating = $product->get_average_rating();
$count = $product->get_rating_count();
$rating_html = wc_get_rating_html( $rating, $count );
$enable_post_format = isset( $attributes['pOnPostFormatOpt'] ) && $attributes['pOnPostFormatOpt'];
$post_format_pos = ( isset( $attributes['pPostFormatPos'] ) ) ? $attributes['pPostFormatPos'] : false;
$cat_pos = ( isset( $attributes['pPostCatPos'] ) ) ? $attributes['pPostCatPos'] : false;
$enable_featured_cat = isset( $attributes['pOnFeaturedCat'] ) && $attributes['pOnFeaturedCat'];
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_post_module_article_class', gutentor_concat_space( 'gutentor-post gtf-item-wrap', 'gutentor-post-item-' . $index, 'gtf-item-' . $index ), $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_item', gutentor_concat_space( 'gutentor-post-item', 'gtf-item' ), $attributes ) ) . "'>";
$enable_overlayImage = false;
$overlayImage = isset( $attributes['pFImgOColor'] ) && $attributes['pFImgOColor'];
if ( $overlayImage ) {
$enable_overlayImage = ( isset( $attributes['pFImgOColor']['enable'] ) ) ? $attributes['pFImgOColor']['enable'] : false;
}
$url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $attributes['pFImgSize'] );
$default_url = WC()->plugin_url() . '/assets/images/placeholder.png';
$overlay = $enable_overlayImage ? 'gutentor-overlay g-overlay' : '';/*gutentor-overlay for bc*/
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_item_height', gutentor_concat_space( 'gutentor-bg-image gtf-bg-image', 'gutentor-post-height gtf-item-height', $overlay ), $attributes ) ) . "' style='background-image:url(" . esc_url( is_array( $url ) && ! empty( $url ) ? $url[0] : $default_url ) . ")'>";
if ( $enable_post_format && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $this->categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_woo_badge( $post, $product, $attributes );
}
$output .= apply_filters( 'gutentor_edit_post_module_featured_image_popup_data', '', $post, $attributes );
$output .= '<div class="gutentor-post-content gtf-content">';/*gutentor-post-content for bc*/
$output .= $this->get_primary_meta( $post, $attributes );
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-title' ) {
$output .= $this->get_woo_badge( $post, $product, $attributes );
}
$output .= $this->get_title( $post, $attributes );
$output .= $this->updated_wc_price( $post, $product, $attributes );
if ( isset( $attributes['wooOnRating'] ) && $attributes['wooOnRating'] ) {
if ( $rating_html ) {
$output .= '<div class="gutentor-wc-rating">';
$output .= $rating_html;
$output .= '</div>';
}
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-ct-box' ) {
$output .= $this->get_woo_badge( $post, $product, $attributes );
}
$output .= $this->get_description( $post, $attributes );
$output .= $this->get_secondary_meta( $post, $attributes );
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->new_badge_product( $post, $product );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-button' ) {
$output .= $this->get_woo_badge( $post, $product, $attributes );
}
if ( isset( $attributes['pOnBtn'] ) && $attributes['pOnBtn'] ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_product_button_class', 'gutentor-woo-add-to-cart wc-block-grid__product-add-to-cart', $post, $attributes ) ) . "'>";
ob_start();
woocommerce_template_loop_add_to_cart( array( 'gutentor-attributes' => $attributes ) );
$output .= ob_get_clean();
$output .= '</div>';
}
$output .= '</div>';/*.gtf-content*/
$output .= apply_filters( 'gutentor_post_type_featured_after_content', '', $post, $attributes );
$output .= '</div>';/*.gtf-bg-image*/
$output .= '</div>';/*.gutentor-post-item*/
$output .= '</article>';/*.article*/
return $output;
}
/**
* Get Edd Single block
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function p2_edd_single_article( $post, $attributes, $index ) {
if ( ! gutentor_is_edd_active() ) {
return '';
}
$download = edd_get_download( $post->ID );
$output = '';
$enable_avatar = isset( $attributes['pOnAvatar'] ) && $attributes['pOnAvatar'];
$avatar_pos = ( isset( $attributes['pAvatarPos'] ) ) ? $attributes['pAvatarPos'] : false;
$enable_post_format = isset( $attributes['pOnPostFormatOpt'] ) && $attributes['pOnPostFormatOpt'];
$post_format_pos = ( isset( $attributes['pPostFormatPos'] ) ) ? $attributes['pPostFormatPos'] : false;
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_post_module_article_class', gutentor_concat_space( 'gutentor-post gtf-item-wrap', 'gutentor-post-item-' . $index, 'gtf-item-' . $index ), $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_item', gutentor_concat_space( 'gutentor-post-item', 'gtf-item' ), $attributes ) ) . "'>";
$enable_overlayImage = false;
$overlayImage = isset( $attributes['pFImgOColor'] ) && $attributes['pFImgOColor'];
if ( $overlayImage ) {
$enable_overlayImage = ( isset( $attributes['pFImgOColor']['enable'] ) ) ? $attributes['pFImgOColor']['enable'] : false;
}
$url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $attributes['pFImgSize'] );
$default_url = GUTENTOR_URL . 'assets/img/default-image.jpg';
$overlay = $enable_overlayImage ? 'gutentor-overlay g-overlay' : '';/*gutentor-overlay for bc*/
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_item_height', gutentor_concat_space( 'gutentor-bg-image gtf-bg-image', 'gutentor-post-height gtf-item-height', $overlay ), $attributes ) ) . "' style='background-image:url(" . esc_url( is_array( $url ) && ! empty( $url ) ? $url[0] : $default_url ) . ")'>";
if ( $enable_avatar && $this->avatar_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->edd_new_badge_product( $post, $download );
}
$output .= apply_filters( 'gutentor_edit_post_module_featured_image_popup_data', '', $post, $attributes );
$output .= '<div class="gutentor-post-content gtf-content">';/*gutentor-post-content for bc*/
$output .= $this->get_primary_meta( $post, $attributes );
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-title' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->edd_new_badge_product( $post, $download );
}
$output .= $this->get_title( $post, $attributes );
$output .= $this->updated_edd_price( $post, $attributes );
if ( isset( $attributes['wooOnRating'] ) && $attributes['wooOnRating'] ) {
if ( gutentor_custom_edd_review( $post->ID ) ) {
$output .= '<div class="gutentor-edd-rating">';
$output .= gutentor_custom_edd_review( $post->ID );
$output .= '</div>';
}
}
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-content' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->edd_new_badge_product( $post, $download );
}
$output .= $this->get_description( $post, $attributes );
$output .= $this->get_secondary_meta( $post, $attributes );
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-button' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->edd_new_badge_product( $post, $download );
}
$output .= $this->get_edd_wish_list( $post, $attributes );
$output .= $this->get_edd_button( $post, $attributes );
$output .= '</div>';/*.gtf-content*/
$output .= apply_filters( 'gutentor_post_type_featured_after_content', '', $post, $attributes );
$output .= '</div>';/*.gtf-bg-image*/
$output .= '</div>';/*.gutentor-post-item*/
$output .= '</article>';/*.article*/
return $output;
}
/**
* Featured Post type template
*
* @param {string} $data
* @param {object} $post
* @param {array} $attributes
* @return {mix}
*
* @return {boolean}
*/
public function featured_post_type_template( $post, $attributes, $index ) {
$post_type = ( isset( $attributes['pPostType'] ) ) ? $attributes['pPostType'] : 'post';
if ( 'product' === $post_type ) {
return $this->p2_woo_single_article( $post, $attributes, $index );
} elseif ( 'download' === $post_type ) {
return $this->p2_edd_single_article( $post, $attributes, $index );
} else {
return $this->p2_single_article( $post, $attributes, $index );
}
}
/**
* Get T2 Single item
*
* @param {string} $data
* @param {array} $term
* @param {array} $attributes
* @return {mix}
*/
public function t2_single_article( $term, $attributes, $index ) {
$output = '';
$no_thumb = '';
$bg_image = '';
$url = '';
$thumbnail_size = ( isset( $attributes['tFImgSize'] ) ) ? $attributes['tFImgSize'] : 'large';
if ( $this->has_term_thumbnail( $term ) ) {
$image_url = wp_get_attachment_image_src( $this->get_term_thumbnail_id( $term ), $thumbnail_size );
if ( ! $image_url ) {
$image_url[0] = GUTENTOR_URL . 'assets/img/default-image.jpg';
}
$url = $image_url[0];
$url = 'style="background-image:url(' . esc_url( $url ) . ')"';
$bg_image = 'gtf-bg-image';
} else {
$no_thumb = 'gtf-no-thumb';
}
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_term_module_article_class', gutentor_concat_space( 'gtf-item-wrap', 'gtf-item-' . $index, $no_thumb ), $attributes ) ) . "'>";
$output .= '<div class="gtf-item">';
$enable_overlayImage = false;
$overlayImage = isset( $attributes['tFImgOC'] ) && $attributes['tFImgOC'];
if ( $overlayImage ) {
$enable_overlayImage = ( isset( $attributes['tFImgOC']['enable'] ) ) ? $attributes['tFImgOC']['enable'] : false;
}
$overlay = $enable_overlayImage ? 'g-overlay' : '';
$output .= '<div class="' . esc_attr( gutentor_concat_space( $bg_image, 'gtf-item-height', $overlay ) ) . '" ' . $url . '>';
$output .= '<div class="gtf-content">';
$output .= $this->get_term_title_and_count( $term, $attributes );
$output .= $this->get_term_description( $term, $attributes );
$output .= $this->get_term_button( $term, $attributes );
$output .= '</div>';/*.g-term-content*/
$output .= '</div>';/*.gtf-bg-image*/
$output .= '</div>';/*.gutentor-term-item*/
$output .= '</article>';/*.article*/
return $output;
}
}
}
Gutentor_Featured::get_instance()->load_dependencies();

View File

@@ -0,0 +1,108 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N1_T1' ) ) {
/**
* Gutentor_Featured_N1_T1 Class For Gutentor
*
* @package Gutentor
* @since 2.0.5
*/
class Gutentor_Featured_N1_T1 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 1;
/**
* Number of public
*
* @access private
* @since 3.0.0
* @var integer
*/
public $template = 1;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N1_T1::get_instance()->run();

View File

@@ -0,0 +1,107 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N2_T1' ) ) {
/**
* Gutentor_Featured_N2_T1 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N2_T1 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 2;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 1;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N2_T1::get_instance()->run();

View File

@@ -0,0 +1,109 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N2_T2' ) ) {
/**
* Gutentor_Featured_N2_T2 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N2_T2 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 2;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 2;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N2_T2::get_instance()->run();

View File

@@ -0,0 +1,109 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N3_T1' ) ) {
/**
* Gutentor_Featured_N3_T1 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N3_T1 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 3;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 1;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N3_T1::get_instance()->run();

View File

@@ -0,0 +1,129 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N3_T2' ) ) {
/**
* Gutentor_Featured_N3_T2 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N3_T2 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 3;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 2;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 1 ) {
$output .= '</div>';/*$index === 1*/
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 1 ) {
$output .= '</div>';/*$index === 1*/
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N3_T2::get_instance()->run();

View File

@@ -0,0 +1,129 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N3_T3' ) ) {
/**
* Gutentor_Featured_N3_T3 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N3_T3 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 3;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 3;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 1 || $index === 2 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 2 ) {
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 1 || $index === 2 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 2 ) {
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N3_T3::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N3_T4' ) ) {
/**
* Gutentor_Featured_N3_T4 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N3_T4 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 3;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 4;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 || $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-lg-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-12 grid-lg-12 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 || $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-lg-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-12 grid-lg-12 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N3_T4::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N3_T5' ) ) {
/**
* Gutentor_Featured_N3_T5 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N3_T5 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 3;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 5;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-12 grid-lg-12 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 || $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-lg-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-12 grid-lg-12 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 || $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-lg-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N3_T5::get_instance()->run();

View File

@@ -0,0 +1,107 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N4_T1' ) ) {
/**
* Gutentor_Featured_N4_T1 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N4_T1 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 4;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 1;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-3 grid-md-3 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-3 grid-md-3 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N4_T1::get_instance()->run();

View File

@@ -0,0 +1,144 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N4_T10' ) ) {
/**
* Gutentor_Featured_N4_T10 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N4_T10 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 4;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 10;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 || $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= '</div>';
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_row_class', 'grid-row', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 || $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= '</div>';
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N4_T10::get_instance()->run();

View File

@@ -0,0 +1,107 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N4_T2' ) ) {
/**
* Gutentor_Featured_N4_T2 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N4_T2 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 4;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 2;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N4_T2::get_instance()->run();

View File

@@ -0,0 +1,129 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N4_T3' ) ) {
/**
* Gutentor_Featured_N4_T3 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N4_T3 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 4;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 3;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index > 0 && $index < 4 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 3 ) {
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index > 0 && $index < 4 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 3 ) {
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N4_T3::get_instance()->run();

View File

@@ -0,0 +1,129 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N4_T4' ) ) {
/**
* Gutentor_Featured_N4_T4 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N4_T4 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 4;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 4;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index < 3 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 2 ) {
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index < 3 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 2 ) {
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N4_T4::get_instance()->run();

View File

@@ -0,0 +1,139 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N4_T5' ) ) {
/**
* Gutentor_Featured_N4_T5 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N4_T5 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 4;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 5;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index > 0 && $index < 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= '</div>';
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index > 0 && $index < 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= '</div>';
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N4_T5::get_instance()->run();

View File

@@ -0,0 +1,137 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N4_T6' ) ) {
/**
* Gutentor_Featured_N4_T6 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N4_T6 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 4;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 6;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index < 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= '</div>';
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index < 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= '</div>';
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N4_T6::get_instance()->run();

View File

@@ -0,0 +1,145 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N4_T7' ) ) {
/**
* Gutentor_Featured_N4_T7 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N4_T7 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 4;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 7;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index === 1 || $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
$output .= '</div>';
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index === 1 || $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
$output .= '</div>';
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N4_T7::get_instance()->run();

View File

@@ -0,0 +1,145 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N4_T8' ) ) {
/**
* Gutentor_Featured_N4_T8 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N4_T8 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 4;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 8;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 || $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= '</div>';
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_row_class', 'grid-row', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 || $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= '</div>';
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N4_T8::get_instance()->run();

View File

@@ -0,0 +1,145 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N4_T9' ) ) {
/**
* Gutentor_Featured_N4_T9 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N4_T9 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 4;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 9;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
$output .= '</div>';
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-12 grid-md-12 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
$output .= '</div>';
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N4_T9::get_instance()->run();

View File

@@ -0,0 +1,107 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T1' ) ) {
/**
* Gutentor_Featured_N5_T1 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T1 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 1;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-2m3 grid-md-2m3 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-2m3 grid-md-2m3 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T1::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T10' ) ) {
/**
* Gutentor_Featured_N5_T10 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T10 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 10;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 0 || $index === 2 || $index === 3 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 0 || $index === 2 || $index === 3 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T10::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T11' ) ) {
/**
* Gutentor_Featured_N5_T11 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T11 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 11;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 0 || $index === 1 || $index === 2 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 0 || $index === 1 || $index === 2 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T11::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T12' ) ) {
/**
* Gutentor_Featured_N5_T12 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T12 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 12;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 || $index === 1 || $index === 2 || $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 || $index === 1 || $index === 2 || $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T12::get_instance()->run();

View File

@@ -0,0 +1,139 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T2' ) ) {
/**
* Gutentor_Featured_N5_T2 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T2 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 2;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index > 0 && $index < 6 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 5 ) {
$output .= '</div>';
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index > 0 && $index < 6 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 5 ) {
$output .= '</div>';
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T2::get_instance()->run();

View File

@@ -0,0 +1,137 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T3' ) ) {
/**
* Gutentor_Featured_N5_T3 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T3 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 3;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index < 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= '</div>';
$output .= '</div>';
}
if ( $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_row_class', 'grid-row', $attributes ) ) . "'>";
}
if ( $index < 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= '</div>';
$output .= '</div>';
}
if ( $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T3::get_instance()->run();

View File

@@ -0,0 +1,147 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T4' ) ) {
/**
* Gutentor_Featured_N5_T4 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T4 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 4;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 1 ) {
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
}
if ( $index === 3 || $index === 4 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 4 ) {
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 1 ) {
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
}
if ( $index === 3 || $index === 4 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 4 ) {
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T4::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T5' ) ) {
/**
* Gutentor_Featured_N5_T5 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T5 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 5;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 || $index === 1 || $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 || $index === 1 || $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 3 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T5::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T6' ) ) {
/**
* Gutentor_Featured_N5_T6 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T6 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 6;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 || $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 || $index === 3 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 || $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 || $index === 3 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T6::get_instance()->run();

View File

@@ -0,0 +1,137 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T7' ) ) {
/**
* Gutentor_Featured_N5_T7 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T7 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 7;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 1 ) {
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 2 || $index === 3 || $index === 4 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 4 ) {
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 1 ) {
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 2 || $index === 3 || $index === 4 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 4 ) {
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T7::get_instance()->run();

View File

@@ -0,0 +1,137 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T8' ) ) {
/**
* Gutentor_Featured_N5_T8 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T8 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 8;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 || $index === 2 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 2 ) {
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 3 || $index === 4 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 4 ) {
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 || $index === 2 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 2 ) {
$output .= '</div>';
}
if ( $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 3 || $index === 4 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 4 ) {
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T8::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N5_T9' ) ) {
/**
* Gutentor_Featured_N5_T9 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N5_T9 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 5;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 9;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 || $index === 2 || $index === 3 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-8 grid-md-8 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 1 || $index === 2 || $index === 3 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N5_T9::get_instance()->run();

View File

@@ -0,0 +1,107 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N6_T1' ) ) {
/**
* Gutentor_Featured_N6_T1 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N6_T1 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 6;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 1;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-2 grid-md-2 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-2 grid-md-2 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N6_T1::get_instance()->run();

View File

@@ -0,0 +1,107 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N6_T2' ) ) {
/**
* Gutentor_Featured_N6_T2 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N6_T2 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 6;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 2;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-4 grid-md-4 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N6_T2::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N6_T3' ) ) {
/**
* Gutentor_Featured_N6_T3 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N6_T3 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 6;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 3;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 || $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 || $index === 3 || $index === 4 || $index === 5 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-3 grid-md-3 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 || $index === 1 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 || $index === 3 || $index === 4 || $index === 5 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-3 grid-md-3 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N6_T3::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N6_T4' ) ) {
/**
* Gutentor_Featured_N6_T4 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N6_T4 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 6;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 4;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 || $index === 1 || $index === 2 || $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-3 grid-md-3 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 4 || $index === 5 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 || $index === 1 || $index === 2 || $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-3 grid-md-3 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 4 || $index === 5 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N6_T4::get_instance()->run();

View File

@@ -0,0 +1,137 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N6_T5' ) ) {
/**
* Gutentor_Featured_N6_T5 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N6_T5 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 6;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 5;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 1 ) {
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 2 || $index === 3 || $index === 4 || $index === 5 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 5 ) {
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 1 ) {
$output .= '</div>';
}
if ( $index === 2 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 2 || $index === 3 || $index === 4 || $index === 5 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 5 ) {
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N6_T5::get_instance()->run();

View File

@@ -0,0 +1,137 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N6_T6' ) ) {
/**
* Gutentor_Featured_N6_T6 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N6_T6 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 6;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 6;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 || $index === 2 || $index === 3 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 3 ) {
$output .= '</div>';
}
if ( $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 4 || $index === 5 ) {
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
}
if ( $index === 5 ) {
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 0 || $index === 1 || $index === 2 || $index === 3 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 3 ) {
$output .= '</div>';
}
if ( $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
}
if ( $index === 4 || $index === 5 ) {
$output .= $this->t2_single_article( $term, $attributes, $index );
}
if ( $index === 5 ) {
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N6_T6::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N6_T7' ) ) {
/**
* Gutentor_Featured_N6_T7 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N6_T7 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 6;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 7;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 1 || $index === 2 || $index === 3 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-3 grid-md-3 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 0 || $index === 5 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 1 || $index === 2 || $index === 3 || $index === 4 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-3 grid-md-3 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 0 || $index === 5 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N6_T7::get_instance()->run();

View File

@@ -0,0 +1,121 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Featured_N6_T8' ) ) {
/**
* Gutentor_Featured_N6_T8 Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Featured_N6_T8 extends Gutentor_Featured {
/**
* Number of items
*
* @access public
* @since 3.0.0
* @var integer
*/
public $number = 6;
/**
* Number of template
*
* @access public
* @since 3.0.0
* @var integer
*/
public $template = 8;
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid interface and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Post template
*
* @param {string} $output
* @param {object} $the_query
* @param {array} $attributes
*
* @return {string}
*/
public function post_template( $output, $the_query, $attributes ) {
if ( ! $this->isP2( $attributes ) ) {
return $output;
}
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
if ( $index === 0 || $index == 1 || $index === 4 || $index === 5 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-3 grid-md-3 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 || $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->featured_post_type_template( get_post(), $attributes, $index );
$output .= '</div>';
}
++$index;
endwhile;
return $output;
}
/**
* Term Template
*
* @param {string} $output
* @param {array} $terms
* @param {array} $attributes
*
* @return {string}
*/
public function term_template( $output, $terms, $attributes ) {
if ( ! $this->isT2( $attributes ) ) {
return $output;
}
$index = 0;
foreach ( $terms as $term ) {
if ( $index === 0 || $index == 1 || $index === 4 || $index === 5 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-3 grid-md-3 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
if ( $index === 2 || $index === 3 ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t2_grid_class', 'grid-lg-6 grid-md-6 grid-12', $attributes ) ) . "'>";
$output .= $this->t2_single_article( $term, $attributes, $index );
$output .= '</div>';
}
++$index;
}
return $output;
}
}
}
Gutentor_Featured_N6_T8::get_instance()->run();

View File

@@ -0,0 +1,892 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Normal_P1_Templates' ) ) {
/**
* Blog_Post_Templates Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Normal_P1_Templates extends Gutentor_Query_Elements {
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Run Block
*
* @access public
* @since 2.0.0
* @return void
*/
public function run() {
add_filter( 'gutentor_post_module_p1_query_data', array( $this, 'load_blog_post_template' ), 99999, 3 );
}
/**
* Load Grid Template 1
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_p1_grid_template1( $data, $post, $attributes ) {
$query_sorting = array_key_exists( 'blockSortableItems', $attributes ) ? $attributes['blockSortableItems'] : false;
$enable_post_format = isset( $attributes['pOnPostFormatOpt'] ) && $attributes['pOnPostFormatOpt'];
$post_format_pos = ( isset( $attributes['pPostFormatPos'] ) ) ? $attributes['pPostFormatPos'] : false;
$cat_pos = ( isset( $attributes['pPostCatPos'] ) ) ? $attributes['pPostCatPos'] : false;
$enable_featured_cat = isset( $attributes['pOnFeaturedCat'] ) && $attributes['pOnFeaturedCat'];
$enable_featured_img = isset( $attributes['pOnFImg'] ) && $attributes['pOnFImg'];
$enable_avatar = isset( $attributes['pOnAvatar'] ) && $attributes['pOnAvatar'];
$avatar_pos = ( isset( $attributes['pAvatarPos'] ) ) ? $attributes['pAvatarPos'] : false;
$output = '';
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'featured-image':
if ( $enable_featured_img && gutentor_has_post_featured( $post ) ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_image_box', 'gutentor-post-image-box', $post, $attributes ) ) . "'>";
if ( $enable_avatar && has_post_thumbnail( $post->ID ) && $this->avatar_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
$output .= $this->get_featured_image( $post, $attributes );
if ( $enable_post_format && has_post_thumbnail( $post->ID ) && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && has_post_thumbnail( $post->ID ) && $this->categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= '</div>';
}
break;
case 'title':
if ( $cat_pos === 'gutentor-cat-pos-before-title' || $post_format_pos === 'gutentor-pf-pos-before-title' || $this->avatar_on_title_condition( $avatar_pos ) ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_avatar && has_post_thumbnail( $post->ID ) && $this->avatar_on_title_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-title' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_title( $post, $attributes );
}
break;
case 'avatar':
$output .= $this->get_avatar_data( $post, $attributes );
break;
case 'primary-entry-meta':
$output .= $this->get_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_secondary_meta( $post, $attributes );
break;
case 'description':
if ( $cat_pos === 'gutentor-cat-pos-before-ct-box' || $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-ct-box' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_description( $post, $attributes );
}
break;
case 'button':
if ( $cat_pos === 'gutentor-cat-pos-before-button' || $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-button' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_button( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_button( $post, $attributes );
}
break;
default:
$output .= $this->get_dynamic_element( $element, $post, $attributes );
break;
}
endforeach;
endif;
return $output;
}
/**
* Load List Template 1
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_p1_list_template1( $data, $post, $attributes ) {
$query_sorting = array_key_exists( 'blockSortableItems', $attributes ) ? $attributes['blockSortableItems'] : false;
$enable_post_format = isset( $attributes['pOnPostFormatOpt'] ) && $attributes['pOnPostFormatOpt'];
$post_format_pos = ( isset( $attributes['pPostFormatPos'] ) ) ? $attributes['pPostFormatPos'] : false;
$cat_pos = ( isset( $attributes['pPostCatPos'] ) ) ? $attributes['pPostCatPos'] : false;
$enable_featured_cat = isset( $attributes['pOnFeaturedCat'] ) && $attributes['pOnFeaturedCat'];
$enable_featured_img = isset( $attributes['pOnFImg'] ) && $attributes['pOnFImg'];
$enable_avatar = isset( $attributes['pOnAvatar'] ) && $attributes['pOnAvatar'];
$avatar_pos = ( isset( $attributes['pAvatarPos'] ) ) ? $attributes['pAvatarPos'] : false;
$output = '';
if ( $enable_featured_img && gutentor_has_post_featured( $post ) ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_image_box', 'gutentor-post-image-box', $post, $attributes ) ) . "'>";
if ( $enable_avatar && has_post_thumbnail( $post->ID ) && $this->avatar_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
$output .= $this->get_featured_image( $post, $attributes );
if ( $enable_post_format && has_post_thumbnail( $post->ID ) && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && has_post_thumbnail( $post->ID ) && $this->categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= '</div>';
}
$output .= '<div class="gutentor-post-content">';
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
if ( $cat_pos === 'gutentor-cat-pos-before-title' || $post_format_pos === 'gutentor-pf-pos-before-title' || $this->avatar_on_title_condition( $avatar_pos ) ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_avatar && has_post_thumbnail( $post->ID ) && $this->avatar_on_title_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-title' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_title( $post, $attributes );
}
break;
case 'avatar':
$output .= $this->get_avatar_data( $post, $attributes );
break;
case 'primary-entry-meta':
$output .= $this->get_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_secondary_meta( $post, $attributes );
break;
case 'description':
if ( $cat_pos === 'gutentor-cat-pos-before-ct-box' || $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-ct-box' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_description( $post, $attributes );
}
break;
case 'button':
if ( $cat_pos === 'gutentor-cat-pos-before-button' || $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-button' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_button( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_button( $post, $attributes );
}
break;
default:
$output .= $this->get_dynamic_element( $element, $post, $attributes );
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-post-content*/
return $output;
}
/**
* Load Template 1
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_p1_template1( $data, $post, $attributes ) {
$template_style = isset( $attributes['gStyle'] ) ? $attributes['gStyle'] : false;
$output = '';
if ( $template_style === 'gutentor-blog-grid' ) {
$output = $this->gutentor_p1_grid_template1( $data, $post, $attributes );
} elseif ( $template_style === 'gutentor-blog-list' ) {
$output = $this->gutentor_p1_list_template1( $data, $post, $attributes );
}
return $output;
}
/**
* Load Template 2
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_p1_template2( $data, $post, $attributes ) {
$enable_post_format = isset( $attributes['pOnPostFormatOpt'] ) && $attributes['pOnPostFormatOpt'];
$post_format_pos = ( isset( $attributes['pPostFormatPos'] ) ) ? $attributes['pPostFormatPos'] : false;
$cat_pos = ( isset( $attributes['pPostCatPos'] ) ) ? $attributes['pPostCatPos'] : false;
$enable_featured_cat = isset( $attributes['pOnFeaturedCat'] ) && $attributes['pOnFeaturedCat'];
$enable_avatar = isset( $attributes['pOnAvatar'] ) && $attributes['pOnAvatar'];
$avatar_pos = ( isset( $attributes['pAvatarPos'] ) ) ? $attributes['pAvatarPos'] : false;
$enable_featured_img = isset( $attributes['pOnFImg'] ) && $attributes['pOnFImg'];
$output = '';
if ( $enable_featured_img && gutentor_has_post_featured( $post ) ) {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_image_box', 'gutentor-post-image-box', $post, $attributes ) ) . "'>";
if ( $enable_avatar && $this->avatar_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
$output .= $this->get_featured_image( $post, $attributes );
if ( $enable_post_format && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $this->categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_primary_meta( $post, $attributes );
$output .= '</div>';/*.gutentor-post-image-box*/
}
$output .= '<div class="gutentor-post-content">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-title' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-title' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_title( $post, $attributes );
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-content' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-ct-box' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_description( $post, $attributes );
$output .= $this->get_secondary_meta( $post, $attributes );
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-button' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-button' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_button( $post, $attributes );
$output .= '</div>';/*.gutentor-post-content*/
return $output;
}
/**
* add Template 5
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_p1_bg_image_template5( $data, $post, $attributes ) {
$output = '';
$query_sorting = array_key_exists( 'blockSortableItems', $attributes ) ? $attributes['blockSortableItems'] : false;
$enable_post_format = isset( $attributes['pOnPostFormatOpt'] ) && $attributes['pOnPostFormatOpt'];
$post_format_pos = ( isset( $attributes['pPostFormatPos'] ) ) ? $attributes['pPostFormatPos'] : false;
$cat_pos = ( isset( $attributes['pPostCatPos'] ) ) ? $attributes['pPostCatPos'] : false;
$enable_featured_cat = isset( $attributes['pOnFeaturedCat'] ) && $attributes['pOnFeaturedCat'];
$enable_featured_img = isset( $attributes['pOnFImg'] ) && $attributes['pOnFImg'];
$enable_avatar = isset( $attributes['pOnAvatar'] ) && $attributes['pOnAvatar'];
$avatar_pos = ( isset( $attributes['pAvatarPos'] ) ) ? $attributes['pAvatarPos'] : false;
if ( $enable_featured_img && has_post_thumbnail( $post->ID ) ) {
$enable_overlayImage = false;
$overlayImage = ( isset( $attributes['pFImgOColor'] ) ) ? $attributes['pFImgOColor'] : false;
if ( $overlayImage ) {
$enable_overlayImage = ( isset( $attributes['pFImgOColor']['enable'] ) ) ? $attributes['pFImgOColor']['enable'] : false;
}
$url = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), $attributes['pFImgSize'] );
$overlay = $enable_overlayImage ? 'g-overlay' : '';/*gutentor-overlay for bc*/
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_t5_item_height', gutentor_concat_space( 'gptm-bg-image', 'gptm-item-height', $overlay ), $attributes ) ) . "' style=\"background-image:url('" . esc_url( is_array( $url ) && ! empty( $url ) ? $url[0] : '' ) . "');\">";
if ( $enable_avatar && $this->avatar_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $this->categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= apply_filters( 'gutentor_edit_post_module_featured_image_popup_data', '', $post, $attributes );
$output .= '<div class="gutentor-post-content ">';/*gutentor-post-content for bc*/
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
if ( $cat_pos === 'gutentor-cat-pos-before-title' || $post_format_pos === 'gutentor-pf-pos-before-title' || $avatar_pos === 'g-avatar-b-title' ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-title' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-title' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_title( $post, $attributes );
}
break;
case 'avatar':
$output .= $this->get_avatar_data( $post, $attributes );
break;
case 'primary-entry-meta':
$output .= $this->get_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_secondary_meta( $post, $attributes );
break;
case 'description':
if ( $cat_pos === 'gutentor-cat-pos-before-ct-box' || $post_format_pos === 'gutentor-pf-pos-before-ct-box' || $avatar_pos === 'g-avatar-b-content' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-content' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-ct-box' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_description( $post, $attributes );
}
break;
case 'button':
if ( $cat_pos === 'gutentor-cat-pos-before-button' || $post_format_pos === 'gutentor-pf-pos-before-button' || $avatar_pos === 'g-avatar-b-button' ) {
$output .= '<div class="gutentor-post-button-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-button' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-button' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_button( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_button( $post, $attributes );
}
break;
default:
$output .= $this->get_dynamic_element( $element, $post, $attributes );
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-post-content*/
$output .= '</div>';/*.gptm-bg-image*/
} else {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_t5_item_height', 'gptm-item-height', $attributes ) ) . "'>";
if ( $enable_avatar && $this->avatar_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $this->categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= apply_filters( 'gutentor_edit_post_module_featured_image_popup_data', '', $post, $attributes );
$output .= '<div class="gutentor-post-content">';/*gutentor-post-content for bc*/
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
if ( $cat_pos === 'gutentor-cat-pos-before-title' || $post_format_pos === 'gutentor-pf-pos-before-title' || $avatar_pos === 'g-avatar-b-title' ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-title' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-title' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_title( $post, $attributes );
}
break;
case 'avatar':
$output .= $this->get_avatar_data( $post, $attributes );
break;
case 'primary-entry-meta':
$output .= $this->get_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_secondary_meta( $post, $attributes );
break;
case 'description':
if ( $cat_pos === 'gutentor-cat-pos-before-ct-box' || $post_format_pos === 'gutentor-pf-pos-before-ct-box' || $avatar_pos === 'g-avatar-b-content' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-content' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-ct-box' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_description( $post, $attributes );
}
break;
case 'button':
if ( $cat_pos === 'gutentor-cat-pos-before-button' || $post_format_pos === 'gutentor-pf-pos-before-button' || $avatar_pos === 'g-avatar-b-button' ) {
$output .= '<div class="gutentor-post-button-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-button' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-button' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_button( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_button( $post, $attributes );
}
break;
default:
$output .= $this->get_dynamic_element( $element, $post, $attributes );
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-post-content*/
$output .= '</div>';/*.gptm-item-height*/
}
return $output;
}
/**
* add Template 5
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_p1_normal_image_template5( $data, $post, $attributes ) {
$output = '';
$query_sorting = array_key_exists( 'blockSortableItems', $attributes ) ? $attributes['blockSortableItems'] : false;
$enable_post_format = isset( $attributes['pOnPostFormatOpt'] ) && $attributes['pOnPostFormatOpt'];
$post_format_pos = ( isset( $attributes['pPostFormatPos'] ) ) ? $attributes['pPostFormatPos'] : false;
$cat_pos = ( isset( $attributes['pPostCatPos'] ) ) ? $attributes['pPostCatPos'] : false;
$enable_featured_cat = isset( $attributes['pOnFeaturedCat'] ) && $attributes['pOnFeaturedCat'];
$enable_featured_img = isset( $attributes['pOnFImg'] ) && $attributes['pOnFImg'];
$enable_avatar = isset( $attributes['pOnAvatar'] ) && $attributes['pOnAvatar'];
$avatar_pos = ( isset( $attributes['pAvatarPos'] ) ) ? $attributes['pAvatarPos'] : false;
if ( $enable_featured_img && has_post_thumbnail( $post->ID ) ) {
$enable_overlayImage = false;
$overlayImage = ( isset( $attributes['pFImgOColor'] ) ) ? $attributes['pFImgOColor'] : false;
if ( $overlayImage ) {
$enable_overlayImage = ( isset( $attributes['pFImgOColor']['enable'] ) ) ? $attributes['pFImgOColor']['enable'] : false;
}
$overlay = $enable_overlayImage ? 'g-overlay' : '';/*gutentor-overlay for bc*/
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_t5_item_height', gutentor_concat_space( 'gptm-bg-image', 'gptm-item-height', $overlay ), $attributes ) ) . "'>";
if ( $enable_avatar && $this->avatar_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
$output .= $this->get_featured_image( $post, $attributes );
if ( $enable_featured_cat && $this->categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= apply_filters( 'gutentor_edit_post_module_featured_image_popup_data', '', $post, $attributes );
$output .= '<div class="gutentor-post-content">';/*gutentor-post-content for bc*/
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
if ( $cat_pos === 'gutentor-cat-pos-before-title' || $post_format_pos === 'gutentor-pf-pos-before-title' || $avatar_pos === 'g-avatar-b-title' ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-title' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-title' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_title( $post, $attributes );
}
break;
case 'avatar':
$output .= $this->get_avatar_data( $post, $attributes );
break;
case 'primary-entry-meta':
$output .= $this->get_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_secondary_meta( $post, $attributes );
break;
case 'description':
if ( $cat_pos === 'gutentor-cat-pos-before-ct-box' || $post_format_pos === 'gutentor-pf-pos-before-ct-box' || $avatar_pos === 'g-avatar-b-content' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-content' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-ct-box' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_description( $post, $attributes );
}
break;
case 'button':
if ( $cat_pos === 'gutentor-cat-pos-before-button' || $post_format_pos === 'gutentor-pf-pos-before-button' || $avatar_pos === 'g-avatar-b-button' ) {
$output .= '<div class="gutentor-post-button-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-button' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-button' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_button( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_button( $post, $attributes );
}
break;
default:
$output .= $this->get_dynamic_element( $element, $post, $attributes );
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-post-content*/
$output .= '</div>';/*.gptm-bg-image*/
} else {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_t5_item_height', 'gptm-item-height', $attributes ) ) . "'>";
if ( $enable_avatar && $this->avatar_on_image_condition( $avatar_pos ) ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $this->post_format_on_image_condition( $post_format_pos ) ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
$overlay_obj = ( isset( $attributes['pFImgOColor'] ) ) ? $attributes['pFImgOColor'] : false;
$overlay_enable = ( $overlay_obj && array_key_exists( 'enable', $overlay_obj ) ) ? $attributes['pFImgOColor']['enable'] : false;
$overlay = ( $overlay_enable ) ? 'gutentor-overlay' : '';
$output .= '<div class="gutentor-image-thumb">';/*gutentor-post-content for bc*/
$output .= '<img class="' . esc_attr( gutentor_concat_space( 'normal-image', $overlay ) ) . '" src="' . esc_url( GUTENTOR_URL . 'assets/img/default-image.jpg' ) . '">';
$output .= '</div>';/*gutentor-post-content for bc*/
if ( $enable_featured_cat && $this->categories_on_image_condition( $cat_pos ) ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= apply_filters( 'gutentor_edit_post_module_featured_image_popup_data', '', $post, $attributes );
$output .= '<div class="gutentor-post-content">';/*gutentor-post-content for bc*/
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
if ( $cat_pos === 'gutentor-cat-pos-before-title' || $post_format_pos === 'gutentor-pf-pos-before-title' || $avatar_pos === 'g-avatar-b-title' ) {
$output .= '<div class="gutentor-post-title-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-title' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-title' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-title' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_title( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_title( $post, $attributes );
}
break;
case 'avatar':
$output .= $this->get_avatar_data( $post, $attributes );
break;
case 'primary-entry-meta':
$output .= $this->get_primary_meta( $post, $attributes );
break;
case 'secondary-entry-meta':
$output .= $this->get_secondary_meta( $post, $attributes );
break;
case 'description':
if ( $cat_pos === 'gutentor-cat-pos-before-ct-box' || $post_format_pos === 'gutentor-pf-pos-before-ct-box' || $avatar_pos === 'g-avatar-b-content' ) {
$output .= '<div class="gutentor-post-desc-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-content' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-ct-box' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-ct-box' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_description( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_description( $post, $attributes );
}
break;
case 'button':
if ( $cat_pos === 'gutentor-cat-pos-before-button' || $post_format_pos === 'gutentor-pf-pos-before-button' || $avatar_pos === 'g-avatar-b-button' ) {
$output .= '<div class="gutentor-post-button-data-wrap">';
if ( $enable_avatar && $avatar_pos === 'g-avatar-b-button' ) {
$output .= $this->get_avatar_data( $post, $attributes );
}
if ( $enable_post_format && $post_format_pos === 'gutentor-pf-pos-before-button' ) {
$output .= $this->get_post_format_data( $post, $attributes );
}
if ( $enable_featured_cat && $cat_pos === 'gutentor-cat-pos-before-button' ) {
$output .= $this->get_post_module_badges_collection( $post, $attributes );
}
$output .= $this->get_button( $post, $attributes );
$output .= '</div>';
} else {
$output .= $this->get_button( $post, $attributes );
}
break;
default:
$output .= $this->get_dynamic_element( $element, $post, $attributes );
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-post-content*/
$output .= '</div>';/*.gptm-item-height*/
}
return $output;
}
/**
* add Template 5
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_p1_template5( $data, $post, $attributes ) {
$output = '';
$pImgDisplayType = ( isset( $attributes['pImgDisplayType'] ) ) ? $attributes['pImgDisplayType'] : false;
if ( $pImgDisplayType === 'normal-image' ) {
$output .= $this->gutentor_p1_normal_image_template5( $data, $post, $attributes );
}
if ( $pImgDisplayType === 'bg-image' ) {
$output .= $this->gutentor_p1_bg_image_template5( $data, $post, $attributes );
}
return $output;
}
/**
* Blog Post Templates
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function load_blog_post_template( $data, $post, $attributes ) {
$output = $data;
$template = ( isset( $attributes['p1Temp'] ) ) ? $attributes['p1Temp'] : '';
$post_type = ( isset( $attributes['pPostType'] ) ) ? $attributes['pPostType'] : 'post';
if ( $post_type === 'product' ) {
return $output;
}
if ( method_exists( $this, $template ) ) {
$output = $this->$template( $data, $post, $attributes );
} else {
$output = $this->gutentor_p1_template1( $data, $post, $attributes );
}
return $output;
}
}
}
Gutentor_Normal_P1_Templates::get_instance()->run();

View File

@@ -0,0 +1,246 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_T1_Templates' ) ) {
/**
* Blog_Post_Templates Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_T1_Templates extends Gutentor_Query_Elements {
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Run Block
*
* @access public
* @since 2.0.0
* @return void
*/
public function run() {
add_filter( 'gutentor_term_module_t1_query_data', array( $this, 'load_blog_post_template' ), 99999, 4 );
}
/**
* Load Grid Template 1
*
* @param {string} $data
* @param {array} $term
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_t1_grid_template1( $data, $term, $attributes ) {
$query_sorting = array_key_exists( 'blockSortableItems', $attributes ) ? $attributes['blockSortableItems'] : false;
$enable_featured_img = isset( $attributes['tOnFImg'] ) && $attributes['tOnFImg'];
$output = '';
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'featured-image':
if ( $enable_featured_img && $this->has_term_thumbnail( $term ) ) {
$output .= $this->get_term_featured_image( $term, $attributes );
}
break;
case 'title':
$output .= $this->get_term_title_and_count_updated( $term, $attributes, 'title' );
break;
case 'count':
$output .= $this->get_term_title_and_count_updated( $term, $attributes, 'count' );
break;
case 'description':
$output .= $this->get_term_description( $term, $attributes );
break;
case 'button':
$output .= $this->get_term_button( $term, $attributes );
break;
default:
$output .= $this->get_term_dynamic_element( $element, $term, $attributes );
break;
}
endforeach;
endif;
return $output;
}
/**
* Load List Template 1
*
* @param {string} $data
* @param {array} $term
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_t1_list_template1( $data, $term, $attributes ) {
$query_sorting = array_key_exists( 'blockSortableItems', $attributes ) ? $attributes['blockSortableItems'] : false;
$enable_featured_img = isset( $attributes['tOnFImg'] ) && $attributes['tOnFImg'];
$output = '';
if ( $enable_featured_img && $this->has_term_thumbnail( $term ) ) {
$output .= '<div class="gutentor-term-image-box">';
$output .= $this->get_term_featured_image( $term, $attributes );
$output .= '</div>';/*.gutentor-term-image-box*/
}
$output .= '<div class="gutentor-term-content">';
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
$output .= $this->get_term_title_and_count_updated( $term, $attributes, 'title' );
break;
case 'count':
$output .= $this->get_term_title_and_count_updated( $term, $attributes, 'count' );
break;
case 'description':
$output .= $this->get_term_description( $term, $attributes );
break;
case 'button':
$output .= $this->get_term_button( $term, $attributes );
break;
default:
$output .= $this->get_term_dynamic_element( $element, $term, $attributes );
break;
}
endforeach;
endif;
$output .= '</div>';/*.gutentor-term-content*/
return $output;
}
/**
* Template 2
*
* @param {string} $data
* @param {array} $term
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_t1_template2( $data, $term, $attributes ) {
$url = array();
$bg_image_class = $custom_style = '';
$thumbnail_size = ( isset( $attributes['tFImgSize'] ) ) ? $attributes['tFImgSize'] : 'large';
$overlay = ( isset( $attributes['tFImgOC']['enable'] ) ) ? $attributes['tFImgOC']['enable'] : '';
$overlay = $overlay ? 'g-overlay' : '';
if ( $this->has_term_thumbnail( $term ) ) {
$url = wp_get_attachment_image_src( $this->get_term_thumbnail_id( $term ), $thumbnail_size );
$bg_image_class = 'gtf-bg-image';
$custom_style = "style='background-image:url(" . esc_url( is_array( $url ) && ! empty( $url ) ? $url[0] : '' ) . ")'";
}
$query_sorting = array_key_exists( 'blockSortableItems', $attributes ) ? $attributes['blockSortableItems'] : false;
$output = "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_t1_template2_item_height', gutentor_concat_space( 'gtf-item-height', $bg_image_class, $overlay ), $attributes ) ) . "' " . $custom_style . '>';
$output .= '<div class="gtf-content">';
if ( $query_sorting ) :
foreach ( $query_sorting as $element ) :
if ( ! ( array_key_exists( 'itemValue', $element ) ) ) {
return $output;
}
switch ( $element['itemValue'] ) {
case 'title':
$output .= $this->get_term_title_and_count_updated( $term, $attributes, 'title' );
break;
case 'count':
$output .= $this->get_term_title_and_count_updated( $term, $attributes, 'count' );
break;
case 'description':
$output .= $this->get_term_description( $term, $attributes );
break;
case 'button':
$output .= $this->get_term_button( $term, $attributes );
break;
default:
$output .= $this->get_term_dynamic_element( $element, $term, $attributes );
break;
}
endforeach;
endif;
$output .= '</div>';/*.gtf-content*/
$output .= '</div>';/*.gtf-item-height*/
return $output;
}
/**
* Load Template 1
*
* @param {string} $data
* @param {array} $term
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_t1_template1( $data, $term, $attributes ) {
$template_style = isset( $attributes['termStyle'] ) ? $attributes['termStyle'] : false;
$output = '';
if ( $template_style === 'gtf-grid' ) {
$output = $this->gutentor_t1_grid_template1( $data, $term, $attributes );
} elseif ( $template_style === 'gtf-list' ) {
$output = $this->gutentor_t1_list_template1( $data, $term, $attributes );
}
return $output;
}
/**
* Blog Post Templates
*
* @param {string} $data
* @param {array} $term
* @param {array} $attributes
* @return {mix}
*/
public function load_blog_post_template( $data, $term, $attributes, $index ) {
$output = $data;
$template = ( isset( $attributes['t1Temp'] ) ) ? $attributes['t1Temp'] : '';
$enable_featured_img = isset( $attributes['tOnFImg'] ) && $attributes['tOnFImg'];
if ( $enable_featured_img && $this->has_term_thumbnail( $term ) ) {
$no_thumb = '';
} else {
$no_thumb = 'gtf-no-thumb';
}
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_term_module_article_class', gutentor_concat_space( 'gutentor-term', 'gtf-item-' . $index, $no_thumb ), $attributes ) ) . "'>";
$output .= "<div class='gtf-item'>";
if ( method_exists( $this, $template ) ) {
$output .= $this->$template( $data, $term, $attributes );
} else {
$output .= $this->gutentor_t1_template1( $data, $term, $attributes );
}
$output .= '</div>';
$output .= '</article>';
return $output;
}
}
}
Gutentor_T1_Templates::get_instance()->run();

View File

@@ -0,0 +1,84 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Ticker_P5_Templates' ) ) {
/**
* Blog_Post_Templates Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Ticker_P5_Templates extends Gutentor_Query_Elements {
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Run Block
*
* @access public
* @since 2.0.0
* @return void
*/
public function run() {
add_filter( 'gutentor_post_module_p5_query_data', array( $this, 'load_blog_post_template' ), 99999, 3 );
}
/**
* Load Template 1
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function gutentor_p5_template1( $data, $post, $attributes ) {
$output = '';
$output .= '<a class="gutentor-post-title" href="' . esc_url( get_permalink() ) . '" rel="bookmark">';
$output .= get_the_title();
$output .= '</a>';
return $output;
}
/**
* Blog Post Templates
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function load_blog_post_template( $data, $post, $attributes ) {
$output = $data;
$template = ( isset( $attributes['p5Temp'] ) ) ? $attributes['p5Temp'] : '';
if ( method_exists( $this, $template ) ) {
$output = $this->$template( $data, $post, $attributes );
}
return $output;
}
}
}
Gutentor_Ticker_P5_Templates::get_instance()->run();

View File

@@ -0,0 +1,149 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Widget_Blog_Post_Templates' ) ) {
/**
* Blog_Post_Templates Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_Widget_Blog_Post_Templates {
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 2.0.0
* @return object
*/
public static function get_instance() {
// Store the instance locally to avoid private static replication.
static $instance = null;
// Only run these methods if they haven't been ran previously.
if ( null === $instance ) {
$instance = new self();
}
// Always return the instance.
return $instance;
}
/**
* Run Block
*
* @access public
* @since 2.0.0
* @return void
*/
public function run() {
add_filter( 'gutentor_save_blog_post_block_template_data', array( $this, 'load_blog_post_template' ), 10, 3 );
}
/**
* Load Template 1
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function template_1( $data, $post, $attributes ) {
$output = '';
$overlay = ( $attributes['blockImageBoxImageOverlayColor']['enable'] ) ? "<div class='overlay'></div>" : '';
$enable_image_display = $attributes['blockEnableImageBoxDisplayOptions'] ? $attributes['blockEnableImageBoxDisplayOptions'] : false;
if ( $attributes['enablePostImage'] ) {
$image_output = '';
$output .= '<div class="gutentor-single-item-image-box">';
if ( 'bg-image' == $attributes['blockImageBoxDisplayOptions'] && $enable_image_display ) {
$url = wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) );
if ( $url ) {
$image_output .= '<div class="gutentor-bg-image" style="background-image:url(' . esc_url( $url ) . ')">';
$image_output .= $overlay;
$image_output .= '</div>';
}
} elseif ( has_post_thumbnail() ) {
$image_output .= '<div class="gutentor-image-thumb">';
$image_output .= get_the_post_thumbnail( '', '', '' );
$image_output .= $overlay;
$image_output .= '</div>';
}
$output .= apply_filters( 'gutentor_save_item_image_display_data', $image_output, get_permalink(), $attributes );
$output .= '</div>';/*.gutentor-single-item-image-box*/
}
$output .= '<div class="gutentor-post-content">';
if ( $attributes['blockSingleItemTitleEnable'] ) {
$title_tag = gutentor_get_title_tag( $attributes['blockSingleItemTitleTag'] );
$output .= '<' . esc_attr( $title_tag ) . ' class="gutentor-single-item-title">';
$output .= '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">';
$output .= get_the_title();
$output .= '</a>';
$output .= '</' . esc_attr( $title_tag ) . '>';
}
$output .= '<div class="entry-meta">';
if ( $attributes['enablePostDate'] ) {
$dateFontAwesomeClass = (int) gutentor_get_options( 'fa-version' ) === 4 ? 'fa fa-calendar' : 'far fa-calendar-alt';
$output .= '<div class="posted-on"><i class="' . esc_attr( $dateFontAwesomeClass ) . '"></i>';
$output .= '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . esc_attr( get_the_date() ) . '</a>';
$output .= '</div>';
}
if ( $attributes['enablePostAuthor'] ) {
$authorFontAwesomeClass = (int) gutentor_get_options( 'fa-version' ) === 4 ? 'fa fa-user' : 'far fa-user';
$output .= '<div class="author vcard"><i class="' . esc_attr( $authorFontAwesomeClass ) . '"></i>';
$output .= '<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . esc_html( get_the_author() ) . '</a>';
$output .= '</div>';
}
if ( $attributes['enablePostCategory'] ) {
$categories_list = get_the_category_list( esc_html__( ', ', 'gutentor' ) );
if ( $categories_list ) {
$catFontAwesomeClass = (int) gutentor_get_options( 'fa-version' ) === 4 ? 'fa fa-tags' : 'fas fa-tags';
$output .= '<div class="cat-links"><i class="' . esc_attr( $catFontAwesomeClass ) . '"></i>' . $categories_list . '</div>';
}
}
$output .= '</div>';/*.entry-meta*/
if ( $attributes['excerptLength'] > 0 && $attributes['blockSingleItemDescriptionEnable'] ) {
$desc_tag = gutentor_get_title_tag( $attributes['blockSingleItemDescriptionTag'] );
$output .= '<div class="gutentor-post-excerpt gutentor-single-item-desc">';
$output .= "<$desc_tag class='gutentor-single-item-desc'>" . wp_kses_post( gutentor_get_excerpt_by_id( $post->ID, $attributes['excerptLength'] ) ) . "</$desc_tag>";
$output .= '</div>';
}
if ( $attributes['blockSingleItemButtonEnable'] ) {
$default_class = gutentor_concat_space( 'gutentor-button', 'gutentor-single-item-button' );
$icon = ( isset( $attributes['buttonIcon'] ) && $attributes['buttonIcon']['value'] ) ? '<i class="gutentor-button-icon ' . esc_attr( $attributes['buttonIcon']['value'] ) . '" ></i>' : '';
$icon_options = ( isset( $attributes['blockSingleItemButtonIconOptions'] ) ) ? $attributes['blockSingleItemButtonIconOptions'] : '';
$link_options = ( isset( $attributes['blockSingleItemButtonLinkOptions'] ) ) ? $attributes['blockSingleItemButtonLinkOptions'] : '';
$output .= '<a class="' . esc_attr( gutentor_concat_space( $default_class, GutentorButtonOptionsClasses( $icon_options ) ) ) . '" ' . apply_filters( 'gutentor_save_link_attr', '', esc_url( get_permalink() ), $link_options ) . '>' . $icon . '<span>' . esc_html( $attributes['buttonText'] ) . '</span></a>';
}
$output .= '</div>';/*.gutentor-post-content*/
return $output;
}
/**
* Blog Post Templates
*
* @param {string} $data
* @param {array} $post
* @param {array} $attributes
* @return {mix}
*/
public function load_blog_post_template( $data, $post, $attributes ) {
$output = $data;
if ( 'blog-template1' === $attributes['blockBlogTemplate'] ) {
$output = $this->template_1( $data, $post, $attributes );
}
return $output;
}
}
}
Gutentor_Widget_Blog_Post_Templates::get_instance()->run();