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,78 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_E11' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_E11 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'e11';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'magnific-popup' ),
'style_handles' => array( 'magnific-popup' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_E11::get_instance()->run();

View File

@@ -0,0 +1,78 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_E2' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_E2 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'e2';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'magnific-popup' ),
'style_handles' => array( 'magnific-popup' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_E2::get_instance()->run();

View File

@@ -0,0 +1,78 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_E3' ) ) {
/**
* Functions related to Countup
*
* @package Gutentor
* @since 3.2.6
*/
class Gutentor_E3 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.2.6
* @var string
*/
protected $block_name = 'e3';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.2.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.2.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'countUp' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.2.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_E3::get_instance()->run();

View File

@@ -0,0 +1,236 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_E4' ) ) {
/**
* Functions related to Google Map
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_E4 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 'e4';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 1.0.1
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.2.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'gutentor-google-maps', 'google-maps' ),
);
}
/**
* Google Map Attributes Default Value
*
* @since 1.0.0
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function get_default_values() {
$google_map_attr = array(
'id' => '',
'blockID' => '',
'gID' => '',
'e4Loc' => 'La Sagrada Familia, Barcelona, Spain',
'e4Lat' => '41.4036299',
'e4Lon' => '2.1743558000000576',
'e4Type' => 'roadmap',
'e4Zoom' => 15,
'e4Height' => array(
'type' => 'px',
'desktop' => '250',
'tablet' => '250',
'mobile' => '150',
),
'e4Draggable' => true,
'e4TypeCtrl' => true,
'e4ZoomCtrl' => true,
'e4FullScrCtrl' => true,
'e4StreetViewCtrl' => true,
'e4Markers' => array(),
);
$google_map_attr = apply_filters( 'gutentor_element_google_map_get_default_values', $google_map_attr );
return $google_map_attr;
}
/**
* Returns attributes for this Block
*
* @static
* @access public
* @since 1.0.0
* @return array
*/
protected function get_attrs() {
$google_map_attr = array(
'id' => array(
'type' => 'string',
),
'blockID' => array(
'type' => 'string',
),
'gID' => array(
'type' => 'string',
),
'gName' => array(
'type' => 'string',
'default' => 'gutentor/e4',
),
'e4Loc' => array(
'type' => 'string',
'default' => 'La Sagrada Familia, Barcelona, Spain',
),
'e4Lat' => array(
'type' => 'string',
'default' => '41.4036299',
),
'e4Lon' => array(
'type' => 'string',
'default' => '2.1743558000000576',
),
'e4Type' => array(
'type' => 'string',
'default' => 'roadmap',
),
'e4Zoom' => array(
'type' => 'number',
'default' => 15,
),
'e4Height' => array(
'type' => 'object',
'default' => array(
'type' => 'px',
'desktop' => '250',
'tablet' => '250',
'mobile' => '150',
),
),
'e4Draggable' => array(
'type' => 'boolean',
'default' => true,
),
'e4TypeCtrl' => array(
'type' => 'boolean',
'default' => true,
),
'e4ZoomCtrl' => array(
'type' => 'boolean',
'default' => true,
),
'e4FullScrCtrl' => array(
'type' => 'boolean',
'default' => true,
),
'e4StreetViewCtrl' => array(
'type' => 'boolean',
'default' => true,
),
'e4Markers' => array(
'type' => 'object',
'default' => array(),
),
);
return array_merge_recursive( $google_map_attr, $this->get_element_common_attrs() );
}
/**
* Render Google Map Data
*
* @since 1.0.1
* @access public
*
* @param array $attributes
* @param string $content
* @return string
*/
public function render_callback( $attributes, $content ) {
$id = isset( $attributes['id'] ) ? $attributes['id'] : 'gutentor-google-map-' . wp_rand( 10, 100 );
$blockID = isset( $attributes['gID'] ) ? $attributes['gID'] : '';
$class = 'gutentor-google-map';
$default_class = gutentor_block_add_default_classes( 'gutentor-e4', $attributes );
if ( isset( $attributes['className'] ) ) {
$class .= ' ' . $default_class;
}
$align = isset( $attributes['align'] ) ? 'align' . $attributes['align'] : '';
$tag = 'div';
$local_attr = array();
$local_attr['id'] = $id;
$local_attr['location'] = $attributes['e4Loc'];
$local_attr['latitude'] = $attributes['e4Lat'];
$local_attr['longitude'] = $attributes['e4Lon'];
$local_attr['zoom'] = $attributes['e4Zoom'];
$local_attr['type'] = $attributes['e4Type'];
$local_attr['draggable'] = $attributes['e4Draggable'];
$local_attr['mapTypeControl'] = $attributes['e4TypeCtrl'];
$local_attr['zoomControl'] = $attributes['e4ZoomCtrl'];
$local_attr['fullscreenControl'] = $attributes['e4FullScrCtrl'];
$local_attr['streetViewControl'] = $attributes['e4StreetViewCtrl'];
$local_attr['markers'] = $attributes['e4Markers'];
$block_animation_attrs = isset( $attributes['eAnimation'] ) ? $attributes['eAnimation'] : '';
$map_section_class = gutentor_concat_space( 'gutentor-element g-el-gmap', $align );
$map_section_id = 'section-' . $blockID;
$map_section_class = gutentor_concat_space( $map_section_class, $map_section_id );
$class = gutentor_concat_space( $class, $id );
$output = '<' . $tag . ' class="' . esc_attr( apply_filters( 'gutentor_save_element_class', $map_section_class, $attributes ) ) . '" id="section-' . esc_attr( $blockID ) . '" ' . GutentorAnimationOptionsDataAttr( $block_animation_attrs ) . '>' . "\n";
$output .= '<div class="' . esc_attr( apply_filters( 'gutentor_save_grid_row_class', gutentor_concat_space( esc_attr( $class ), 'gutentor-grid-item-wrap' ), $attributes ) ) . '" id="' . esc_attr( $id ) . '"></div>' . "\n";
$output .= '</' . $tag . '>' . "\n";
$output .= '<script type="text/javascript">' . "\n";
$output .= ' /* <![CDATA[ */' . "\n";
$output .= ' if ( ! window.gutentorGoogleMaps ) window.gutentorGoogleMaps =[];' . "\n";
$output .= ' window.gutentorGoogleMaps.push( { container: "' . esc_attr( $id ) . '", attributes: ' . wp_json_encode( $local_attr ) . ' } );' . "\n";
$output .= ' /* ]]> */' . "\n";
$output .= '</script>' . "\n";
return $output;
}
}
}
Gutentor_E4::get_instance()->run();

View File

@@ -0,0 +1,77 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_E9' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_E9 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'e9';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'jquery-easypiechart' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_E9::get_instance()->run();

View File

