Plugin Directory

Changeset 3279463


Ignore:
Timestamp:
04/22/2025 10:35:49 PM (9 months ago)
Author:
elementinvader
Message:

1.3.5

  • Element Blog Grid, added custom layout for grid results
  • Element Blog Grid Popup / Blog Grid Custom Layout text limit for description
  • security fix
Location:
elementinvader-addons-for-elementor
Files:
228 added
8 edited

Legend:

Unmodified
Added
Removed
  • elementinvader-addons-for-elementor/trunk/README.txt

    r3225509 r3279463  
    55Requires at least: 5.2
    66Requires PHP: 5.6
    7 Tested up to: 6.6
    8 Stable tag: 1.3.4
     7Tested up to: 6.8
     8Stable tag: 1.3.5
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    8989== Changelog ==
    9090
     91= 1.3.5 =
     92* Element Blog Grid, added custom layout for grid results
     93* Element Blog Grid Popup / Blog Grid Custom Layout text limit for description
     94* security fix
     95
    9196= 1.3.4 =
    9297* Added icons for blog card
  • elementinvader-addons-for-elementor/trunk/elementinvader-addons-for-elementor.php

    r3225509 r3279463  
    11<?php
     2
    23/**
    34 * Plugin Name: ElementInvader Addons for Elementor
    45 * Description: Ready to use Elementor Addon Elements like Menu, Forms, Maps, Newsletter with many styling options
    56 * Plugin URI:  https://elementinvader.com
    6  * Version:     1.3.4
     7 * Version:     1.3.5
    78 * Author:      ElementInvader
    89 * Author URI:  https://elementinvader.com
     
    1011 * Domain Path: /locale/
    1112 *
    12  * Elementor tested up to: 3.24.7
    13  * Elementor Pro tested up to: 3.26.7
     13 * Elementor tested up to: 3.28.4
     14 * Elementor Pro tested up to: 3.30.4
    1415 *
    1516 */
    1617
    17 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    18 
    19 define( 'ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__', __FILE__ );
    20 define( 'ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH', plugin_dir_path( __FILE__ ) );
    21 define( 'ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_URL', plugin_dir_url( __FILE__ ) );
     18if (! defined('ABSPATH')) exit; // Exit if accessed directly
     19
     20define('ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__', __FILE__);
     21define('ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH', plugin_dir_path(__FILE__));
     22define('ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_URL', plugin_dir_url(__FILE__));
    2223
    2324$elementinvader_addons_for_elementor_server_prtc = wp_get_server_protocol();
     
    3132 * @since 1.0.0
    3233 */
    33 function ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_load() {
    34 
    35     // Load wlistingation file
    36     load_plugin_textdomain( 'elementinvader-addons-for-elementor' , false, basename( dirname( __FILE__ ) ) . '/locale' );
    37 
    38     // Notice if the Elementor is not active
    39     if ( ! did_action( 'elementor/loaded' ) ) {
    40         $message = sprintf(
    41             esc_html__( '"%1$s" requires "%2$s" to be installed and activated.', 'elementinvader-addons-for-elementor' ),
    42             '<strong>' . esc_html__( 'ElementInvader Addons for Elementor', 'elementinvader-addons-for-elementor' ) . '</strong>',
    43             '<strong>' . esc_html__( 'Elementor', 'elementinvader-addons-for-elementor' ) . '</strong>'
    44         );
    45         sw_eli_notify_admin('fail_load', $message, function()
    46                                             {
    47                                                 $admin_page = get_current_screen();
    48                                                 if( $admin_page->base != "dashboard" ) return true;
    49                                                 if( ! current_user_can( 'update_plugins' ) ) return true;
    50                                             }, 'notice notice-warning'
    51         );
    52        
    53         return;
    54     }
    55 
    56     // Check required version
    57     $elementor_version_required = '1.8.0';
    58     if ( ! version_compare( ELEMENTOR_VERSION, $elementor_version_required, '>=' ) ) {
    59         $file_path = 'elementor/elementor.php';
    60         $upgrade_link = wp_nonce_url( self_admin_url( 'update.php?action=upgrade-plugin&plugin=' ) . $file_path, 'upgrade-plugin_' . $file_path );
    61         $message = '<p>' . esc_html__( 'ElementInvader Addon Elements for Elementor doesn\'t working because you are using an old version of Elementor.', 'elementinvader-addons-for-elementor' ) . '</p>';
    62         $message .= '<p>' . sprintf( '<a href="%s" class="button-primary">%s</a>', $upgrade_link, esc_html__( 'Update Elementor Now', 'elementinvader-addons-for-elementor' ) ) . '</p>';
    63        
    64         sw_eli_notify_admin('fail_load_out_of_date', $message, function()
    65                                             {
    66                                                 $admin_page = get_current_screen();
    67                                                 if( $admin_page->base != "dashboard" ) return true;
    68                                                 if( ! current_user_can( 'update_plugins' ) ) return true;
    69                                             }, 'notice notice-warning'
    70         );
    71     return;
    72     }
    73 
    74     // Require the main plugin file
    75     require( __DIR__ . '/plugin.php' );
    76 }
    77 
    78 add_action( 'plugins_loaded', 'ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_load' );
    79 
    80 
    81 function elementinvader_addons_for_elementor_add_elementor_widget_categories( $elements_manager ) {
    82    
    83         $elements_manager->add_category(
    84             'elementinvader',
    85             [
    86                 'title' => esc_html__( 'Elementinvader', 'elementinvader-addons-for-elementor' ),
    87                 'icon' => 'fa fa-plug',
    88             ]
    89         );
    90    
    91     }
    92    
    93     add_action( 'elementor/elements/categories_registered', 'elementinvader_addons_for_elementor_add_elementor_widget_categories' );
    94 
    95 
    96 if(!function_exists('esc_elemviewe')) {
    97     function esc_elemviewe($content) {
     34function ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_load()
     35{
     36
     37    // Load wlistingation file
     38    load_plugin_textdomain('elementinvader-addons-for-elementor', false, basename(dirname(__FILE__)) . '/locale');
     39
     40    // Notice if the Elementor is not active
     41    if (! did_action('elementor/loaded')) {
     42        $message = sprintf(
     43            esc_html__('"%1$s" requires "%2$s" to be installed and activated.', 'elementinvader-addons-for-elementor'),
     44            '<strong>' . esc_html__('ElementInvader Addons for Elementor', 'elementinvader-addons-for-elementor') . '</strong>',
     45            '<strong>' . esc_html__('Elementor', 'elementinvader-addons-for-elementor') . '</strong>'
     46        );
     47        sw_eli_notify_admin(
     48            'fail_load',
     49            $message,
     50            function () {
     51                $admin_page = get_current_screen();
     52                if ($admin_page->base != "dashboard") return true;
     53                if (! current_user_can('update_plugins')) return true;
     54            },
     55            'notice notice-warning'
     56        );
     57
     58        return;
     59    }
     60
     61    // Check required version
     62    $elementor_version_required = '1.8.0';
     63    if (! version_compare(ELEMENTOR_VERSION, $elementor_version_required, '>=')) {
     64        $file_path = 'elementor/elementor.php';
     65        $upgrade_link = wp_nonce_url(self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file_path, 'upgrade-plugin_' . $file_path);
     66        $message = '<p>' . esc_html__('ElementInvader Addon Elements for Elementor doesn\'t working because you are using an old version of Elementor.', 'elementinvader-addons-for-elementor') . '</p>';
     67        $message .= '<p>' . sprintf('<a href="%s" class="button-primary">%s</a>', $upgrade_link, esc_html__('Update Elementor Now', 'elementinvader-addons-for-elementor')) . '</p>';
     68
     69        sw_eli_notify_admin(
     70            'fail_load_out_of_date',
     71            $message,
     72            function () {
     73                $admin_page = get_current_screen();
     74                if ($admin_page->base != "dashboard") return true;
     75                if (! current_user_can('update_plugins')) return true;
     76            },
     77            'notice notice-warning'
     78        );
     79        return;
     80    }
     81
     82    // Require the main plugin file
     83    require(__DIR__ . '/plugin.php');
     84}
     85
     86add_action('plugins_loaded', 'ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_load');
     87
     88
     89function elementinvader_addons_for_elementor_add_elementor_widget_categories($elements_manager)
     90{
     91
     92    $elements_manager->add_category(
     93        'elementinvader',
     94        [
     95            'title' => esc_html__('Elementinvader', 'elementinvader-addons-for-elementor'),
     96            'icon' => 'fa fa-plug',
     97        ]
     98    );
     99}
     100
     101add_action('elementor/elements/categories_registered', 'elementinvader_addons_for_elementor_add_elementor_widget_categories');
     102
     103
     104if (!function_exists('esc_elemviewe')) {
     105    function esc_elemviewe($content)
     106    {
    98107        // @codingStandardsIgnoreStart
    99             echo ($content); // WPCS: XSS ok, sanitization ok.
     108        echo ($content); // WPCS: XSS ok, sanitization ok.
    100109        // @codingStandardsIgnoreEnd
    101110    }
    102 }   
    103 
    104 if(!function_exists('esc_elemview')) {
    105     function esc_elemview($content) {
     111}
     112
     113if (!function_exists('esc_elemview')) {
     114    function esc_elemview($content)
     115    {
    106116        // @codingStandardsIgnoreStart
    107             return ($content); // WPCS: XSS ok, sanitization ok.
     117        return ($content); // WPCS: XSS ok, sanitization ok.
    108118        // @codingStandardsIgnoreEnd
    109119    }
    110 }   
    111 
    112 function elementinvader_addons_for_elementor_setup(){
    113     wp_enqueue_style( 'fontawesome-5', plugins_url( '/assets/libs/fontawesome-5.8/css/fontawesome-5.css', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__ ), false, false);
    114     wp_enqueue_style( 'elementinvader_addons_for_elementor-main', plugins_url( '/assets/css/main.css', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__ ), false, false);
    115     wp_enqueue_style( 'elementinvader_addons_for_elementor-widgets', plugins_url( '/assets/css/widgets.css', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__ ), array(), '1.1');
    116     wp_enqueue_style( 'elementinvader_addons_for_elementor-hover-animations', plugins_url( '/assets/css/eli-hover.css', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__ ), false, false);
    117    
    118     wp_enqueue_style( 'wdk-scroll-mobile-swipe', plugins_url( '/assets/libs/wdkscrollmobileswipe/wdk-scroll-mobile-swipe.css', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__ ), false, false);
    119     wp_register_script('wdk-scroll-mobile-swipe', plugins_url( '/assets/libs/wdkscrollmobileswipe/wdk-scroll-mobile-swipe.js', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__ ), array( 'jquery' ), '1.0', false );
    120     wp_enqueue_script('wdk-scroll-mobile-swipe');
    121 
    122     wp_enqueue_script( 'elementinvader_addons_for_elementor-main' );
    123    
     120}
     121
     122function elementinvader_addons_for_elementor_setup()
     123{
     124    wp_enqueue_style('fontawesome-5', plugins_url('/assets/libs/fontawesome-5.8/css/fontawesome-5.css', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__), false, false);
     125    wp_enqueue_style('elementinvader_addons_for_elementor-main', plugins_url('/assets/css/main.css', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__), false, false);
     126    wp_enqueue_style('elementinvader_addons_for_elementor-widgets', plugins_url('/assets/css/widgets.css', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__), array(), '1.1');
     127    wp_enqueue_style('elementinvader_addons_for_elementor-hover-animations', plugins_url('/assets/css/eli-hover.css', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__), false, false);
     128
     129    wp_enqueue_style('wdk-scroll-mobile-swipe', plugins_url('/assets/libs/wdkscrollmobileswipe/wdk-scroll-mobile-swipe.css', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__), false, false);
     130    wp_register_script('wdk-scroll-mobile-swipe', plugins_url('/assets/libs/wdkscrollmobileswipe/wdk-scroll-mobile-swipe.js', ELEMENTINVADER_ADDONS_FOR_ELEMENTOR__FILE__), array('jquery'), '1.0', false);
     131    wp_enqueue_script('wdk-scroll-mobile-swipe');
     132
     133    wp_enqueue_script('elementinvader_addons_for_elementor-main');
    124134}
    125135
     
    128138
    129139
    130 function eli_installer(){
    131     include ( ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH."/include/intall.php");
    132 }
    133 add_action( 'plugins_loaded', 'eli_installer' );
     140function eli_installer()
     141{
     142    include(ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH . "/include/intall.php");
     143}
     144add_action('plugins_loaded', 'eli_installer');
    134145
    135146
    136147/* include */
    137 include ( ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH."/modules/mail_base/mail_base.php");
    138 include ( ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH."/helpers/plugin_helpers.php");
    139 include ( ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH."/shortcodes/shortcodes-init.php");
    140 
    141 include ( ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH."/modules/forms/ajax-handler.php");
     148include(ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH . "/modules/mail_base/mail_base.php");
     149include(ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH . "/helpers/plugin_helpers.php");
     150include(ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH . "/shortcodes/shortcodes-init.php");
     151
     152include(ELEMENTINVADER_ADDONS_FOR_ELEMENTOR_PATH . "/modules/forms/ajax-handler.php");
     153
    142154use ElementinvaderAddonsForElementor\Modules\Forms\Ajax_Handler;
     155
    143156$test = new Ajax_Handler();
    144157
    145        
     158
    146159/*
    147160* Add admin notify
     
    152165* @return boolen true
    153166*/
    154 function sw_eli_notify_admin ($key = '', $text = 'Custom Text of message', $callback_filter = '', $class = 'notice notice-error') {
    155     $key = 'eli_notify_'.$key;
    156     $key_diss = $key.'_dissmiss';
     167function sw_eli_notify_admin($key = '', $text = 'Custom Text of message', $callback_filter = '', $class = 'notice notice-error')
     168{
     169    $key = 'eli_notify_' . $key;
     170    $key_diss = $key . '_dissmiss';
    157171
    158172    $eli_notinstalled_admin_notice__error = function () use ($key_diss, $text, $class, $callback_filter) {
     
    160174        $user_id = get_current_user_id();
    161175        if (!get_user_meta($user_id, $key_diss)) {
    162             if(!empty($callback_filter)) if($callback_filter()) return false;
     176            if (!empty($callback_filter)) if ($callback_filter()) return false;
    163177
    164178            $message = '';
    165179            $message .= $text;
    166             printf('<div class="%1$s" style="position:relative;"><p>%2$s</p><a href="?'.$key_diss.'"><button type="button" class="notice-dismiss"></button></a></div>', esc_html($class), ($message));  // WPCS: XSS ok, sanitization ok.
     180            printf('<div class="%1$s" style="position:relative;"><p>%2$s</p><a href="?' . $key_diss . '"><button type="button" class="notice-dismiss"></button></a></div>', esc_html($class), ($message));  // WPCS: XSS ok, sanitization ok.
    167181        }
    168182    };
     
    185199
    186200
    187 function eli_customize_register( $wp_customize ) {
    188     /********************
     201function eli_customize_register($wp_customize)
     202{
     203    /********************
    189204    Define generic controls
    190     *********************/
    191 
    192     $wp_customize->add_setting('footer_logo', array('sanitize_callback' => 'eli_sanitize_callback'));
    193     $wp_customize->add_control(new WP_Customize_Image_Control(
    194         $wp_customize, 'footer_logo', array(
    195         'label' => esc_html__('Upload your custom footer image', 'elementinvader-addons-for-elementor'),
    196         'section' => 'title_tagline',
    197         'settings' => 'footer_logo'
    198         )
    199     ));
    200 }
    201 
    202 add_action( 'customize_register', 'eli_customize_register' );
    203 
    204 function eli_sanitize_callback($value) {
     205     *********************/
     206
     207    $wp_customize->add_setting('footer_logo', array('sanitize_callback' => 'eli_sanitize_callback'));
     208    $wp_customize->add_control(new WP_Customize_Image_Control(
     209        $wp_customize,
     210        'footer_logo',
     211        array(
     212            'label' => esc_html__('Upload your custom footer image', 'elementinvader-addons-for-elementor'),
     213            'section' => 'title_tagline',
     214            'settings' => 'footer_logo'
     215        )
     216    ));
     217}
     218
     219add_action('customize_register', 'eli_customize_register');
     220
     221function eli_sanitize_callback($value)
     222{
    205223    return $value;
    206224}
  • elementinvader-addons-for-elementor/trunk/views/blog_grid/widget_layout.php

    r3225509 r3279463  
    88        ?>
    99        <div class="eli_col" style="<?php echo wp_kses_post($helper_style);?>">
     10        <?php if(!empty($settings['custom_layout'])):?>
     11            <div class=" elementor-clickable eliblog-card <?php if($settings['thumbnail_cover'] == 'yes'):?> cover <?php endif;?> <?php if($settings['thumbnail_fixed_size'] == 'yes'):?> fixed-size <?php endif;?>"
     12                <?php if(isset($settings['is_popup_enable']) && $settings['is_popup_enable'] == 'yes'):?>
     13                data-eli-toggle="modal" data-eli-target="#eli_popup_modal_<?php echo esc_html($this->get_id_int());?>_<?php echo esc_html(get_the_ID()); ?>"
     14                <?php endif;?>
     15                >
     16            <?php
     17                $content = '';
     18                global $eli_post_id;
     19                $eli_post_id = get_the_ID();
     20
     21                $post_data = get_post($settings['custom_layout']);
     22                if($post_data){
     23                    if (!$post_data || $post_data->post_status != 'publish' || post_password_required($post_data)) {
     24                        $content = esc_html__( 'Page is not public', 'elementinvader-addons-for-elementor' );
     25                    } else {
     26                        if($post_data->post_type == 'page' || $post_data->post_type == 'elementor_library') {
     27                            $elementor_instance = \Elementor\Plugin::instance();
     28                            $content = $elementor_instance->frontend->get_builder_content_for_display($settings['custom_layout']);
     29                            if(empty($content ))
     30                                $content = $post_data->post_content;
     31                        } else {
     32                            $content = $post_data->post_content;
     33                        }
     34                    }
     35                    if($is_edit_mode) {
     36                        echo ($content);
     37                    } else {
     38                        echo wp_kses_post($content);
     39                    }
     40                   
     41                }
     42            ?>
     43            <a href="<?php echo esc_url( get_permalink() ); ?>" class="hover_link  elementor-clickable"
     44                <?php if(isset($settings['is_popup_enable']) && $settings['is_popup_enable'] == 'yes'):?>
     45                    data-eli-toggle="modal" data-eli-target="#eli_popup_modal_<?php echo esc_html($this->get_id_int());?>_<?php echo esc_html(get_the_ID()); ?>"
     46                <?php endif;?>
     47            ></a>
     48            </div>
     49        <?php else: ?>
    1050            <div class=" elementor-clickable eliblog-card <?php if($settings['thumbnail_cover'] == 'yes'):?> cover <?php endif;?> <?php if($settings['thumbnail_fixed_size'] == 'yes'):?> fixed-size <?php endif;?>"
    1151                <?php if(isset($settings['is_popup_enable']) && $settings['is_popup_enable'] == 'yes'):?>
     
    124164                <?php endif; ?>
    125165            </div>
     166
     167        <?php endif; ?>
    126168        </div>
    127169
  • elementinvader-addons-for-elementor/trunk/views/blog_preview/content.php

    r3112677 r3279463  
    11<div class="widget-eli eli_blog_preview_content" id="eli_<?php echo esc_html($this->get_id_int());?>">
    2     <?php if($is_edit_mode):?>
    3         <?php echo esc_html__('This is example content', 'elementinvader-addons-for-elementor');?>
    4         Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
    5         aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
    6         Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
    7     <?php else:?>
    8         <?php echo wp_kses_post(apply_filters('the_content', get_post($eli_post_id)->post_content));?>
    9     <?php endif?>
     2    <?php
     3        if($is_edit_mode) {
     4            $content = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna
     5                        aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
     6                        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. ';
     7        } else {
     8            $content = get_post($eli_post_id)->post_content;
     9            $content = strip_tags(strip_shortcodes($content));
     10        }
     11
     12        if(!empty($settings['text_limit'])) {
     13            echo (wp_strip_all_tags(html_entity_decode(wp_trim_words(htmlentities(wpautop($content)), $settings['text_limit'], '...'))));
     14        } else {
     15            echo wp_strip_all_tags(html_entity_decode(htmlentities(wpautop($content))));
     16        }
     17
     18    ?>
    1019</div>
  • elementinvader-addons-for-elementor/trunk/views/map/map_layout.php

    r3194288 r3279463  
    157157
    158158                $custom_js .= " 
    159                     $.get('https://nominatim.openstreetmap.org/search?format=json&q=" . $settings['address'] . "', function(data){
     159                    $.get('https://nominatim.openstreetmap.org/search?format=json&q=" . esc_js($settings['address']) . "', function(data){
    160160                        if(typeof data[0] !='undefined'){
    161161                            marker.setLatLng([data[0].lat, data[0].lon]).update();
     
    291291                var eli_geocoder = new google.maps.Geocoder();
    292292                eli_geocoder.geocode({
    293                     'address': '" . $settings['address'] . "'
     293                    'address': '" . esc_js($settings['address']) . "'
    294294                }, function(results, status) {
    295295
  • elementinvader-addons-for-elementor/trunk/widgets/blog-grid.php

    r3225509 r3279463  
    122122            ]
    123123        );
     124
     125        $this->add_control (
     126            'custom_layout',
     127            [
     128                'label' => __( 'Custom Layout ID', 'elementinvader-addons-for-elementor' ),
     129                'type' => \Elementor\Controls_Manager::TEXT,
     130                'default' => '',
     131                'placeholder' => __( 'put your template id', 'elementinvader-addons-for-elementor' ),
     132                'description' => __( 'Create layout here', 'elementinvader-addons-for-elementor' ).' '.sprintf(__('%1$s here %2$s','elementinvader-addons-for-elementor'),'<a target="_blank" href="'.admin_url('edit.php?post_type=elementor_library#add_new').'">','</a>'),
     133            ]
     134        );
    124135
    125136        $this->add_control(
  • elementinvader-addons-for-elementor/trunk/widgets/blog-preview-content.php

    r3210720 r3279463  
    9393        );
    9494
     95        $this->add_control(
     96            'text_limit',
     97            [
     98                'label' => esc_html__('Limit Words', 'elementinvader-addons-for-elementor'),
     99                'type' => \Elementor\Controls_Manager::NUMBER,
     100                'min' => 0,
     101                'max' => 1000,
     102                'step' => 1,
     103                'default' => 14,
     104            ]
     105        );
    95106
    96107        $this->end_controls_section();
  • elementinvader-addons-for-elementor/trunk/widgets/blog-preview-meta.php

    r3210720 r3279463  
    209209    {
    210210        $out = '';
    211         if(!empty($field) && wp_get_post_terms($field_id, $field, array('fields' => 'names')) && ( ! is_wp_error( wp_get_post_terms($field_id, $field, array('fields' => 'names')) ) ))
    212             $out = implode(',',wp_get_post_terms($field_id, $field, array('fields' => 'names')));
    213         elseif(function_exists('rwmb_meta') && !empty($field) &&  rwmb_meta( $field,[], $field_id)) {
    214             $out = rwmb_meta( $field,[], $field_id);
    215         } 
    216         if(empty($out))
     211
     212        // Return post date if requested
     213        if ($field === 'post_date') {
     214            $post = get_post($field_id);
     215            if ($post && !is_wp_error($post)) {
     216                $out = get_the_date('', $post);
     217            }
     218        }
     219        // Check for taxonomy terms
     220        elseif (!empty($field) && wp_get_post_terms($field_id, $field, ['fields' => 'names']) && !is_wp_error(wp_get_post_terms($field_id, $field, ['fields' => 'names']))) {
     221            $out = implode(',', wp_get_post_terms($field_id, $field, ['fields' => 'names']));
     222        }
     223        // Check for Meta Box value
     224        elseif (function_exists('rwmb_meta') && !empty($field) && rwmb_meta($field, [], $field_id)) {
     225            $out = rwmb_meta($field, [], $field_id);
     226        }
     227   
     228        if (empty($out)) {
    217229            $out = $default;
    218 
    219         return $out;
     230        }
     231   
     232        return $out;
    220233    }
    221234}
Note: See TracChangeset for help on using the changeset viewer.