D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
thread-self
/
cwd
/
wp-content
/
plugins
/
aeen-core
/
elementor
/
post
/
Filename :
class.php
back
Copy
<?php /** * This file can be overridden by copying it to yourtheme/elementor-custom/title/class.php * * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\Aeen_Core; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use radiustheme\aeen\inc\RDTheme; use radiustheme\aeen\inc\Helper; if ( ! defined( 'ABSPATH' ) ) exit; class Rt_Post extends Custom_Widget_Base { public function __construct( $data = [], $args = null ){ $this->rt_name = __( 'RT Post', 'aeen-core' ); $this->rt_base = 'rt-post'; $this->rt_translate = array( 'cols' => array( '12' => esc_html__( '1 Col', 'aeen-core' ), '6' => esc_html__( '2 Col', 'aeen-core' ), '4' => esc_html__( '3 Col', 'aeen-core' ), '3' => esc_html__( '4 Col', 'aeen-core' ), '2' => esc_html__( '6 Col', 'aeen-core' ), ), ); parent::__construct( $data, $args ); } public function rt_fields(){ $fields = array( array( 'id' => 'sec_post', 'mode' => 'section_start', 'label' => __( 'Post', 'aeen-core' ), ), array( 'id' => 'layout', 'label' => esc_html__( 'Layouts', 'aeen-core' ), 'type' => Controls_Manager::SELECT2, 'options' => array( 'style1' => __( 'Style 1', 'aeen-core' ), 'style2' => __( 'Style 2', 'aeen-core' ), 'style3' => __( 'Style 3', 'aeen-core' ), ), 'default' => 'style1', 'label_block' => true, ), // Post Type array( 'type' => Controls_Manager::SELECT2, 'id' => 'post_type', 'label' => __( 'Select post type', 'aeen-core' ), 'options' => Helper::rt_registered_post_type(), 'label_block' => true, ), array( 'id' => 'filter_pagination', 'type' => Controls_Manager::SELECT2, 'label' => esc_html__( 'Filter/Pagination', 'aeen-core' ), 'options' => array( 'filter' => esc_html__( 'Filter', 'aeen-core' ), 'pagina' => esc_html__( 'Pagination', 'aeen-core' ), ), 'default' => 'pagina', 'label_block' => true, 'condition' => array( 'layout' => array( 'blog_grid', 'service_grid_1', 'service_grid_2', 'project_grid' ) ), ), // Terms array( 'id' => 'taxonomy_type', 'label' => __( 'Select Taxonomy', 'aeen-core' ), 'type' => Controls_Manager::SELECT2, 'options' => '', 'condition' => [ 'post_type!' =>'', 'filter_pagination' => array( 'filter' ) ], 'label_block' => true, ), // Terms array( 'id' => 'terms', 'label' => __( 'Select Terms', 'aeen-core' ), 'type' => Controls_Manager::SELECT2, 'label_block' => true, 'options' => '', 'multiple' => true, 'condition' => [ 'taxonomy_type!' =>'', 'filter_pagination' => array( 'filter' ) ], 'label_block' => true, ), // Post per page array( 'id' => 'number', 'label' =>esc_html__( 'Total number of Posts', 'aeen-core' ), 'type' => Controls_Manager::NUMBER, 'default' => 3, 'description' =>esc_html__( 'Write -1 to show all', 'aeen-core' ), 'label_block' => true, ), // Excerpt Length array( 'id' => 'excerpt_lenght', 'type' => Controls_Manager::NUMBER, 'label' => esc_html__( 'Number Of words for excerpt', 'aeen-core' ), 'default' => 20, 'label_block' => true, 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'id' => 'orderby', 'label' => esc_html__( 'Order By', 'aeen-core' ), 'type' => Controls_Manager::SELECT2, 'options' => array( 'date' => esc_html__( 'Date (Recents comes first)', 'aeen-core' ), 'title' => esc_html__( 'Title', 'aeen-core' ), 'menu_order' => esc_html__( 'Custom Order (Available via Order field inside Page Attributes box)', 'aeen-core' ), ), 'default' => 'date', 'label_block' => true, ), array( 'id' => 'order', 'label' => esc_html__( 'Order', 'aeen-core' ), 'type' => Controls_Manager::SELECT2, 'options' => array( 'ASC' => __( 'Ascending Order', 'aeen-core' ), 'DESC' => __( 'Descending', 'aeen-core' ), ), 'default' => 'DESC', 'label_block' => true, ), array( 'type' => Controls_Manager::SWITCHER, 'id' => 'post_cat', 'label' => esc_html__( 'Category', 'aeen-core' ), 'label_on' => esc_html__( 'On', 'aeen-core' ), 'label_off' => esc_html__( 'Off', 'aeen-core' ), 'return_value' => 'on', 'default' => 'on', 'description' => esc_html__( 'Enable or disable post category. Default: On', 'aeen-core' ), 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'type' => Controls_Manager::SWITCHER, 'id' => 'post_date', 'label' => esc_html__( 'Date', 'aeen-core' ), 'label_on' => esc_html__( 'On', 'aeen-core' ), 'label_off' => esc_html__( 'Off', 'aeen-core' ), 'return_value' => 'on', 'default' => 'on', 'description' => esc_html__( 'Enable or disable post date. Default: On', 'aeen-core' ), 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'type' => Controls_Manager::SWITCHER, 'id' => 'post_admin', 'label' => esc_html__( 'Admin', 'aeen-core' ), 'label_on' => esc_html__( 'On', 'aeen-core' ), 'label_off' => esc_html__( 'Off', 'aeen-core' ), 'return_value' => 'on', 'default' => 'on', 'description' => esc_html__( 'Enable or disable post admin. Default: On', 'aeen-core' ), 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'type' => Controls_Manager::SWITCHER, 'id' => 'post_social_share_icons', 'label' => esc_html__( 'Social Share', 'aeen-core' ), 'label_on' => esc_html__( 'On', 'aeen-core' ), 'label_off' => esc_html__( 'Off', 'aeen-core' ), 'return_value' => 'on', 'default' => 'on', 'description' => esc_html__( 'Enable or disable post admin. Default: On', 'aeen-core' ), 'condition' => array( 'layout' => array( 'style1' ) ), ), array( 'mode' => 'section_end', ), // Responsive Columns array( 'mode' => 'section_start', 'id' => 'sec_responsive', 'label' => esc_html__( 'Number of Responsive Columns', 'aeen-core' ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'col_lg', 'label' => esc_html__( 'Desktops: > 1199px', 'aeen-core' ), 'options' => $this->rt_translate['cols'], 'default' => '4', ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'col_md', 'label' => esc_html__( 'Desktops: > 991px', 'aeen-core' ), 'options' => $this->rt_translate['cols'], 'default' => '4', ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'col_sm', 'label' => esc_html__( 'Tablets: > 767px', 'aeen-core' ), 'options' => $this->rt_translate['cols'], 'default' => '6', ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'col_xs', 'label' => esc_html__( 'Phones: < 768px', 'aeen-core' ), 'options' => $this->rt_translate['cols'], 'default' => '12', ), array( 'mode' => 'section_end', ), array( 'id' => 'sec_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Style', 'aeen-core' ), ), array( 'id' => 'title_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Title Style', 'aeen-core' ), 'separator' => 'before', ), array( 'id' => 'title_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .blog-box-layout1 .item-content .entry-title a' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout2 .item-content .entry-title a' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout4 .item-content .entry-title a' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'title_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .blog-box-layout1 .item-content .entry-title a, {{WRAPPER}} .blog-box-layout2 .item-content .entry-title a, {{WRAPPER}} .blog-box-layout4 .item-content .entry-title a', ), array( 'id' => 'title_hover_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Hover Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .blog-box-layout1 .item-content .entry-title a:hover' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout2 .item-content .entry-title a:hover' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout4 .item-content .entry-title a:hover' => 'color: {{VALUE}}', ), ), array( 'id' => 'desc_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Description Style', 'aeen-core' ), 'separator' => 'before', 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'id' => 'desc_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .blog-box-layout1 .item-content p' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout2 .item-content p' => 'color: {{VALUE}}', ), 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'desc_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .blog-box-layout1 .item-content p, {{WRAPPER}} .blog-box-layout2 .item-content p', 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'id' => 'date_meta_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Date Style', 'aeen-core' ), 'separator' => 'before', 'condition' => array( 'layout' => array( 'style2', 'style3' ) ), ), array( 'id' => 'date_meta_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .blog-box-layout2 .item-content .item-date' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout4 .item-content .item-dates span' => 'color: {{VALUE}}', ), 'condition' => array( 'layout' => array( 'style2', 'style3' ) ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'date_meta_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .blog-box-layout2 .item-content .item-date, {{WRAPPER}} .blog-box-layout4 .item-content .item-dates span', 'condition' => array( 'layout' => array( 'style2', 'style3' ) ), ), array( 'id' => 'date_meta_bg_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Background Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .blog-box-layout2 .item-content .item-date' => 'background-color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout2 .item-content .item-date:before' => 'border-top-color: {{VALUE}}', ), 'condition' => array( 'layout' => array( 'style2' ) ), ), array( 'id' => 'meta_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Meta Style', 'aeen-core' ), 'separator' => 'before', 'condition' => array( 'layout' => array( 'style2', 'style3' ) ), ), array( 'id' => 'meta_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .blog-box-layout2 ul.entry-meta li a' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout2 ul.entry-meta li' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout4 .item-meta ul li a' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'meta_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .blog-box-layout2 ul.entry-meta li a, {{WRAPPER}} .blog-box-layout2 ul.entry-meta li, {{WRAPPER}} .blog-box-layout4 .item-meta ul li a', ), array( 'id' => 'meta_hover_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Hover Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .blog-box-layout2 ul.entry-meta li a:hover' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout4 .item-meta ul li:hover a' => 'color: {{VALUE}}', ), ), array( 'id' => 'meta_icon_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Meta Icon', 'aeen-core' ), 'separator' => 'before', 'condition' => array( 'layout' => array( 'style2', 'style3' ) ), ), array( 'id' => 'meta_icon_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .blog-box-layout2 ul.entry-meta li i' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout4 .item-meta ul li span' => 'color: {{VALUE}}', ), ), array( 'name' => 'meta_icon_typo', 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .blog-box-layout2 ul.entry-meta li i, {{WRAPPER}} .blog-box-layout4 .item-meta ul li span', ), array( 'id' => 'readmore_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Read More Style', 'aeen-core' ), 'separator' => 'before', 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'id' => 'readmore_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .blog-box-layout1 .blog-btn' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout2 .blog-btn' => 'color: {{VALUE}}', ), 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'readmore_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .blog-box-layout1 .blog-btn, {{WRAPPER}} .blog-box-layout2 .blog-btn', 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'id' => 'readmore_hover_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Hover Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .blog-box-layout1 .blog-btn:hover' => 'color: {{VALUE}}', '{{WRAPPER}} .blog-box-layout2 .blog-btn:hover' => 'color: {{VALUE}}', ), 'condition' => array( 'layout' => array( 'style1', 'style2' ) ), ), array( 'mode' => 'section_end', ), ); return $fields; } protected function render() { $data = $this->get_settings(); switch ($data['layout']) { case 'style3': $template = 'view-3'; break; case 'style2': $template = 'view-2'; break; default: $template = 'view-1'; break; } return $this->rt_template( $template, $data ); } } // Current file ajax settings $current_url=esc_url("//".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); if( strpos( $current_url, 'action=elementor') == true ){ add_action( 'wp_footer', function() { if ( ! defined( 'ELEMENTOR_VERSION' ) ) { return; } wp_enqueue_script( 'aeen-core', AEEN_CORE_BASE_URL . 'assets/js/aeen-core.js' , array(), '', true ); // make the ajaxurl var available to the above script wp_localize_script( 'aeen-core', 'rtajax_handler', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), ) ); } ); }