@@ -0,0 +1,78 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_M0' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_M0 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'm0';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'slick' ),
'style_handles' => array( 'slick' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_M0::get_instance()->run();

View File

@@ -0,0 +1,78 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_M10' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_M10 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'm10';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'magnific-popup', 'isotope', 'masonry' ),
'style_handles' => array( 'magnific-popup' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_M10::get_instance()->run();

View File

@@ -0,0 +1,77 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_M4' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_M4 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'm4';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'theia-sticky-sidebar' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_M4::get_instance()->run();

View File

@@ -0,0 +1,78 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_M5' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_M5 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'm5';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'slick' ),
'style_handles' => array( 'slick' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_M5::get_instance()->run();

View File

@@ -0,0 +1,448 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_P1' ) ) {
/**
* Functions related to Blog Post
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_P1 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 'p1';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @return object
* @since 1.0.1
*/
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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'magnific-popup', 'masonry' ),
'style_handles' => array( 'magnific-popup' ),
);
}
/**
* Load Dependencies
* Used for blog template loading
*
* @since 1.0.1
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function load_dependencies() {
require_once GUTENTOR_PATH . 'includes/block-templates/normal/class-normal-p1-templates.php';
require_once GUTENTOR_PATH . 'includes/block-templates/normal/class-normal-p1-woo-templates.php';
require_once GUTENTOR_PATH . 'includes/block-templates/normal/class-normal-p1-edd-templates.php';
}
/**
* Returns attributes for this Block
*
* @static
* @access public
* @return array
* @since 1.0.1
*/
public function get_attrs() {
$blog_post_attr = array(
'gID' => array(
'type' => 'string',
'default' => '',
),
/*column*/
'blockItemsColumn' => array(
'type' => 'object',
'default' => array(
'desktop' => 'grid-md-4',
'tablet' => 'grid-sm-4',
'mobile' => 'grid-xs-12',
),
),
'timestamp' => array(
'type' => 'number',
'default' => 0,
),
'gName' => array(
'type' => 'string',
'default' => 'gutentor/p1',
),
'p1Temp' => array(
'type' => 'string',
'default' => 'gutentor_p1_template1',
),
'gStyle' => array(
'type' => 'string',
'default' => 'gutentor-blog-grid',
),
'pTaxTerm' => array(
'type' => 'array',
'items' => array(
'type' => 'object',
'label' => array(
'type' => 'string',
),
'value' => array(
'type' => 'number',
),
),
),
'pTaxType' => array(
'type' => 'string',
'default' => 'category',
),
'pTaxOperator' => array(
'type' => 'string',
'default' => 'IN',
),
'pPostType' => array(
'type' => 'string',
'default' => 'post',
),
'pIncludePosts' => array(
'type' => 'string',
),
'pExcludePosts' => array(
'type' => 'string',
),
'pOffsetPosts' => array(
'type' => 'number',
),
'postsToShow' => array(
'type' => 'number',
'default' => 6,
),
'order' => array(
'type' => 'string',
'default' => 'desc',
),
'orderBy' => array(
'type' => 'string',
'default' => 'date',
),
'pNoFoundTxt' => array(
'type' => 'string',
'default' => 'Nothing Found',
),
'pEqlHeight' => array(
'type' => 'boolean',
'default' => false,
),
'categories' => array(
'type' => 'string',
'default' => '',
),
'gutentorBlogPostImageLink' => array(
'type' => 'boolean',
'default' => false,
),
'pReverseContent' => array(
'type' => 'boolean',
'default' => false,
),
'pOnColInList' => array(
'type' => 'boolean',
'default' => false,
),
'gutentorBlogPostImageLinkNewTab' => array(
'type' => 'boolean',
'default' => false,
),
'pContentPos' => array(
'type' => 'object',
'default' => array(
'desktop' => 'g-pos-center',
'tablet' => 'g-pos-center',
'mobile' => 'g-pos-center',
),
),
'pMsyOn' => array(
'type' => 'boolean',
'default' => false,
),
'pTimeline' => array(
'type' => 'object',
'default' => array(
'enable' => false,
/*icon*/
'icon' => array(
'label' => 'fa-arrow-down',
'value' => (int) gutentor_get_options( 'fa-version' ) === 4 ? 'fa fa-arrow-down' : 'fas fa-arrow-down',
'code' => 'f108',
),
'iSize' => array(
'type' => 'px',
'mobile' => 10,
),
'iColor' => array(
'enable' => true,
'normal' => '#fff',
),
/*node*/
'nBgColor' => array(
'enable' => true,
'normal' => '#d5dee6',
),
'nWidth' => array(
'enable' => true,
'type' => 'px',
'mobile' => 30,
),
'nHeight' => array(
'enable' => true,
'type' => 'px',
'mobile' => 30,
),
'border' => array(
'rTypeN' => '%',
'rTopN' => '50',
'rRightN' => '50',
'rBottomN' => '50',
'rLeftN' => '50',
),
/*width*/
'lColor' => array(
'enable' => true,
'normal' => '#d5dee6',
),
'lWidth' => array(
'enable' => true,
'type' => 'px',
'mobile' => 3,
),
),
),
'pTypeWpQuery' => array(
'type' => 'string',
'default' => 'default',
),
'pWpQuery' => array(
'type' => 'string',
'default' => '',
),
'pImgDisplayType' => array(
'type' => 'string',
'default' => 'bg-image',
),
);
$blog_partial_attrs = array_merge_recursive( $blog_post_attr, $this->get_module_common_attrs() );
return array_merge_recursive( $blog_partial_attrs, $this->get_module_query_elements_common_attrs() );
}
/**
* Render Blog Post Data
*
* @param array $attributes
* @param string $content
* @return string
* @since 1.0.1
* @access public
*/
public function render_callback( $attributes, $content ) {
$blockID = isset( $attributes['pID'] ) ? $attributes['pID'] : $attributes['gID'];
$gID = isset( $attributes['gID'] ) ? $attributes['gID'] : '';
$pTypeWpQuery = isset( $attributes['pTypeWpQuery'] ) ? $attributes['pTypeWpQuery'] : false;
$output = '';
$default_class = gutentor_block_add_default_classes( 'gutentor-p1', $attributes );
$tag = $attributes['mTag'] ? $attributes['mTag'] : 'div';
$pFType = $attributes['pFType'] ? $attributes['pFType'] : '';
$template = $attributes['p1Temp'] ? $attributes['p1Temp'] : '';
$enable_equal_height = isset( $attributes['pEqlHeight'] ) && $attributes['pEqlHeight'] ? 'g-equal-height' : '';
$align = isset( $attributes['align'] ) ? 'align' . $attributes['align'] : '';
$blockComponentAnimation = isset( $attributes['mAnimation'] ) ? $attributes['mAnimation'] : '';
$post_type = isset( $attributes['pPostType'] ) ? $attributes['pPostType'] : '';
$nothing_found_text = isset( $attributes['pNoFoundTxt'] ) ? $attributes['pNoFoundTxt'] : '';
$thumbnail_enable = isset( $attributes['pOnFImg'] ) ? $attributes['pOnFImg'] : false;
$timeline = isset( $attributes['pTimeline'] ) ? $attributes['pTimeline'] : false;
$timelineEnable = is_array( $timeline ) && array_key_exists( 'enable', $timeline ) ? $timeline['enable'] : false;
$timelineClass = '';
$thumb_class = '';
$access_no_thumbnail = array( 'product', 'download' );
$gptm_class = $template === 'gutentor_p1_template5' ? 'gptm-item' : '';
$pImgDisplayType = ( isset( $attributes['pImgDisplayType'] ) ) ? $attributes['pImgDisplayType'] : false;
/*query args*/
$query_args = array(
'posts_per_page' => isset( $attributes['postsToShow'] ) ? $attributes['postsToShow'] : 6,
'post_type' => isset( $attributes['pPostType'] ) ? $attributes['pPostType'] : 'post',
'orderby' => isset( $attributes['orderBy'] ) ? $attributes['orderBy'] : 'date',
'order' => isset( $attributes['order'] ) ? $attributes['order'] : 'desc',
'paged' => isset( $attributes['paged'] ) ? $attributes['paged'] : 1,
'ignore_sticky_posts' => true,
'post_status' => 'publish',
);
/*load custom template search*/
global $wp_query;
$gutentor_template = $wp_query->get(
'gutentor-templates'
);
if ( isset( $gutentor_template['type'] ) && $gutentor_template['type'] === 'search' ) {
$query_args['s'] = $gutentor_template['s'];
}
if ( $pTypeWpQuery === 'default' ) {
/*Backward compatible*/
if ( isset( $attributes['categories'] ) && ! empty( $attributes['categories'] ) ) {
if ( is_array( $attributes['categories'] ) && ! gutentor_is_array_empty( $attributes['categories'] ) ) {
$query_args['taxonomy'] = 'category';
$query_args['term'] = $attributes['categories'];
}
if ( ! is_array( $attributes['categories'] ) ) {
$query_args['taxonomy'] = 'category';
$query_args['term'] = $attributes['categories'];
}
}
if ( isset( $attributes['pTaxType'] ) && ! empty( $attributes['pTaxType'] ) &&
isset( $attributes['pTaxTerm'] ) && ! empty( $attributes['pTaxTerm'] ) ) {
$query_args['taxonomy'] = $attributes['pTaxType'];
$query_args['taxOperator'] = $attributes['pTaxOperator'] ? $attributes['pTaxOperator'] : 'IN';
if ( is_array( $attributes['pTaxTerm'] ) ) {
$p1_terms = array();
foreach ( $attributes['pTaxTerm'] as $p1_term ) {
$p1_terms [] = $p1_term['value'];
}
$query_args['term'] = $p1_terms;
} elseif ( is_string( $attributes['pTaxTerm'] ) || is_numeric( $attributes['pTaxTerm'] ) ) {
$query_args['term'] = $attributes['pTaxTerm'];
}
}
if ( isset( $attributes['pAuthor'] ) && ! empty( $attributes['pAuthor'] ) ) {
if ( is_array( $attributes['pAuthor'] ) ) {
$author_list = array();
foreach ( $attributes['pAuthor'] as $data ) {
$author_list[] = $data['value'];
}
$query_args['author__in'] = $author_list;
}
}
if ( isset( $attributes['pOffsetPosts'] ) ) {
$query_args['offset'] = $attributes['pOffsetPosts'];
}
if ( isset( $attributes['pIncludePosts'] ) && ! empty( $attributes['pIncludePosts'] ) ) {
$query_args['post__in'] = $attributes['pIncludePosts'];
}
if ( isset( $attributes['pExcludePosts'] ) && ! empty( $attributes['pExcludePosts'] ) ) {
$query_args['post__not_in'] = $attributes['pExcludePosts'];
}
/*Search query*/
if ( isset( $attributes['s'] ) && ! empty( $attributes['s'] ) ) {
$query_args['s'] = $attributes['s'];
}
}
if ( $pTypeWpQuery === 'custom' ) {
$pWpQueryJson = isset( $attributes['pWpQuery'] ) ? $attributes['pWpQuery'] : false;
$pWpQueryData = json_decode( $pWpQueryJson, true );
$query_args = array_merge( $query_args, $pWpQueryData );
}
$the_query = new WP_Query( gutentor_get_query( $query_args ) );
$tag = gutentor_get_module_tag( $tag );
$output .= '<' . esc_attr( $tag ) . ' class="' . esc_attr( apply_filters( 'gutentor_post_module_main_wrap_class', gutentor_concat_space( 'gutentor-post-module', 'section-' . $gID, 'gutentor-post-module-p1', $template, $align, $default_class, $enable_equal_height ), $attributes ) ) . '" id="' . esc_attr( $blockID ) . '" data-gbid="' . esc_attr( $gID ) . '" ' . GutentorAnimationOptionsDataAttr( $blockComponentAnimation ) . '>' . "\n";
$output .= apply_filters( 'gutentor_post_module_before_container', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_container_class', 'grid-container', $attributes ) ) . "'>";
$output .= apply_filters( 'gutentor_post_module_before_block_items', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "' " . gutentor_get_html_attr( apply_filters( 'gutentor_post_module_attr', array(), $attributes ) ) . '>';
$cat_style = '';
$post_categories = array();
if ( $the_query->have_posts() ) :
$index = 0;
while ( $the_query->have_posts() ) :
$the_query->the_post();
$post_categories = array_merge( $post_categories, wp_get_post_categories( get_the_ID() ) );
$video_url = get_post_meta( get_the_ID(), 'gutentor_meta_video_url', true );
$video_id = get_post_meta( get_the_ID(), 'gutentor_meta_video_id', true );
if ( ! in_array( $post_type, $access_no_thumbnail ) ) {
$thumb_class = has_post_thumbnail() && $thumbnail_enable ? '' : 'gutentor-post-no-thumb';
$thumb_class = ( ( $video_url || $video_id ) && gutentor_pro_active() && $pFType === 'video' ) ? '' : $thumb_class;
$thumb_class = $template === 'gutentor_p1_template5' && $pImgDisplayType === 'normal-image' ? '' : $thumb_class;
}
if ( $timelineEnable ) {
if ( $index % 2 === 0 ) {
$timelineClass = 'g-timeline-even';
} else {
$timelineClass = 'g-timeline-odd';
}
}
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_column_class', gutentor_concat_space( 'gutentor-post', $thumb_class, $timelineClass ), $attributes ) ) . "'>";
if ( $timelineEnable ) {
$output .= "<div class='g-timeline-post-wrap'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_item', gutentor_concat_space( 'gutentor-post-item', $gptm_class ), $attributes ) ) . "'>";
$output .= apply_filters( 'gutentor_post_module_p1_query_data', '', get_post(), $attributes );
$output .= '</div>';/*.gutentor-post-item*/
$output .= '</div>';/*.g-timeline-post-wrap*/
$output .= apply_filters( 'gutentor_post_module_p1_query_data_after', '', get_post(), $attributes );
} else {
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_post_item', gutentor_concat_space( 'gutentor-post-item', $gptm_class ), $attributes ) ) . "'>";
$output .= apply_filters( 'gutentor_post_module_p1_query_data', '', get_post(), $attributes );
$output .= '</div>';/*.gutentor-post-item*/
}
$output .= '</article>';/*.article*/
++$index;
endwhile;
else :
$output .= '<header class="g-n-f-t-1"><h2 class="g-n-f-title">' . esc_html( $nothing_found_text ) . '</h2></header>';
endif;
$output .= '</div>';/*.grid-row*/
$output .= apply_filters( 'gutentor_post_module_after_block_items', '', $attributes );
$output .= '</div>';/*.grid-container*/
$output .= apply_filters( 'gutentor_post_module_after_container', '', $attributes );
if ( $post_categories && $content === 'ajax' ) {
$cat_style = gutentor_pm_post_dynamic_categories_color( array_unique( $post_categories ) );
$output .= '<style>' . wp_strip_all_tags( $cat_style ) . '</style>';
}
$output .= '</' . esc_attr( $tag ) . '>';/*
.gutentor-blog-post-wrapper*/
// Restore original Post Data
wp_reset_postdata();
return $output;
}
}
}
Gutentor_P1::get_instance()->run();

View File

@@ -0,0 +1,291 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_P2' ) ) {
/**
* Functions related to Blog Post
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_P2 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 'p2';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 1.0.1
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'magnific-popup' ),
'style_handles' => array( 'magnific-popup' ),
);
}
/**
* Returns attributes for this Block
*
* @static
* @access public
* @since 1.0.1
* @return array
*/
protected function get_attrs() {
$blog_post_attr = array(
'gID' => array(
'type' => 'string',
'default' => '',
),
'gName' => array(
'type' => 'string',
'default' => 'gutentor/p2',
),
'p2Temp' => array(
'type' => 'number',
'default' => 1,
),
'pTaxType' => array(
'type' => 'string',
'default' => 'category',
),
'pTaxOperator' => array(
'type' => 'string',
'default' => 'IN',
),
'pTaxTerm' => array(
'type' => 'array',
'items' => array(
'type' => 'object',
'label' => array(
'type' => 'string',
),
'value' => array(
'type' => 'number',
),
),
),
'pPostType' => array(
'type' => 'string',
'default' => 'post',
),
'pIncludePosts' => array(
'type' => 'string',
),
'pExcludePosts' => array(
'type' => 'string',
),
'pOffsetPosts' => array(
'type' => 'number',
),
'postsToShow' => array(
'type' => 'number',
'default' => 6,
),
'order' => array(
'type' => 'string',
'default' => 'desc',
),
'orderBy' => array(
'type' => 'string',
'default' => 'date',
),
'categories' => array(
'type' => 'string',
'default' => '',
),
'gutentorBlogPostImageLink' => array(
'type' => 'boolean',
'default' => false,
),
'pReverseContent' => array(
'type' => 'boolean',
'default' => false,
),
'gutentorBlogPostImageLinkNewTab' => array(
'type' => 'boolean',
'default' => false,
),
'p1BgProps' => array(
'type' => 'object',
'default' => array(
'size' => 'cover',
'pos' => 'center',
'repeat' => 'no-repeat',
'attachment' => 'scroll',
),
),
'p1FImageOnHeight' => array(
'type' => 'boolean',
'default' => false,
),
'p1FImageHeight' => array(
'type' => 'boolean',
'default' => false,
),
'pContentPos' => array(
'type' => 'object',
'default' => array(
'desktop' => 'g-pos-bottom',
'tablet' => 'g-pos-bottom',
'mobile' => 'g-pos-bottom',
),
),
);
$blog_partial_attrs = array_merge_recursive( $blog_post_attr, $this->get_module_common_attrs() );
return array_merge_recursive( $blog_partial_attrs, $this->get_module_query_elements_common_attrs() );
}
/**
* Render Blog Post Data
*
* @since 1.0.1
* @access public
*
* @param array $attributes
* @param string $content
* @return string
*/
public function render_callback( $attributes, $content ) {
$blockID = isset( $attributes['pID'] ) ? $attributes['pID'] : $attributes['gID'];
$gID = isset( $attributes['gID'] ) ? $attributes['gID'] : '';
$output = '';
$default_class = gutentor_block_add_default_classes( 'gutentor-p2', $attributes );
$tag = $attributes['mTag'] ? $attributes['mTag'] : 'section';
$template = $attributes['p2Temp'] ? $attributes['p2Temp'] : '';
$post_number = $attributes['postsToShow'] ? $attributes['postsToShow'] : '';
$align = isset( $attributes['align'] ) ? 'align' . $attributes['align'] : '';
$blockComponentAnimation = isset( $attributes['mAnimation'] ) ? $attributes['mAnimation'] : '';
/*query args*/
$query_args = array(
'posts_per_page' => isset( $attributes['postsToShow'] ) ? $attributes['postsToShow'] : 6,
'post_type' => isset( $attributes['pPostType'] ) ? $attributes['pPostType'] : 'post',
'orderby' => isset( $attributes['orderBy'] ) ? $attributes['orderBy'] : 'date',
'order' => isset( $attributes['order'] ) ? $attributes['order'] : 'desc',
'paged' => isset( $attributes['paged'] ) ? $attributes['paged'] : 1,
'ignore_sticky_posts' => true,
'post_status' => 'publish',
);
/*Backward compatible*/
if ( isset( $attributes['categories'] ) && ! empty( $attributes['categories'] ) ) {
if ( is_array( $attributes['categories'] ) && ! gutentor_is_array_empty( $attributes['categories'] ) ) {
$query_args['taxonomy'] = 'category';
$query_args['term'] = $attributes['categories'];
}
if ( ! is_array( $attributes['categories'] ) ) {
$query_args['taxonomy'] = 'category';
$query_args['term'] = $attributes['categories'];
}
}
if ( isset( $attributes['pTaxType'] ) && ! empty( $attributes['pTaxType'] ) &&
isset( $attributes['pTaxTerm'] ) && ! empty( $attributes['pTaxTerm'] ) ) {
$query_args['taxonomy'] = $attributes['pTaxType'];
$query_args['taxOperator'] = $attributes['pTaxOperator'] ? $attributes['pTaxOperator'] : 'IN';
if ( is_array( $attributes['pTaxTerm'] ) ) {
$p2_terms = array();
foreach ( $attributes['pTaxTerm'] as $p2_term ) {
$p2_terms [] = $p2_term['value'];
}
$query_args['term'] = $p2_terms;
} elseif ( is_string( $attributes['pTaxTerm'] ) || is_numeric( $attributes['pTaxTerm'] ) ) {
$query_args['term'] = $attributes['pTaxTerm'];
}
}
if ( isset( $attributes['pAuthor'] ) && ! empty( $attributes['pAuthor'] ) ) {
if ( is_array( $attributes['pAuthor'] ) ) {
$author_list = array();
foreach ( $attributes['pAuthor'] as $data ) {
$author_list[] = $data['value'];
}
$query_args['author__in'] = $author_list;
}
}
if ( isset( $attributes['offset'] ) ) {
$query_args['offset'] = $attributes['offset'];
}
if ( isset( $attributes['pIncludePosts'] ) && ! empty( $attributes['pIncludePosts'] ) ) {
$query_args['post__in'] = $attributes['pIncludePosts'];
}
if ( isset( $attributes['pExcludePosts'] ) && ! empty( $attributes['pExcludePosts'] ) ) {
$query_args['post__not_in'] = $attributes['pExcludePosts'];
}
if ( isset( $attributes['pOffsetPosts'] ) ) {
$query_args['offset'] = $attributes['pOffsetPosts'];
}
$gutentor_p2_news_the_query = new WP_Query( gutentor_get_query( $query_args ) );
if ( $gutentor_p2_news_the_query->have_posts() ) :
$tag = gutentor_get_module_tag( $tag );
$output .= '<' . esc_attr( $tag ) . ' class="' . esc_attr( apply_filters( 'gutentor_post_module_main_wrap_class', gutentor_concat_space( 'section-' . $gID, 'gutentor-post-module', 'gutentor-post-module-p2', 'gutentor-post-' . $post_number, $align, 'gutentor-template-' . $template, $default_class ), $attributes ) ) . '" id="' . esc_attr( $blockID ) . '" ' . GutentorAnimationOptionsDataAttr( $blockComponentAnimation ) . '>' . "\n";
$output .= apply_filters( 'gutentor_post_module_before_container', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_container_class', 'grid-container', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "'>";
$output .= apply_filters( 'gutentor_post_module_before_block_items', '', $attributes );
/*post query*/
$output .= apply_filters( 'gutentor_post_module_p2_query_data', '', $gutentor_p2_news_the_query, $attributes );
$output .= apply_filters( 'gutentor_post_module_after_block_items', '', $attributes );
$output .= '</div>';/*.grid-row*/
$output .= '</div>';/*.grid-container*/
$output .= apply_filters( 'gutentor_post_module_after_container', '', $attributes );
$output .= '</' . esc_attr( $tag ) . '>';/*.gutentor-blog-post-wrapper*/
endif;
// Restore original Post Data.
wp_reset_postdata();
return $output;
}
}
}
Gutentor_P2::get_instance()->run();

View File

@@ -0,0 +1,335 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_P3_Hooks' ) ) {
/**
* Block Specific Hooks Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_P3_Hooks extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 'p3';
/**
* Prevent some functions to called many times
*
* @access private
* @since 2.0.0
* @var integer
*/
private static $counter = 0;
/**
* 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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'slick' ),
'style_handles' => array( 'slick' ),
);
}
/**
* Add Filter
*
* @access public
* @since 2.0.0
* @return void
*/
public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
add_filter( $hook, array( $component, $callback ), $priority, $accepted_args );
}
/**
* Add Action
*
* @access public
* @since 2.0.0
* @return void
*/
public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
add_action( $hook, array( $component, $callback ), $priority, $accepted_args );
}
/**
* Run Block
*
* @access public
* @since 2.0.0
* @return void
*/
public function run() {
parent::run();
/*Block Specific PHP hooks*/
$this->add_filter( 'gutentor_post_module_main_wrap_class', $this, 'add_carousel_arrow_class', 15, 2 );
$this->add_filter( 'gutentor_post_module_grid_row_class', $this, 'add_carousel_row', 15, 2 );
$this->add_filter( 'gutentor_post_module_attr', $this, 'add_carousel_data', 15, 2 );
$this->add_filter( 'gutentor_post_module_grid_column_class', $this, 'add_carousel_class', 15, 2 );
$this->add_filter( 'gutentor_post_module_before_block_items', $this, 'add_carousel_arrow', 15, 2 );
}
/**
* Adding Carousel Class
*
* @param {array} output
* @param {object} props
* @return {array}
*/
public function add_carousel_arrow_class( $output, $attributes ) {
$gutentorBlockName = ( isset( $attributes['gName'] ) ) ? $attributes['gName'] : '';
$block_list = array( 'gutentor/p1' );
if ( ! in_array( $gutentorBlockName, $block_list ) ) {
return $output;
}
if ( ! isset( $attributes['p1CarouselOpt'] ) || ! $attributes['p1CarouselOpt']['enable'] ) {
return $output;
}
if ( ! isset( $attributes['p1CarouselOpt']['arrowsPosition'] ) ) {
return $output;
}
$arrow_position = $attributes['p1CarouselOpt']['arrowsPosition'];
$enable_desktop_arrow = isset( $attributes['p1CarouselOpt']['arrows'] ) && $attributes['p1CarouselOpt']['arrows'];
$enable_tablet_arrow = isset( $attributes['p1CarouselOpt']['arrowsT'] ) && $attributes['p1CarouselOpt']['arrowsT'];
$enable_mobile_arrow = isset( $attributes['p1CarouselOpt']['arrowsM'] ) && $attributes['p1CarouselOpt']['arrowsM'];
$arrow_position_desktop = array_key_exists( 'desktop', $arrow_position ) ? $arrow_position['desktop'] : false;
if ( $enable_desktop_arrow && $arrow_position_desktop ) {
$output = gutentor_concat_space( $output, $arrow_position_desktop . '-desktop' );
}
$arrow_position_tablet = array_key_exists( 'tablet', $arrow_position ) ? $arrow_position['tablet'] : false;
if ( $enable_tablet_arrow && $arrow_position_tablet ) {
$output = gutentor_concat_space( $output, $arrow_position_tablet . '-tablet' );
}
$arrow_position_mobile = array_key_exists( 'mobile', $arrow_position ) ? $arrow_position['mobile'] : false;
if ( $enable_mobile_arrow && $arrow_position_mobile ) {
$output = gutentor_concat_space( $output, $arrow_position_mobile . '-mobile' );
}
return $output;
}
/**
* Adding Container Remove Classes
*
* @param {array} output
* @param {object} props
* @return string
*/
public function add_carousel_row( $output, $attributes ) {
if ( ! isset( $attributes['p1CarouselOpt'] ) || ! $attributes['p1CarouselOpt']['enable'] ) {
return $output;
}
$local_data = str_replace( 'grid-row', '', $output );
if ( isset( $attributes['p1CarouselOpt']['carouselID'] ) ) {
$local_data = gutentor_concat_space( $local_data, $attributes['p1CarouselOpt']['carouselID'] );
}
return gutentor_concat_space( $local_data, 'gutentor-module-carousel-row' );
}
/**
* Adding Carousel Data
*
* @param {array} output
* @param {object} props
* @return {array}
*/
public function add_carousel_data( $output, $attributes ) {
if ( ! isset( $attributes['p1CarouselOpt'] ) || ! $attributes['p1CarouselOpt']['enable'] ) {
return $output;
}
$p1CarouselOpt = $attributes['p1CarouselOpt'];
$local_data = array();
if ( isset( $p1CarouselOpt['dots'] ) ) {
$local_data['data-dots'] = ( $p1CarouselOpt['dots'] ) ? 'true' : 'false';
}
if ( isset( $p1CarouselOpt['dotsT'] ) ) {
$local_data['data-dotstablet'] = ( $p1CarouselOpt['dotsT'] ) ? 'true' : 'false';
}
if ( isset( $p1CarouselOpt['dotsM'] ) ) {
$local_data['data-dotsmobile'] = ( $p1CarouselOpt['dotsM'] ) ? 'true' : 'false';
}
if ( isset( $p1CarouselOpt['arrowNext'] ) ) {
$local_data['data-nextarrow'] = ( $p1CarouselOpt['arrowNext'] ) ? $p1CarouselOpt['arrowNext'] : '';
}
if ( isset( $p1CarouselOpt['arrowsPrev'] ) ) {
$local_data['data-prevarrow'] = ( $p1CarouselOpt['arrowsPrev'] ) ? $p1CarouselOpt['arrowsPrev'] : '';
}
if ( isset( $p1CarouselOpt['arrows'] ) ) {
$local_data['data-arrows'] = ( $p1CarouselOpt['arrows'] ) ? 'true' : 'false';
}
if ( isset( $p1CarouselOpt['arrowsT'] ) ) {
$local_data['data-arrowstablet'] = ( $p1CarouselOpt['arrowsT'] ) ? 'true' : 'false';
}
if ( isset( $p1CarouselOpt['arrowsM'] ) ) {
$local_data['data-arrowsmobile'] = ( $p1CarouselOpt['arrowsM'] ) ? 'true' : 'false';
}
if ( isset( $p1CarouselOpt['arrowsPosition']['desktop'] ) ) {
$local_data['data-arrowsPositionDesktop'] = ( $p1CarouselOpt['arrowsPosition']['desktop'] . '-desktop' );
}
if ( isset( $p1CarouselOpt['arrowsPosition']['tablet'] ) ) {
$local_data['data-arrowsPositionTablet'] = ( $p1CarouselOpt['arrowsPosition']['tablet'] . '-tablet' );
}
if ( isset( $p1CarouselOpt['arrowsPosition']['mobile'] ) ) {
$local_data['data-arrowsPositionMobile'] = ( $p1CarouselOpt['arrowsPosition']['mobile'] . '-mobile' );
}
if ( isset( $p1CarouselOpt['infinite'] ) ) {
$local_data['data-infinite'] = ( $p1CarouselOpt['infinite'] ) ? 'true' : 'false';
}
if ( isset( $p1CarouselOpt['speed'] ) ) {
$local_data['data-speed'] = $p1CarouselOpt['speed'];
}
if ( isset( $p1CarouselOpt['autoplay'] ) ) {
$local_data['data-autoplay'] = ( $p1CarouselOpt['autoplay'] ) ? 'true' : 'false';
if ( isset( $p1CarouselOpt['autoplaySpeed'] ) ) {
$local_data['data-autoplayspeed'] = $p1CarouselOpt['autoplaySpeed'];
}
if ( isset( $p1CarouselOpt['pauseOnFocus'] ) ) {
$local_data['data-pauseonfocus'] = ( $p1CarouselOpt['pauseOnFocus'] ) ? 'true' : 'false';
}
if ( isset( $p1CarouselOpt['pauseOnHover'] ) ) {
$local_data['data-pauseonhover'] = ( $p1CarouselOpt['pauseOnHover'] ) ? 'true' : 'false';
}
}
if ( isset( $p1CarouselOpt['draggable'] ) ) {
$local_data['data-draggable'] = ( $p1CarouselOpt['draggable'] ) ? 'true' : 'false';
}
/*center mode*/
if ( isset( $p1CarouselOpt['cmondesktop'] ) ) {
$local_data['data-cmondesktop'] = ( $p1CarouselOpt['cmondesktop'] ) ? 'true' : 'false';
if ( isset( $p1CarouselOpt['cmpaddingdesktop'] ) ) {
$local_data['data-cmpaddingdesktop'] = ( $p1CarouselOpt['cmpaddingdesktop'] ) ? $p1CarouselOpt['cmpaddingdesktop'] : '';
}
}
if ( isset( $p1CarouselOpt['cmontablet'] ) ) {
$local_data['data-cmontablet'] = ( $p1CarouselOpt['cmontablet'] ) ? 'true' : 'false';
if ( isset( $p1CarouselOpt['cmpaddingtablet'] ) ) {
$local_data['data-cmpaddingtablet'] = ( $p1CarouselOpt['cmpaddingtablet'] ) ? $p1CarouselOpt['cmpaddingtablet'] : '';
}
}
if ( isset( $p1CarouselOpt['cmonmobile'] ) ) {
$local_data['data-cmonmobile'] = ( $p1CarouselOpt['cmonmobile'] ) ? 'true' : 'false';
if ( isset( $p1CarouselOpt['cmpaddingmobile'] ) ) {
$local_data['data-cmpaddingmobile'] = ( $p1CarouselOpt['cmpaddingmobile'] ) ? $p1CarouselOpt['cmpaddingmobile'] : '';
}
}
if ( isset( $p1CarouselOpt['slideitem']['desktop'] ) ) {
$local_data['data-slideitemdesktop'] = $p1CarouselOpt['slideitem']['desktop'];
}
if ( isset( $p1CarouselOpt['slideitem']['tablet'] ) ) {
$local_data['data-slideitemtablet'] = $p1CarouselOpt['slideitem']['tablet'];
}
if ( isset( $p1CarouselOpt['slideitem']['mobile'] ) ) {
$local_data['data-slideitemmobile'] = $p1CarouselOpt['slideitem']['mobile'];
}
if ( isset( $p1CarouselOpt['slidescroll']['desktop'] ) ) {
$local_data['data-slidescroll-desktop'] = $p1CarouselOpt['slidescroll']['desktop'];
}
if ( isset( $p1CarouselOpt['slidescroll']['tablet'] ) ) {
$local_data['data-slidescroll-tablet'] = $p1CarouselOpt['slidescroll']['tablet'];
}
if ( isset( $p1CarouselOpt['slidescroll']['mobile'] ) ) {
$local_data['data-slidescroll-mobile'] = $p1CarouselOpt['slidescroll']['mobile'];
}
return $local_data;
}
/**
* Adding carousel class
*
* @param {array} output
* @param {object} props
* @return {array}
*/
public function add_carousel_class( $output, $attributes ) {
if ( ! isset( $attributes['p1CarouselOpt'] ) || ! $attributes['p1CarouselOpt']['enable'] ) {
return $output;
}
return gutentor_concat_space( $output, 'gutentor-carousel-item' );
}
/**
* Adding carousel class
*
* @param {array} output
* @param {object} props
* @return {array}
*/
public function add_carousel_arrow( $output, $attributes ) {
$gutentorBlockName = ( isset( $attributes['gName'] ) ) ? $attributes['gName'] : '';
$block_list = array( 'gutentor/p1' );
if ( ! in_array( $gutentorBlockName, $block_list ) ) {
return $output;
}
if ( ! isset( $attributes['p1CarouselOpt'] ) || ! $attributes['p1CarouselOpt']['enable'] ) {
return $output;
}
$p1CarouselOpt = ( isset( $attributes['p1CarouselOpt'] ) && $attributes['p1CarouselOpt']['enable'] ) ? $attributes['p1CarouselOpt'] : false;
$desktop_row_position = ( $p1CarouselOpt && isset( $p1CarouselOpt['arrowsPosition']['desktop'] ) && $p1CarouselOpt['arrowsPosition']['desktop'] ) ? $p1CarouselOpt['arrowsPosition']['desktop'] . '-desktop' : false;
if ( $desktop_row_position != 'gutentor-slick-a-default-desktop' ) {
$output .= '<div class="gutentor-slick-arrows"></div>';
}
return $output;
}
}
}
/**
* Return instance of Gutentor_P3_Hooks class
*
* @since 1.0.0
*/
if ( ! function_exists( 'gutentor_p3_hooks' ) ) {
function gutentor_p3_hooks() {
return Gutentor_P3_Hooks::get_instance();
}
}
gutentor_p3_hooks()->run();

View File

@@ -0,0 +1,77 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_P4' ) ) {
/**
* Functions related to Google Map
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_P4 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 'p4';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 1.0.1
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 1.0.1
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'flexMenu' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 1.0.1
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_P4::get_instance()->run();

View File

@@ -0,0 +1,313 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_P5' ) ) {
/**
* Functions related to Blog Post
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_P5 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 'p5';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @return object
* @since 1.0.1
*/
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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 1.0.1
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'acmeticker' ),
);
}
/**
* Load Dependencies
* Used for blog template loading
*
* @since 1.0.1
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function load_dependencies() {
require_once GUTENTOR_PATH . 'includes/block-templates/ticker/class-ticker-p5-templates.php';
}
/**
* Returns attributes for this Block
*
* @static
* @access public
* @return array
* @since 1.0.1
*/
public function get_attrs() {
$blog_post_attr = array(
'gID' => array(
'type' => 'string',
'default' => '',
),
'timestamp' => array(
'type' => 'number',
'default' => 0,
),
'gName' => array(
'type' => 'string',
'default' => 'gutentor/p5',
),
'p5Temp' => array(
'type' => 'string',
'default' => 'gutentor_p5_template1',
),
'pTaxType' => array(
'type' => 'string',
'default' => 'category',
),
'pTaxOperator' => array(
'type' => 'string',
'default' => 'IN',
),
'pTaxTerm' => array(
'type' => 'array',
'items' => array(
'type' => 'object',
'label' => array(
'type' => 'string',
),
'value' => array(
'type' => 'number',
),
),
),
'pPostType' => array(
'type' => 'string',
'default' => 'post',
),
'pIncludePosts' => array(
'type' => 'string',
),
'pExcludePosts' => array(
'type' => 'string',
),
'pOffsetPosts' => array(
'type' => 'number',
),
'gStyle' => array(
'type' => 'string',
'default' => 'gutentor-blog-grid',
),
'postsToShow' => array(
'type' => 'number',
'default' => 6,
),
'order' => array(
'type' => 'string',
'default' => 'desc',
),
'orderBy' => array(
'type' => 'string',
'default' => 'date',
),
'categories' => array(
'type' => 'string',
'default' => '',
),
'gutentorBlogPostImageLink' => array(
'type' => 'boolean',
'default' => false,
),
'gutentorBlogPostImageLinkNewTab' => array(
'type' => 'boolean',
'default' => false,
),
'p5OnNewsTxt' => array(
'type' => 'boolean',
'default' => true,
),
'p5Type' => array(
'type' => 'string',
'default' => 'marquee',
),
'p5Direction' => array(
'type' => 'string',
'default' => 'up',
),
'p5NewsTxt' => array(
'type' => 'string',
'default' => __( 'News', 'gutentor' ),
),
'p5Speed' => array(
'type' => 'number',
'default' => 0.05,
),
'p5PauseOnHover' => array(
'type' => 'boolean',
'default' => false,
),
'p5OnControl' => array(
'type' => 'boolean',
'default' => true,
),
);
$blog_partial_attrs = array_merge_recursive( $blog_post_attr, $this->get_module_common_attrs() );
return array_merge_recursive( $blog_partial_attrs, $this->get_module_query_elements_common_attrs() );
}
/**
* Render Blog Post Data
*
* @param array $attributes
* @param string $content
* @return string
* @since 1.0.1
* @access public
*/
public function render_callback( $attributes, $content ) {
$blockID = isset( $attributes['pID'] ) ? $attributes['pID'] : $attributes['gID'];
$gID = isset( $attributes['gID'] ) ? $attributes['gID'] : '';
$output = '';
$default_class = gutentor_block_add_default_classes( 'gutentor-p5', $attributes );
// the query
$args = array(
'posts_per_page' => $attributes['postsToShow'],
'post_type' => isset( $attributes['pPostType'] ) ? $attributes['pPostType'] : 'post',
'orderby' => $attributes['orderBy'],
'order' => $attributes['order'],
'cat' => $attributes['categories'],
'paged' => isset( $attributes['paged'] ) ? $attributes['paged'] : 1,
);
if ( isset( $attributes['pTaxType'] ) && ! empty( $attributes['pTaxType'] ) &&
isset( $attributes['pTaxTerm'] ) && ! empty( $attributes['pTaxTerm'] ) ) {
$args['taxonomy'] = $attributes['pTaxType'];
$args['taxOperator'] = $attributes['pTaxOperator'] ? $attributes['pTaxOperator'] : 'IN';
if ( is_array( $attributes['pTaxTerm'] ) ) {
$p1_terms = array();
foreach ( $attributes['pTaxTerm'] as $p1_term ) {
$p1_terms [] = $p1_term['value'];
}
$args['term'] = $p1_terms;
} elseif ( is_string( $attributes['pTaxTerm'] ) || is_numeric( $attributes['pTaxTerm'] ) ) {
$args['term'] = $attributes['pTaxTerm'];
}
}
if ( isset( $attributes['pAuthor'] ) && ! empty( $attributes['pAuthor'] ) ) {
if ( is_array( $attributes['pAuthor'] ) ) {
$author_list = array();
foreach ( $attributes['pAuthor'] as $data ) {
$author_list[] = $data['value'];
}
$args['author__in'] = $author_list;
}
}
if ( isset( $attributes['pIncludePosts'] ) && ! empty( $attributes['pIncludePosts'] ) ) {
$args['post__in'] = $attributes['pIncludePosts'];
}
if ( isset( $attributes['pExcludePosts'] ) && ! empty( $attributes['pExcludePosts'] ) ) {
$args['post__not_in'] = $attributes['pExcludePosts'];
}
if ( isset( $attributes['pOffsetPosts'] ) ) {
$args['offset'] = $attributes['pOffsetPosts'];
}
$tag = $attributes['mTag'] ? $attributes['mTag'] : 'div';
$news_ticker_header = $attributes['p5NewsTxt'] ? $attributes['p5NewsTxt'] : '';
$template = $attributes['p5Temp'] ? $attributes['p5Temp'] : '';
$align = isset( $attributes['align'] ) ? 'align' . $attributes['align'] : '';
$blockComponentAnimation = isset( $attributes['mAnimation'] ) ? $attributes['mAnimation'] : '';
$the_query = new WP_Query( gutentor_get_query( $args ) );
if ( $the_query->have_posts() ) :
$tag = gutentor_get_module_tag( $tag );
$output .= '<' . esc_attr( $tag ) . ' class="' . esc_attr( apply_filters( 'gutentor_post_module_main_wrap_class', gutentor_concat_space( 'gutentor-post-module', 'gutentor-post-module-p5', 'section-' . $gID, $template, $align, $default_class ), $attributes ) ) . '" id="' . esc_attr( $blockID ) . '" data-gbid="' . esc_attr( $gID ) . '" ' . GutentorAnimationOptionsDataAttr( $blockComponentAnimation ) . '' . gutentor_get_html_attr( apply_filters( 'gutentor_edit_news_ticker_data_attr', array(), $attributes ) ) . '>' . "\n";
$output .= apply_filters( 'gutentor_post_module_before_container', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_p5_newsticker_wrap_class', 'gutentor-news-ticker', $attributes ) ) . "'>";
$output .= apply_filters( 'gutentor_post_module_before_block_items', '', $attributes );
if ( $attributes['p5OnNewsTxt'] ) {
$output .= "<div class='gutentor-news-ticker-label'>" . esc_html( $news_ticker_header ) . '</div>';/*.ul*/
}
$output .= "<div class='gutentor-news-ticker-box'>";
$output .= "<div class='gutentor-news-ticker-wrap'>";
$output .= "<ul class='gutentor-news-ticker-data'>";
while ( $the_query->have_posts() ) :
$the_query->the_post();
$output .= '<li>';
$output .= apply_filters( 'gutentor_post_module_p5_query_data', '', get_post(), $attributes );
$output .= '</li>';/*.li*/
endwhile;
$output .= '</ul>';/*.ul*/
$output .= '</div>';/*.gutentor-news-ticker-wrap*/
$output .= '</div>';/*.gutentor-news-ticker-box*/
if ( 'vertical' === $attributes['p5Type'] ) {
$hor = ' gutentor-news-ticker-vertical-controls';
} else {
$hor = ' gutentor-news-ticker-horizontal-controls';
}
if ( $attributes['p5OnControl'] ) {
$output .= "<div class='gutentor-news-ticker-controls" . $hor . "'>";/*.ul*/
if ( $attributes['p5Type'] !== 'marquee' ) {
$output .= '<Button type="button" class="gutentor-news-ticker-arrow gutentor-news-ticker-prev"></Button>';
}
$output .= '<Button type="button" class="gutentor-news-ticker-action gutentor-news-ticker-pause"></Button>';
if ( $attributes['p5Type'] !== 'marquee' ) {
$output .= '<Button type="button" class="gutentor-news-ticker-arrow gutentor-news-ticker-next"></Button>';
}
$output .= '</div>';/*.gutentor-news-ticker-controls*/
}
$output .= apply_filters( 'gutentor_post_module_after_block_items', '', $attributes );
$output .= '</div>';/*.grid-container*/
$output .= apply_filters( 'gutentor_post_module_after_container', '', $attributes );
$output .= '</' . esc_attr( $tag ) . '>';/*.gutentor-blog-post-wrapper*/
endif;
// Restore original Post Data
wp_reset_postdata();
return $output;
}
}
}
Gutentor_P5::get_instance()->run();

View File

@@ -0,0 +1,365 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_P6' ) ) {
/**
* Functions related to Blog Post
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_P6 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 'p6';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 1.0.1
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'magnific-popup' ),
'style_handles' => array( 'magnific-popup' ),
);
}
/**
* Load Dependencies
* Used for blog template loading
*
* @since 1.0.1
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function load_dependencies() {
require_once GUTENTOR_PATH . 'includes/block-templates/duplex/class-duplex-p6-t1.php';
require_once GUTENTOR_PATH . 'includes/block-templates/duplex/class-duplex-p6-t2.php';
}
/**
* Returns attributes for this Block
*
* @static
* @access public
* @since 1.0.1
* @return array
*/
public function get_attrs() {
$blog_post_attr = array(
'gID' => array(
'type' => 'string',
'default' => '',
),
/*column*/
'blockItemsColumn' => array(
'type' => 'object',
'default' => array(
'desktop' => 'grid-md-4',
'tablet' => 'grid-sm-4',
'mobile' => 'grid-xs-12',
),
),
'timestamp' => array(
'type' => 'number',
'default' => 0,
),
'gName' => array(
'type' => 'string',
'default' => 'gutentor/p6',
),
'p6Temp' => array(
'type' => 'string',
'default' => 'gutentor_p6_template1',
),
'gStyle' => array(
'type' => 'string',
'default' => 'gutentor-blog-grid',
),
'pTaxTerm' => array(
'type' => 'array',
'items' => array(
'type' => 'object',
'label' => array(
'type' => 'string',
),
'value' => array(
'type' => 'number',
),
),
),
'pTaxType' => array(
'type' => 'string',
'default' => 'category',
),
'pTaxOperator' => array(
'type' => 'string',
'default' => 'IN',
),
'pPostType' => array(
'type' => 'string',
'default' => 'post',
),
'pIncludePosts' => array(
'type' => 'string',
),
'pExcludePosts' => array(
'type' => 'string',
),
'pOffsetPosts' => array(
'type' => 'number',
),
'postsToShow' => array(
'type' => 'number',
'default' => 6,
),
'order' => array(
'type' => 'string',
'default' => 'desc',
),
'orderBy' => array(
'type' => 'string',
'default' => 'date',
),
'categories' => array(
'type' => 'string',
'default' => '',
),
'gutentorBlogPostImageLink' => array(
'type' => 'boolean',
'default' => false,
),
'pReverseContent' => array(
'type' => 'boolean',
'default' => false,
),
'pOnColInList' => array(
'type' => 'boolean',
'default' => false,
),
'pNoFoundTxt' => array(
'type' => 'string',
'default' => 'Nothing Found',
),
'gutentorBlogPostImageLinkNewTab' => array(
'type' => 'boolean',
'default' => false,
),
'fpWooOnPrice' => array(
'type' => 'boolean',
'default' => true,
),
'fpWooOnFreeTxt' => array(
'type' => 'boolean',
'default' => false,
),
'fpWooFreeTxt' => array(
'type' => 'string',
'default' => __( 'Free', 'gutentor' ),
),
'fpWooOnRating' => array(
'type' => 'boolean',
'default' => true,
),
'pOnFPTagMeta1' => array(
'type' => 'boolean',
'default' => true,
),
'pOnFPTagMeta2' => array(
'type' => 'boolean',
'default' => true,
),
'eFPOnWl' => array(
'type' => 'boolean',
'default' => true,
),
/*Featured Post avatar*/
'pFPOnAvatar' => array(
'type' => 'boolean',
'default' => false,
),
'pFPAvatarPos' => array(
'type' => 'string',
'default' => 'g-avatar-img-fp-t-l',
),
'pFPAvatarSize' => array(
'type' => 'string',
'default' => '48',
),
'pFPAvatarOColor' => array(
'type' => 'object',
'default' => array(
'enable' => false,
'normal' => '',
'hover' => '',
),
),
'pFPOnByAuthor' => array(
'type' => 'boolean',
'default' => false,
),
);
$blog_partial_attrs = array_merge_recursive( $blog_post_attr, $this->get_module_common_attrs() );
$blog_partial_attrs = array_merge_recursive( $blog_partial_attrs, $this->get_module_query_elements_common_attrs() );
return array_merge_recursive( $blog_partial_attrs, $this->get_module_featured_post_query_elements_common_attrs() );
}
/**
* Render Blog Post Data
*
* @since 1.0.1
* @access public
*
* @param array $attributes
* @param string $content
* @return string
*/
public function render_callback( $attributes, $content ) {
$blockID = isset( $attributes['pID'] ) ? $attributes['pID'] : $attributes['gID'];
$gID = isset( $attributes['gID'] ) ? $attributes['gID'] : '';
$output = '';
$default_class = gutentor_block_add_default_classes( 'gutentor-p6', $attributes );
$tag = $attributes['mTag'] ? $attributes['mTag'] : 'div';
$template = $attributes['p6Temp'] ? $attributes['p6Temp'] : '';
$align = isset( $attributes['align'] ) ? 'align' . $attributes['align'] : '';
$blockComponentAnimation = isset( $attributes['mAnimation'] ) ? $attributes['mAnimation'] : '';
$nothing_found_text = isset( $attributes['pNoFoundTxt'] ) ? $attributes['pNoFoundTxt'] : '';
/*query args*/
$query_args = array(
'posts_per_page' => isset( $attributes['postsToShow'] ) ? $attributes['postsToShow'] : 6,
'post_type' => isset( $attributes['pPostType'] ) ? $attributes['pPostType'] : 'post',
'orderby' => isset( $attributes['orderBy'] ) ? $attributes['orderBy'] : 'date',
'order' => isset( $attributes['order'] ) ? $attributes['order'] : 'desc',
'paged' => isset( $attributes['paged'] ) ? $attributes['paged'] : 1,
'ignore_sticky_posts' => true,
'post_status' => 'publish',
);
/*Backward compatible*/
if ( isset( $attributes['categories'] ) && ! empty( $attributes['categories'] ) ) {
if ( is_array( $attributes['categories'] ) && ! gutentor_is_array_empty( $attributes['categories'] ) ) {
$query_args['taxonomy'] = 'category';
$query_args['term'] = $attributes['categories'];
}
if ( ! is_array( $attributes['categories'] ) ) {
$query_args['taxonomy'] = 'category';
$query_args['term'] = $attributes['categories'];
}
}
if ( isset( $attributes['pTaxType'] ) && ! empty( $attributes['pTaxType'] ) &&
isset( $attributes['pTaxTerm'] ) && ! empty( $attributes['pTaxTerm'] ) ) {
$query_args['taxonomy'] = $attributes['pTaxType'];
$query_args['taxOperator'] = $attributes['pTaxOperator'] ? $attributes['pTaxOperator'] : 'IN';
if ( is_array( $attributes['pTaxTerm'] ) ) {
$p1_terms = array();
foreach ( $attributes['pTaxTerm'] as $p1_term ) {
$p1_terms [] = $p1_term['value'];
}
$query_args['term'] = $p1_terms;
} elseif ( is_string( $attributes['pTaxTerm'] ) || is_numeric( $attributes['pTaxTerm'] ) ) {
$query_args['term'] = $attributes['pTaxTerm'];
}
}
if ( isset( $attributes['pAuthor'] ) && ! empty( $attributes['pAuthor'] ) ) {
if ( is_array( $attributes['pAuthor'] ) ) {
$author_list = array();
foreach ( $attributes['pAuthor'] as $data ) {
$author_list[] = $data['value'];
}
$query_args['author__in'] = $author_list;
}
}
if ( isset( $attributes['offset'] ) ) {
$query_args['offset'] = $attributes['offset'];
}
if ( isset( $attributes['pIncludePosts'] ) && ! empty( $attributes['pIncludePosts'] ) ) {
$query_args['post__in'] = $attributes['pIncludePosts'];
}
if ( isset( $attributes['pExcludePosts'] ) && ! empty( $attributes['pExcludePosts'] ) ) {
$query_args['post__not_in'] = $attributes['pExcludePosts'];
}
if ( isset( $attributes['pOffsetPosts'] ) ) {
$query_args['offset'] = $attributes['pOffsetPosts'];
}
/*Search query*/
if ( isset( $attributes['s'] ) && ! empty( $attributes['s'] ) ) {
$query_args['s'] = $attributes['s'];
}
$the_query = new WP_Query( gutentor_get_query( $query_args ) );
$single_post_class = $the_query->post_count === 1 ? 'gutentor-single-post' : '';
$tag = gutentor_get_module_tag( $tag );
$output .= '<' . esc_attr( $tag ) . ' class="' . esc_attr( apply_filters( 'gutentor_post_module_main_wrap_class', gutentor_concat_space( 'section-' . $gID, 'gutentor-post-module', 'gutentor-post-module-p6', $single_post_class, $template, $align, $default_class ), $attributes ) ) . '" id="' . esc_attr( $blockID ) . '" data-gbid="' . esc_attr( $gID ) . '" ' . GutentorAnimationOptionsDataAttr( $blockComponentAnimation ) . '>' . "\n";
$output .= apply_filters( 'gutentor_post_module_before_container', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_container_class', 'grid-container', $attributes ) ) . "'>";
$output .= apply_filters( 'gutentor_post_module_before_block_items', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_post_module_grid_row_class', 'grid-row', $attributes ) ) . "' " . gutentor_get_html_attr( apply_filters( 'gutentor_post_module_attr', array(), $attributes ) ) . '>';
if ( $the_query->have_posts() ) :
$output .= apply_filters( 'gutentor_post_module_p6_query_data', '', $the_query, $attributes, $content );
else :
$output .= '<header class="g-n-f-t-1"><h2 class="g-n-f-title">' . esc_html( $nothing_found_text ) . '</h2></header>';
endif;
$output .= '</div>';/*.grid-row*/
$output .= apply_filters( 'gutentor_post_module_after_block_items', '', $attributes );
$output .= '</div>';/*.grid-container*/
$output .= apply_filters( 'gutentor_post_module_after_container', '', $attributes );
$output .= '</' . esc_attr( $tag ) . '>';/*.gutentor-blog-post-wrapper*/
// Restore original Post Data.
wp_reset_postdata();
return $output;
}
}
}
Gutentor_P6::get_instance()->run();

View File

@@ -0,0 +1,274 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_T1' ) ) {
/**
* Functions related to Terms
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_T1 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 't1';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 1.0.1
* @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;
}
/**
* Load Dependencies
* Used for blog template loading
*
* @since 1.0.1
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function load_dependencies() {
require_once GUTENTOR_PATH . 'includes/block-templates/normal/class-normal-t1-templates.php';
}
/**
* Returns attributes for this Block
*
* @static
* @access public
* @since 1.0.1
* @return array
*/
protected function get_attrs() {
$term_attr = array(
'gID' => array(
'type' => 'string',
'default' => '',
),
'gName' => array(
'type' => 'string',
'default' => 'gutentor/t1',
),
'termStyle' => array(
'type' => 'string',
'default' => 'gtf-grid',
),
/*Query*/
't1Temp' => array(
'type' => 'string',
'default' => 'gutentor_t1_template1',
),
't1Taxonomy' => array(
'type' => 'string',
'default' => 'category',
),
't1Order' => array(
'type' => 'string',
'default' => 'desc',
),
't1OrderBy' => array(
'type' => 'string',
'default' => 'date',
),
't1IncludeTerms' => array(
'type' => 'string',
),
't1ExcludeTerms' => array(
'type' => 'string',
),
't1Number' => array(
'type' => 'number',
'default' => 6,
),
't1HideEmpty' => array(
'type' => 'boolean',
'default' => 'true',
),
'tRevCont' => array(
'type' => 'boolean',
'default' => false,
),
'tOnCol' => array(
'type' => 'boolean',
'default' => false,
),
/*global*/
't2ContentMargin' => array(
'type' => 'object',
),
't2ContentPadding' => array(
'type' => 'object',
'default' => array(
'type' => 'px',
'mTop' => '15',
'mRight' => '15',
'mBottom' => '15',
'mLeft' => '15',
),
),
't2BgProps' => array(
'type' => 'object',
'default' => array(
'size' => 'cover',
'pos' => 'center',
'repeat' => 'no-repeat',
'attachment' => 'scroll',
),
),
'blockSortableItems' => array(
'type' => 'object',
'default' => array(
array(
'itemValue' => 'featured-image',
'itemLabel' => __( 'Featured Image', 'gutentor' ),
),
array(
'itemValue' => 'title',
'itemLabel' => __( 'Title', 'gutentor' ),
),
array(
'itemValue' => 'count',
'itemLabel' => __( 'Count', 'gutentor' ),
),
array(
'itemValue' => 'description',
'itemLabel' => __( 'Description/Excerpt', 'gutentor' ),
),
array(
'itemValue' => 'button',
'itemLabel' => __( 'Button', 'gutentor' ),
),
),
),
'tTypeTermQuery' => array(
'type' => 'string',
'default' => 'default',
),
'tTermQuery' => array(
'type' => 'string',
'default' => '',
),
);
$term_partial_attr = array_merge_recursive( $term_attr, $this->get_module_common_attrs() );
return array_merge_recursive( $term_partial_attr, $this->get_term_common_attrs() );
}
/**
* Render Term Data
*
* @since 1.0.1
* @access public
*
* @param array $attributes
* @param string $content
* @return string
*/
public function render_callback( $attributes, $content ) {
$blockID = isset( $attributes['mID'] ) ? $attributes['mID'] : $attributes['gID'];
$gID = isset( $attributes['gID'] ) ? $attributes['gID'] : '';
$tTypeTermQuery = isset( $attributes['tTypeTermQuery'] ) ? $attributes['tTypeTermQuery'] : 'default';
$output = '';
$default_class = gutentor_block_add_default_classes( 'gutentor-t1', $attributes );
$tag = $attributes['mTag'] ? $attributes['mTag'] : 'section';
$template = $attributes['t1Temp'] ? $attributes['t1Temp'] : '';
$termStyle = $attributes['termStyle'] ? $attributes['termStyle'] : '';
$tRevCont = $attributes['tRevCont'] ? $attributes['tRevCont'] : '';
$tRevContClass = ( $termStyle === 'gtf-list' && $tRevCont ) ? 'gtf-reverse-list' : '';
$tOnImgW = isset( $attributes['tOnImgW'] ) && $attributes['tOnImgW'];
$tImgW = isset( $attributes['tImgW'] ) && $attributes['tImgW'];
$enable_featured_img = isset( $attributes['tOnFImg'] ) && $attributes['tOnFImg'];
$enabledWidth = ( $template !== 'gutentor_t1_template2' && $enable_featured_img && $tOnImgW && $tImgW ) ? 'gutentor-enabled-width' : '';
$align = isset( $attributes['align'] ) ? 'align' . $attributes['align'] : '';
$blockComponentAnimation = isset( $attributes['mAnimation'] ) ? $attributes['mAnimation'] : '';
/*
Query
*/
$term_query_args = array(
'taxonomy' => isset( $attributes['t1Taxonomy'] ) ? $attributes['t1Taxonomy'] : 'category',
);
if ( $tTypeTermQuery === 'default' ) {
/*query args*/
$term_query_args = array(
'taxonomy' => isset( $attributes['t1Taxonomy'] ) ? $attributes['t1Taxonomy'] : 'category',
'orderby' => isset( $attributes['t1OrderBy'] ) ? $attributes['t1OrderBy'] : 'date',
'order' => isset( $attributes['t1Order'] ) ? $attributes['t1Order'] : 'desc',
'hide_empty' => isset( $attributes['t1HideEmpty'] ) ? $attributes['t1HideEmpty'] : true,
'number' => isset( $attributes['t1Number'] ) ? $attributes['t1Number'] : 6,
);
if ( isset( $attributes['t1IncludeTerms'] ) && ! empty( $attributes['t1IncludeTerms'] ) ) {
$term_query_args['include'] = explode( ',', $attributes['t1IncludeTerms'] );
}
if ( isset( $attributes['t1ExcludeTerms'] ) && ! empty( $attributes['t1ExcludeTerms'] ) ) {
$term_query_args['exclude'] = explode( ',', $attributes['t1ExcludeTerms'] );
}
}
if ( $tTypeTermQuery === 'custom' ) {
$tTermQueryJson = isset( $attributes['tTermQuery'] ) ? $attributes['tTermQuery'] : false;
$tTermQueryData = json_decode( $tTermQueryJson, true );
$term_query_args = array_merge( $term_query_args, $tTermQueryData );
}
$terms = get_terms( gutentor_get_term_query( $term_query_args ) );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
$tag = gutentor_get_module_tag( $tag );
$output .= '<' . esc_attr( $tag ) . ' id="' . esc_attr( $blockID ) . '" class="' . esc_attr( apply_filters( 'gutentor_term_module_main_wrap_class', gutentor_concat_space( 'section-' . $gID, 'gutentor-module', 'gtf-module', 'gutentor-term-module', 'gutentor-term-module-t1', $align, $termStyle, $tRevContClass, $enabledWidth, $template, $default_class ), $attributes ) ) . '" id="' . esc_attr( $blockID ) . '" ' . GutentorAnimationOptionsDataAttr( $blockComponentAnimation ) . '>' . "\n";
$output .= apply_filters( 'gutentor_term_module_before_container', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_container_class', 'grid-container', $attributes ) ) . "'>";
$output .= apply_filters( 'gutentor_term_module_before_block_items', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_grid_row_class', 'grid-row', $attributes ) ) . "' " . gutentor_get_html_attr( apply_filters( 'gutentor_term_module_attr', array(), $attributes ) ) . '>';
$output .= apply_filters( 'gutentor_term_module_before_block_items', '', $attributes );
$index = 0;
foreach ( $terms as $term ) {
/*term query*/
$output .= apply_filters( 'gutentor_term_module_t1_query_data', '', $term, $attributes, $index );
++$index;
}
$output .= '</div>';/*.grid-row*/
$output .= apply_filters( 'gutentor_term_module_after_block_items', '', $attributes );
$output .= '</div>';/*.grid-container*/
$output .= apply_filters( 'gutentor_term_module_after_container', '', $attributes );
$output .= '</' . esc_attr( $tag ) . '>';/*.gutentor-blog-term-wrapper*/
}
return $output;
}
}
}
Gutentor_T1::get_instance()->run();

View File

@@ -0,0 +1,197 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_T2' ) ) {
/**
* Functions related to Terms
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_T2 extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 't2';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 1.0.1
* @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;
}
/**
* Returns attributes for this Block
*
* @static
* @access public
* @since 1.0.1
* @return array
*/
protected function get_attrs() {
$term_attr = array(
'gID' => array(
'type' => 'string',
'default' => '',
),
'gName' => array(
'type' => 'string',
'default' => 'gutentor/t2',
),
/*Query*/
't2Temp' => array(
'type' => 'number',
'default' => 1,
),
't2Taxonomy' => array(
'type' => 'string',
'default' => 'category',
),
't2Order' => array(
'type' => 'string',
'default' => 'desc',
),
't2OrderBy' => array(
'type' => 'string',
'default' => 'date',
),
't2IncludeTerms' => array(
'type' => 'string',
),
't2ExcludeTerms' => array(
'type' => 'string',
),
't2Number' => array(
'type' => 'number',
),
't2HideEmpty' => array(
'type' => 'boolean',
'default' => 'true',
),
/*global*/
't2ContentMargin' => array(
'type' => 'object',
),
't2ContentPadding' => array(
'type' => 'object',
'default' => array(
'type' => 'px',
'mTop' => '15',
'mRight' => '15',
'mBottom' => '15',
'mLeft' => '15',
),
),
't2BgProps' => array(
'type' => 'object',
'default' => array(
'size' => 'cover',
'pos' => 'center',
'repeat' => 'no-repeat',
'attachment' => 'scroll',
),
),
);
$term_partial_attr = array_merge_recursive( $term_attr, $this->get_module_common_attrs() );
return array_merge_recursive( $term_partial_attr, $this->get_term_common_attrs() );
}
/**
* Render Blog Post Data
*
* @since 1.0.1
* @access public
*
* @param array $attributes
* @param string $content
* @return string
*/
public function render_callback( $attributes, $content ) {
$blockID = isset( $attributes['mID'] ) ? $attributes['mID'] : $attributes['gID'];
$gID = isset( $attributes['gID'] ) ? $attributes['gID'] : '';
$output = '';
$default_class = gutentor_block_add_default_classes( 'gutentor-t2', $attributes );
$tag = $attributes['mTag'] ? $attributes['mTag'] : 'section';
$template = $attributes['t2Temp'] ? $attributes['t2Temp'] : '';
$align = isset( $attributes['align'] ) ? 'align' . $attributes['align'] : '';
$blockComponentAnimation = isset( $attributes['mAnimation'] ) ? $attributes['mAnimation'] : '';
/*
Query
*/
$taxonomy = isset( $attributes['t2Taxonomy'] ) ? $attributes['t2Taxonomy'] : 'category';
$orderby = isset( $attributes['t2OrderBy'] ) ? $attributes['t2OrderBy'] : 'date';
$order = isset( $attributes['t2Order'] ) ? $attributes['t2Order'] : 'desc';
$hide_empty = isset( $attributes['t2HideEmpty'] ) ? $attributes['t2HideEmpty'] : true;
$include = isset( $attributes['t2IncludeTerms'] ) ? $attributes['t2IncludeTerms'] : '';
$exclude = isset( $attributes['t2ExcludeTerms'] ) ? $attributes['t2ExcludeTerms'] : '';
$number = isset( $attributes['t2Number'] ) ? $attributes['t2Number'] : 5;
$terms = get_terms(
gutentor_get_term_query(
array(
'taxonomy' => $taxonomy,
'orderby' => $orderby,
'order' => $order,
'hide_empty' => $hide_empty,
'include' => $include,
'exclude' => $exclude,
'number' => $number,
)
)
);
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
$tag = gutentor_get_module_tag( $tag );
$output .= '<' . esc_attr( $tag ) . ' id="' . esc_attr( $blockID ) . '" class="' . esc_attr( apply_filters( 'gutentor_term_module_main_wrap_class', gutentor_concat_space( 'section-' . $gID, 'gutentor-module', 'gtf-module', 'gutentor-term-module', 'gutentor-term-module-t2', $align, 'g-loop-' . $number, 'g-template-' . $template, $default_class ), $attributes ) ) . '" id="' . esc_attr( $blockID ) . '" ' . GutentorAnimationOptionsDataAttr( $blockComponentAnimation ) . '>' . "\n";
$output .= apply_filters( 'gutentor_term_module_before_container', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_container_class', 'grid-container', $attributes ) ) . "'>";
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_term_module_grid_row_class', 'grid-row', $attributes ) ) . "'>";
$output .= apply_filters( 'gutentor_term_module_before_block_items', '', $attributes );
/*term query*/
$output .= apply_filters( 'gutentor_term_module_t2_query_data', '', $terms, $attributes );
$output .= apply_filters( 'gutentor_term_module_after_block_items', '', $attributes );
$output .= '</div>';/*.grid-row*/
$output .= '</div>';/*.grid-container*/
$output .= apply_filters( 'gutentor_term_module_after_container', '', $attributes );
$output .= '</' . esc_attr( $tag ) . '>';/*.gutentor-blog-term-wrapper*/
}
return $output;
}
}
}
Gutentor_T2::get_instance()->run();

View File

@@ -0,0 +1,324 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_T3_Hooks' ) ) {
/**
* Block Specific Hooks Class For Gutentor
*
* @package Gutentor
* @since 2.0.0
*/
class Gutentor_T3_Hooks extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 't3';
/**
* 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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'slick' ),
'style_handles' => array( 'slick' ),
);
}
/**
* Add Filter
*
* @access public
* @since 2.0.0
* @return void
*/
public function add_filter( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
add_filter( $hook, array( $component, $callback ), $priority, $accepted_args );
}
/**
* Add Action
*
* @access public
* @since 2.0.0
* @return void
*/
public function add_action( $hook, $component, $callback, $priority = 10, $accepted_args = 1 ) {
add_action( $hook, array( $component, $callback ), $priority, $accepted_args );
}
/**
* Run Block
*
* @access public
* @since 2.0.0
* @return void
*/
public function run() {
parent::run();
/*Block Specific PHP hooks*/
$this->add_filter( 'gutentor_term_module_main_wrap_class', $this, 'add_carousel_arrow_class', 15, 2 );
$this->add_filter( 'gutentor_term_module_grid_row_class', $this, 'add_carousel_row', 15, 2 );
$this->add_filter( 'gutentor_term_module_attr', $this, 'add_carousel_data', 15, 2 );
$this->add_filter( 'gutentor_term_module_article_class', $this, 'add_carousel_class', 15, 2 );
$this->add_filter( 'gutentor_term_module_before_block_items', $this, 'add_carousel_arrow', 15, 2 );
}
/**
* Adding Carousel Class
*
* @param {array} output
* @param {object} props
* @return {array}
*/
public function add_carousel_arrow_class( $output, $attributes ) {
$gutentorBlockName = ( isset( $attributes['gName'] ) ) ? $attributes['gName'] : '';
$block_list = array( 'gutentor/t1' );
if ( ! in_array( $gutentorBlockName, $block_list ) ) {
return $output;
}
if ( ! isset( $attributes['t1CarouselOpt'] ) || ! $attributes['t1CarouselOpt']['enable'] ) {
return $output;
}
if ( ! isset( $attributes['t1CarouselOpt']['arrowsPosition'] ) ) {
return $output;
}
$arrow_position = $attributes['t1CarouselOpt']['arrowsPosition'];
$enable_desktop_arrow = isset( $attributes['t1CarouselOpt']['arrows'] ) && $attributes['t1CarouselOpt']['arrows'];
$enable_tablet_arrow = isset( $attributes['t1CarouselOpt']['arrowsT'] ) && $attributes['t1CarouselOpt']['arrowsT'];
$enable_mobile_arrow = isset( $attributes['t1CarouselOpt']['arrowsM'] ) && $attributes['t1CarouselOpt']['arrowsM'];
$arrow_position_desktop = array_key_exists( 'desktop', $arrow_position ) ? $arrow_position['desktop'] : false;
if ( $enable_desktop_arrow && $arrow_position_desktop ) {
$output = gutentor_concat_space( $output, $arrow_position_desktop . '-desktop' );
}
$arrow_position_tablet = array_key_exists( 'tablet', $arrow_position ) ? $arrow_position['tablet'] : false;
if ( $enable_tablet_arrow && $arrow_position_tablet ) {
$output = gutentor_concat_space( $output, $arrow_position_tablet . '-tablet' );
}
$arrow_position_mobile = array_key_exists( 'mobile', $arrow_position ) ? $arrow_position['mobile'] : false;
if ( $enable_mobile_arrow && $arrow_position_mobile ) {
$output = gutentor_concat_space( $output, $arrow_position_mobile . '-mobile' );
}
return $output;
}
/**
* Adding Container Remove Classes
*
* @param {array} output
* @param {object} props
* @return string
*/
public function add_carousel_row( $output, $attributes ) {
if ( ! isset( $attributes['t1CarouselOpt'] ) || ! $attributes['t1CarouselOpt']['enable'] ) {
return $output;
}
$local_data = str_replace( 'grid-row', '', $output );
if ( isset( $attributes['t1CarouselOpt']['carouselID'] ) ) {
$local_data = gutentor_concat_space( $local_data, $attributes['t1CarouselOpt']['carouselID'] );
}
return gutentor_concat_space( $local_data, 'gutentor-module-carousel-row' );
}
/**
* Adding Carousel Data
*
* @param {array} output
* @param {object} props
* @return {array}
*/
public function add_carousel_data( $output, $attributes ) {
if ( ! isset( $attributes['t1CarouselOpt'] ) || ! $attributes['t1CarouselOpt']['enable'] ) {
return $output;
}
$t1CarouselOpt = $attributes['t1CarouselOpt'];
$local_data = array();
if ( isset( $t1CarouselOpt['dots'] ) ) {
$local_data['data-dots'] = ( $t1CarouselOpt['dots'] ) ? 'true' : 'false';
}
if ( isset( $t1CarouselOpt['dotsT'] ) ) {
$local_data['data-dotstablet'] = ( $t1CarouselOpt['dotsT'] ) ? 'true' : 'false';
}
if ( isset( $t1CarouselOpt['dotsM'] ) ) {
$local_data['data-dotsmobile'] = ( $t1CarouselOpt['dotsM'] ) ? 'true' : 'false';
}
if ( isset( $t1CarouselOpt['arrowNext'] ) ) {
$local_data['data-nextarrow'] = ( $t1CarouselOpt['arrowNext'] ) ? $t1CarouselOpt['arrowNext'] : '';
}
if ( isset( $t1CarouselOpt['arrowsPrev'] ) ) {
$local_data['data-prevarrow'] = ( $t1CarouselOpt['arrowsPrev'] ) ? $t1CarouselOpt['arrowsPrev'] : '';
}
if ( isset( $t1CarouselOpt['arrows'] ) ) {
$local_data['data-arrows'] = ( $t1CarouselOpt['arrows'] ) ? 'true' : 'false';
}
if ( isset( $t1CarouselOpt['arrowsT'] ) ) {
$local_data['data-arrowstablet'] = ( $t1CarouselOpt['arrowsT'] ) ? 'true' : 'false';
}
if ( isset( $t1CarouselOpt['arrowsM'] ) ) {
$local_data['data-arrowsmobile'] = ( $t1CarouselOpt['arrowsM'] ) ? 'true' : 'false';
}
if ( isset( $t1CarouselOpt['arrowsPosition']['desktop'] ) ) {
$local_data['data-arrowsPositionDesktop'] = ( $t1CarouselOpt['arrowsPosition']['desktop'] . '-desktop' );
}
if ( isset( $t1CarouselOpt['arrowsPosition']['tablet'] ) ) {
$local_data['data-arrowsPositionTablet'] = ( $t1CarouselOpt['arrowsPosition']['tablet'] . '-tablet' );
}
if ( isset( $t1CarouselOpt['arrowsPosition']['mobile'] ) ) {
$local_data['data-arrowsPositionMobile'] = ( $t1CarouselOpt['arrowsPosition']['mobile'] . '-mobile' );
}
if ( isset( $t1CarouselOpt['infinite'] ) ) {
$local_data['data-infinite'] = ( $t1CarouselOpt['infinite'] ) ? 'true' : 'false';
}
if ( isset( $t1CarouselOpt['speed'] ) ) {
$local_data['data-speed'] = $t1CarouselOpt['speed'];
}
if ( isset( $t1CarouselOpt['autoplay'] ) ) {
$local_data['data-autoplay'] = ( $t1CarouselOpt['autoplay'] ) ? 'true' : 'false';
if ( isset( $t1CarouselOpt['autoplaySpeed'] ) ) {
$local_data['data-autoplayspeed'] = $t1CarouselOpt['autoplaySpeed'];
}
if ( isset( $t1CarouselOpt['pauseOnFocus'] ) ) {
$local_data['data-pauseonfocus'] = ( $t1CarouselOpt['pauseOnFocus'] ) ? 'true' : 'false';
}
if ( isset( $t1CarouselOpt['pauseOnHover'] ) ) {
$local_data['data-pauseonhover'] = ( $t1CarouselOpt['pauseOnHover'] ) ? 'true' : 'false';
}
}
if ( isset( $t1CarouselOpt['draggable'] ) ) {
$local_data['data-draggable'] = ( $t1CarouselOpt['draggable'] ) ? 'true' : 'false';
}
/*center mode*/
if ( isset( $t1CarouselOpt['cmondesktop'] ) ) {
$local_data['data-cmondesktop'] = ( $t1CarouselOpt['cmondesktop'] ) ? 'true' : 'false';
if ( isset( $t1CarouselOpt['cmpaddingdesktop'] ) ) {
$local_data['data-cmpaddingdesktop'] = ( $t1CarouselOpt['cmpaddingdesktop'] ) ? $t1CarouselOpt['cmpaddingdesktop'] : '';
}
}
if ( isset( $t1CarouselOpt['cmontablet'] ) ) {
$local_data['data-cmontablet'] = ( $t1CarouselOpt['cmontablet'] ) ? 'true' : 'false';
if ( isset( $t1CarouselOpt['cmpaddingtablet'] ) ) {
$local_data['data-cmpaddingtablet'] = ( $t1CarouselOpt['cmpaddingtablet'] ) ? $t1CarouselOpt['cmpaddingtablet'] : '';
}
}
if ( isset( $t1CarouselOpt['cmonmobile'] ) ) {
$local_data['data-cmonmobile'] = ( $t1CarouselOpt['cmonmobile'] ) ? 'true' : 'false';
if ( isset( $t1CarouselOpt['cmpaddingmobile'] ) ) {
$local_data['data-cmpaddingmobile'] = ( $t1CarouselOpt['cmpaddingmobile'] ) ? $t1CarouselOpt['cmpaddingmobile'] : '';
}
}
if ( isset( $t1CarouselOpt['slideitem']['desktop'] ) ) {
$local_data['data-slideitemdesktop'] = $t1CarouselOpt['slideitem']['desktop'];
}
if ( isset( $t1CarouselOpt['slideitem']['tablet'] ) ) {
$local_data['data-slideitemtablet'] = $t1CarouselOpt['slideitem']['tablet'];
}
if ( isset( $t1CarouselOpt['slideitem']['mobile'] ) ) {
$local_data['data-slideitemmobile'] = $t1CarouselOpt['slideitem']['mobile'];
}
if ( isset( $t1CarouselOpt['slidescroll']['desktop'] ) ) {
$local_data['data-slidescroll-desktop'] = $t1CarouselOpt['slidescroll']['desktop'];
}
if ( isset( $t1CarouselOpt['slidescroll']['tablet'] ) ) {
$local_data['data-slidescroll-tablet'] = $t1CarouselOpt['slidescroll']['tablet'];
}
if ( isset( $t1CarouselOpt['slidescroll']['mobile'] ) ) {
$local_data['data-slidescroll-mobile'] = $t1CarouselOpt['slidescroll']['mobile'];
}
return $local_data;
}
/**
* Adding carousel class
*
* @param {array} output
* @param {object} props
* @return {array}
*/
public function add_carousel_class( $output, $attributes ) {
if ( ! isset( $attributes['t1CarouselOpt'] ) || ! $attributes['t1CarouselOpt']['enable'] ) {
return $output;
}
return gutentor_concat_space( $output, 'gutentor-carousel-item' );
}
/**
* Adding carousel class
*
* @param {array} output
* @param {object} props
* @return {array}
*/
public function add_carousel_arrow( $output, $attributes ) {
$gutentorBlockName = ( isset( $attributes['gName'] ) ) ? $attributes['gName'] : '';
$block_list = array( 'gutentor/t1' );
if ( ! in_array( $gutentorBlockName, $block_list ) ) {
return $output;
}
if ( ! isset( $attributes['t1CarouselOpt'] ) || ! $attributes['t1CarouselOpt']['enable'] ) {
return $output;
}
$t1CarouselOpt = ( isset( $attributes['t1CarouselOpt'] ) && $attributes['t1CarouselOpt']['enable'] ) ? $attributes['t1CarouselOpt'] : false;
$desktop_row_position = ( $t1CarouselOpt && $t1CarouselOpt['arrowsPosition']['desktop'] ) ? $t1CarouselOpt['arrowsPosition']['desktop'] . '-desktop' : false;
if ( $desktop_row_position !== 'gutentor-slick-a-default-desktop' ) {
$output .= '<div class="gutentor-slick-arrows"></div>';
}
return $output;
}
}
}
/**
* Return instance of Gutentor_T3_Hooks class
*
* @since 1.0.0
*/
if ( ! function_exists( 'gutentor_t3_hooks' ) ) {
function gutentor_t3_hooks() {
return Gutentor_T3_Hooks::get_instance();
}
}
gutentor_t3_hooks()->run();

View File

@@ -0,0 +1,501 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Blog_Post' ) ) {
/**
* Functions related to Blog Post
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_Blog_Post extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 'blog-post';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 1.0.1
* @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;
}
/**
* Load Dependencies
* Used for blog template loading
*
* @since 1.0.1
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function load_dependencies() {
require_once GUTENTOR_PATH . 'includes/block-templates/widgets/class-widget-blog-post-templates.php';
}
/**
* Returns attributes for this Block
*
* @static
* @access public
* @since 1.0.1
* @return array
*/
protected function get_attrs() {
$blog_post_attr = array(
'blockID' => array(
'type' => 'string',
'default' => '',
),
'timestamp' => array(
'type' => 'number',
'default' => 0,
),
'gutentorBlockName' => array(
'type' => 'string',
),
/*blog specific*/
'blockBlogTemplate' => array(
'type' => 'string',
'default' => 'blog-template1',
),
'blockBlogStyle' => array(
'type' => 'string',
'default' => 'blog-grid',
),
'postsToShow' => array(
'type' => 'number',
'default' => 6,
),
'entryMetaFontSize' => array(
'type' => 'number',
'default' => 14,
),
'order' => array(
'type' => 'string',
'default' => 'desc',
),
'orderBy' => array(
'type' => 'string',
'default' => 'date',
),
'categories' => array(
'type' => 'string',
'default' => '',
),
'gutentorBlogPostImageLink' => array(
'type' => 'boolean',
'default' => false,
),
'gutentorBlogPostImageLinkNewTab' => array(
'type' => 'boolean',
'default' => false,
),
'enablePostImage' => array(
'type' => 'boolean',
'default' => true,
),
'enablePostTitle' => array(
'type' => 'boolean',
'default' => true,
),
'enablePostAuthor' => array(
'type' => 'boolean',
'default' => true,
),
'enablePostDate' => array(
'type' => 'boolean',
'default' => true,
),
'enablePostCategory' => array(
'type' => 'boolean',
'default' => true,
),
'enablePostExcerpt' => array(
'type' => 'boolean',
'default' => true,
),
'excerptLength' => array(
'type' => 'number',
'default' => 100,
),
'enableButton' => array(
'type' => 'boolean',
'default' => true,
),
'buttonIcon' => array(
'type' => 'object',
'default' => array(
'label' => 'fa-book',
'value' => 'fas fa-book',
'code' => 'f108',
),
),
'buttonText' => array(
'type' => 'string',
'default' => __( 'Read More', 'gutentor' ),
),
'imageDisplayOptions' => array(
'type' => 'string',
'default' => 'normal-image',
),
'bgImageOptions' => array(
'type' => 'object',
'default' => array(
'backgroundImage' => '',
'height' => array(
'desktop' => 50,
'tablet' => 50,
'mobile' => 50,
),
'backgroundSize' => '',
'backgroundPosition' => '',
'backgroundRepeat' => '',
'backgroundAttachment' => '',
),
),
'imageBorder' => array(
'type' => 'object',
'default' => array(
'borderStyle' => 'none',
'borderTop' => '',
'borderRight' => '',
'borderBottom' => '',
'borderLeft' => '',
'borderColor' => '',
'borderRadiusType' => 'px',
'borderRadiusTop' => '',
'borderRadiusRight' => '',
'borderRadiusBottom' => '',
'borderRadiusLeft' => '',
),
),
'imageOverlayColor' => array(
'type' => 'object',
'default' => array(
'enable' => false,
'normal' => '',
'hover' => '',
),
),
'entryMetaColor' => array(
'type' => 'object',
'default' => array(
'enable' => false,
'normal' => '',
'hover' => '',
),
),
'blockEntryMetaTypography' => array(
'type' => 'object',
'default' => array(
'fontType' => '',
'systemFont' => '',
'googleFont' => '',
'customFont' => '',
'fontSize' => array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
),
'fontWeight' => '',
'textTransform' => '',
'fontStyle' => '',
'textDecoration' => '',
'lineHeight' => array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
),
'letterSpacing' => array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
),
),
),
'blockEntryMetaMargin' => array(
'type' => 'object',
'default' => array(
'type' => 'px',
'desktopTop' => '',
'desktopRight' => '',
'desktopBottom' => '',
'desktopLeft' => '',
'tabletTop' => '',
'tabletRight' => '',
'tabletBottom' => '',
'tabletLeft' => '',
'mobileTop' => '',
'mobileRight' => '',
'mobileBottom' => '',
'mobileLeft' => '',
),
),
'blockEntryMetaPadding' => array(
'type' => 'object',
'default' => array(
'type' => 'px',
'desktopTop' => '',
'desktopRight' => '',
'desktopBottom' => '',
'desktopLeft' => '',
'tabletTop' => '',
'tabletRight' => '',
'tabletBottom' => '',
'tabletLeft' => '',
'mobileTop' => '',
'mobileRight' => '',
'mobileBottom' => '',
'mobileLeft' => '',
),
),
'mBGImageSrc' => array(
'type' => 'string',
'default' => 'self-hosted-local',
),
'mBGVideoSrc' => array(
'type' => 'string',
'default' => 'self-hosted-local',
),
'mBGVideoUrl' => array(
'type' => 'string',
'default' => 'https://www.youtube.com/watch?v=bGMi7L78hVk',
),
);
return array_merge_recursive( $blog_post_attr, $this->get_single_item_common_attrs() );
}
/**
* Blog Post Attributes Default Values
*
* @since 1.0.1
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function get_default_values() {
$blog_attr = array(
'blockID' => '',
'gutentorBlockName' => '',
'timestamp' => 0,
'blockBlogStyle' => 'blog-grid',
'blockBlogTemplate' => 'blog-template1',
'postsToShow' => 6,
'entryMetaFontSize' => 14,
'order' => 'desc',
'orderBy' => 'date',
'categories' => '',
'enablePostImage' => true,
'enablePostTitle' => true,
'enablePostAuthor' => true,
'enablePostDate' => true,
'enablePostCategory' => true,
'enablePostExcerpt' => true,
'excerptLength' => 100,
'enableButton' => true,
'gutentorBlogPostImageLink' => false,
'gutentorBlogPostImageLinkNewTab' => false,
'buttonIcon' => array(
'label' => 'fa-book',
'value' => 'fas fa-book',
'code' => 'f108',
),
'buttonText' => __( 'Read More', 'gutentor' ),
'imageDisplayOptions' => 'normal-image',
'bgImageOptions' => array(
'backgroundImage' => '',
'height' => array(
'desktop' => 50,
'tablet' => 50,
'mobile' => 50,
),
'backgroundSize' => '',
'backgroundPosition' => '',
'backgroundRepeat' => '',
'backgroundAttachment' => '',
),
'imageBorder' => array(
'borderStyle' => 'none',
'borderTop' => '',
'borderRight' => '',
'borderBottom' => '',
'borderLeft' => '',
'borderColor' => '',
'borderRadiusType' => 'px',
'borderRadiusTop' => '',
'borderRadiusRight' => '',
'borderRadiusBottom' => '',
'borderRadiusLeft' => '',
),
'imageOverlayColor' => array(
'enable' => false,
'normal' => '',
'hover' => '',
),
'entryMetaColor' => array(
'enable' => false,
'normal' => '',
'hover' => '',
),
'blockEntryMetaTypography' => array(
'fontType' => '',
'systemFont' => '',
'googleFont' => '',
'customFont' => '',
'fontSize' => array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
),
'fontWeight' => '',
'textTransform' => '',
'fontStyle' => '',
'textDecoration' => '',
'lineHeight' => array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
),
'letterSpacing' => array(
'desktop' => '',
'tablet' => '',
'mobile' => '',
),
),
'blockEntryMetaMargin' => array(
'type' => 'px',
'desktopTop' => '',
'desktopRight' => '',
'desktopBottom' => '',
'desktopLeft' => '',
'tabletTop' => '',
'tabletRight' => '',
'tabletBottom' => '',
'tabletLeft' => '',
'mobileTop' => '',
'mobileRight' => '',
'mobileBottom' => '',
'mobileLeft' => '',
),
'blockEntryMetaPadding' => array(
'type' => 'px',
'desktopTop' => '',
'desktopRight' => '',
'desktopBottom' => '',
'desktopLeft' => '',
'tabletTop' => '',
'tabletRight' => '',
'tabletBottom' => '',
'tabletLeft' => '',
'mobileTop' => '',
'mobileRight' => '',
'mobileBottom' => '',
'mobileLeft' => '',
),
);
$blog_attr = apply_filters( 'gutentor_blog_post_get_default_values', $blog_attr );
return $blog_attr;
}
/**
* Render Blog Post Data
*
* @since 1.0.1
* @access public
*
* @param array $attributes
* @param string $content
* @return string
*/
public function render_callback( $attributes, $content ) {
$blockID = isset( $attributes['blockID'] ) ? $attributes['blockID'] : '';
$output = '';
$default_class = gutentor_block_add_default_classes( 'gutentor-blog-post', $attributes );
// the query
$args = array(
'posts_per_page' => $attributes['postsToShow'],
'orderby' => $attributes['orderBy'],
'order' => $attributes['order'],
'cat' => $attributes['categories'],
'ignore_sticky_posts' => 1,
);
$tag = $attributes['blockSectionHtmlTag'] ? $attributes['blockSectionHtmlTag'] : 'section';
$template = $attributes['blockBlogTemplate'] ? $attributes['blockBlogTemplate'] : '';
$align = isset( $attributes['align'] ) ? 'align' . $attributes['align'] : '';
$blockComponentAnimation = isset( $attributes['blockComponentAnimation'] ) ? $attributes['blockComponentAnimation'] : '';
$blockItemsWrapAnimation = isset( $attributes['blockItemsWrapAnimation'] ) ? $attributes['blockItemsWrapAnimation'] : '';
$the_query = new WP_Query( gutentor_get_query( $args ) );
if ( $the_query->have_posts() ) :
$tag = gutentor_get_module_tag( $tag );
$output .= '<' . esc_attr( $tag ) . ' class="' . esc_attr( apply_filters( 'gutentor_save_section_class', 'gutentor-section gutentor-blog-post-wrapper ' . gutentor_concat_space( $template, $align, $default_class ) . '', $attributes ) ) . '" id="section-' . esc_attr( $blockID ) . '" ' . GutentorAnimationOptionsDataAttr( $blockComponentAnimation ) . '>' . "\n";
$output .= apply_filters( 'gutentor_save_before_container', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_save_container_class', 'grid-container', $attributes ) ) . "'>";
$output .= apply_filters( 'gutentor_save_before_block_items', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_save_grid_item_wrap_class', 'gutentor-grid-item-wrap', $attributes ) ) . " ' " . apply_filters( 'gutentor_save_grid_item_wrap_attr', '', $attributes ) . ' ' . GutentorAnimationOptionsDataAttr( $blockItemsWrapAnimation ) . '>';
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_save_grid_row_class', 'grid-row', $attributes ) ) . " ' " . apply_filters( 'gutentor_save_grid_row_attr', '', $attributes ) . '>';
while ( $the_query->have_posts() ) :
$the_query->the_post();
$thumb_class = has_post_thumbnail() ? 'gutentor-post-has-thumb' : 'gutentor-post-no-thumb';
$output .= "<article class='" . esc_attr( apply_filters( 'gutentor_save_grid_column_class', $thumb_class, $attributes ) ) . "'>";
$output .= '<div class="gutentor-single-item">';
$output .= apply_filters( 'gutentor_save_blog_post_block_template_data', '', get_post(), $attributes );
$output .= '</div>';/*.gutentor-single-item*/
$output .= '</article>';/*.article*/
endwhile;
$output .= '</div>';/*.grid-row*/
$output .= '</div>';/*.grid-row-item-wrap*/
$output .= apply_filters( 'gutentor_save_after_block_items', '', $attributes );
$output .= '</div>';/*.grid-container*/
$output .= apply_filters( 'gutentor_save_after_container', '', $attributes );
$output .= '</' . esc_attr( $tag ) . '>';/*.gutentor-blog-post-wrapper*/
endif;
// Restore original Post Data.
wp_reset_postdata();
return $output;
}
}
}
Gutentor_Blog_Post::get_instance()->run();

View File

@@ -0,0 +1,77 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Counter_Box' ) ) {
/**
* Functions related to Google Map
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_Counter_Box extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 'counter-box';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 1.0.1
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 1.0.1
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'countUp' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 1.0.1
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_Counter_Box::get_instance()->run();

View File

@@ -0,0 +1,78 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Gallery' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_Gallery extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'gallery';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'magnific-popup', 'masonry' ),
'style_handles' => array( 'magnific-popup' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_Gallery::get_instance()->run();

View File

@@ -0,0 +1,247 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Google_Map' ) ) {
/**
* Functions related to Google Map
*
* @package Gutentor
* @since 1.0.1
*/
class Gutentor_Google_Map extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 1.0.1
* @var string
*/
protected $block_name = 'google-map';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 1.0.1
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.2.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'gutentor-google-maps', 'google-maps' ),
);
}
/**
* Google Map Attributes Default Value
*
* @since 1.0.0
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function get_default_values() {
$google_map_attr = array(
'id' => '',
'location' => 'La Sagrada Familia, Barcelona, Spain',
'containerWidth' => 'grid-container',
'latitude' => '41.4036299',
'longitude' => '2.1743558000000576',
'type' => 'roadmap',
'zoom' => 15,
'mapHeight' => array(
'type' => 'px',
'desktop' => '250',
'tablet' => '250',
'mobile' => '150',
),
'draggable' => true,
'mapTypeControl' => true,
'zoomControl' => true,
'fullscreenControl' => true,
'streetViewControl' => true,
'markers' => array(),
);
$google_map_attr = apply_filters( 'gutentor_google_map_get_default_values', $google_map_attr );
return $google_map_attr;
}
/**
* Returns attributes for this Block
*
* @static
* @access public
* @since 1.0.0
* @return array
*/
protected function get_attrs() {
$google_map_attr = array(
'id' => array(
'type' => 'string',
),
'blockID' => array(
'type' => 'string',
),
'gutentorBlockName' => array(
'type' => 'string',
),
'containerWidth' => array(
'type' => 'string',
'default' => 'grid-container',
),
'location' => array(
'type' => 'string',
'default' => 'La Sagrada Familia, Barcelona, Spain',
),
'latitude' => array(
'type' => 'string',
'default' => '41.4036299',
),
'longitude' => array(
'type' => 'string',
'default' => '2.1743558000000576',
),
'type' => array(
'type' => 'string',
'default' => 'roadmap',
),
'zoom' => array(
'type' => 'number',
'default' => 15,
),
'mapHeight' => array(
'type' => 'object',
'default' => array(
'type' => 'px',
'desktop' => '250',
'tablet' => '250',
'mobile' => '150',
),
),
'draggable' => array(
'type' => 'boolean',
'default' => true,
),
'mapTypeControl' => array(
'type' => 'boolean',
'default' => true,
),
'zoomControl' => array(
'type' => 'boolean',
'default' => true,
),
'fullscreenControl' => array(
'type' => 'boolean',
'default' => true,
),
'streetViewControl' => array(
'type' => 'boolean',
'default' => true,
),
'markers' => array(
'type' => 'object',
'default' => array(),
),
'mBGImageSrc' => array(
'type' => 'string',
'default' => 'self-hosted-local',
),
'mBGVideoSrc' => array(
'type' => 'string',
'default' => 'self-hosted-local',
),
'mBGVideoUrl' => array(
'type' => 'string',
'default' => 'https://www.youtube.com/watch?v=bGMi7L78hVk',
),
);
return $google_map_attr;
}
/**
* Render Google Map Data
*
* @since 1.0.1
* @access public
*
* @param array $attributes
* @param string $content
* @return string
*/
public function render_callback( $attributes, $content ) {
$id = isset( $attributes['id'] ) ? $attributes['id'] : 'gutentor-google-map-' . wp_rand( 10, 100 );
$blockID = isset( $attributes['blockID'] ) ? $attributes['blockID'] : '';
$default_class = gutentor_block_add_default_classes( 'gutentor-google-map', $attributes );
$align = isset( $attributes['align'] ) ? 'align' . $attributes['align'] : '';
$tag = $attributes['blockSectionHtmlTag'] ? $attributes['blockSectionHtmlTag'] : 'section';
$blockComponentAnimation = isset( $attributes['blockComponentAnimation'] ) ? $attributes['blockComponentAnimation'] : '';
$blockItemsWrapAnimation = isset( $attributes['blockItemsWrapAnimation'] ) ? $attributes['blockItemsWrapAnimation'] : '';
$tag = gutentor_get_module_tag( $tag );
$local_attr = array();
$local_attr['id'] = $id;
$local_attr['location'] = $attributes['location'];
$local_attr['latitude'] = $attributes['latitude'];
$local_attr['longitude'] = $attributes['longitude'];
$local_attr['zoom'] = $attributes['zoom'];
$local_attr['type'] = $attributes['type'];
$local_attr['draggable'] = $attributes['draggable'];
$local_attr['mapTypeControl'] = $attributes['mapTypeControl'];
$local_attr['zoomControl'] = $attributes['zoomControl'];
$local_attr['fullscreenControl'] = $attributes['fullscreenControl'];
$local_attr['streetViewControl'] = $attributes['streetViewControl'];
$local_attr['markers'] = $attributes['markers'];
$output = '<' . esc_attr( $tag ) . ' class="' . esc_attr( apply_filters( 'gutentor_save_section_class', gutentor_concat_space( 'gutentor-section gutentor-google-map', $align, $default_class ), $attributes ) ) . '" id="section-' . esc_attr( $blockID ) . '" ' . GutentorAnimationOptionsDataAttr( $blockComponentAnimation ) . '>' . "\n";
$output .= apply_filters( 'gutentor_save_before_container', '', $attributes );
$output .= "<div class='" . esc_attr( apply_filters( 'gutentor_save_container_class', 'grid-container', $attributes ) ) . "'>";
$output .= apply_filters( 'gutentor_save_before_block_items', '', $attributes );
$output .= '<div class="' . esc_attr( apply_filters( 'gutentor_save_grid_row_class', esc_attr( 'gutentor-grid-item-wrap' ), $attributes ) ) . '" id="' . esc_attr( $id ) . '" ' . GutentorAnimationOptionsDataAttr( $blockItemsWrapAnimation ) . '></div>' . "\n";
$output .= apply_filters( 'gutentor_save_after_block_items', '', $attributes );
$output .= '</div>' . "\n";
$output .= apply_filters( 'gutentor_save_after_container', '', $attributes );
$output .= '</' . esc_attr( $tag ) . '>' . "\n";
$output .= '<script type="text/javascript">' . "\n";
$output .= ' /* <![CDATA[ */' . "\n";
$output .= ' if ( ! window.gutentorGoogleMaps ) window.gutentorGoogleMaps =[];' . "\n";
$output .= ' window.gutentorGoogleMaps.push( { container: "' . esc_attr( $id ) . '", attributes: ' . wp_json_encode( $local_attr ) . ' } );' . "\n";
$output .= ' /* ]]> */' . "\n";
$output .= '</script>' . "\n";
return $output;
}
}
}
Gutentor_Google_Map::get_instance()->run();

View File

@@ -0,0 +1,78 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Image_Slider' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_Image_Slider extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'image-slider';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'slick' ),
'style_handles' => array( 'slick' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_Image_Slider::get_instance()->run();

View File

@@ -0,0 +1,77 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Progress_Bar' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_Progress_Bar extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'progress-bar';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'jquery-easypiechart' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_Progress_Bar::get_instance()->run();

View File

@@ -0,0 +1,78 @@
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Gutentor_Video_Popup' ) ) {
/**
* Functions related to Progress bar
*
* @package Gutentor
* @since 3.0.6
*/
class Gutentor_Video_Popup extends Gutentor_Block_Base {
/**
* Name of the block.
*
* @access protected
* @since 3.0.6
* @var string
*/
protected $block_name = 'video-popup';
/**
* Gets an instance of this object.
* Prevents duplicate instances which avoid artefacts and improves performance.
*
* @static
* @access public
* @since 3.0.6
* @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;
}
/**
* Set register_block_type_args variable on parent
* Used for blog template loading
*
* @since 3.0.6
* @package Gutentor
* @author Gutentor <info@gutentor.com>
*/
public function register_block_type_args() {
$this->register_block_type_args = array(
'view_script_handles' => array( 'magnific-popup' ),
'style_handles' => array( 'magnific-popup' ),
);
}
/**
* Just return content.
* It is for view_script_handles
*
* @param array $attributes Attributes array.
* @param string $content Content is always string.
* @return string
* @since 3.0.6
* @access public
*/
public function render_callback( $attributes, $content ) {
return $content;
}
}
}
Gutentor_Video_Popup::get_instance()->run();