Plugin Directory

Changeset 2390991


Ignore:
Timestamp:
09/30/2020 02:19:56 PM (5 years ago)
Author:
hqtheme
Message:

Updating post content and post excerpt widgets

Location:
hq-widgets-for-elementor
Files:
12 edited
1 copied

Legend:

Unmodified
Added
Removed
  • hq-widgets-for-elementor/tags/1.0.1/assets/css/templates/widgets.tpl.css

    r2389368 r2390991  
    1717.swiper-pagination .swiper-pagination-bullet:focus {
    1818    outline: none;
     19}
     20
     21/* CUSTOM CHECKBOXES */
     22.hq-checkboxes label {
     23    cursor: pointer;
     24    display: inline-block;
     25    position: relative;
     26    padding-left: 30px;
     27    -webkit-user-select: none;
     28    -moz-user-select: none;
     29    -ms-user-select: none;
     30    user-select: none;
     31}
     32.hq-checkboxes input[type="checkbox"] {
     33    position: absolute;
     34    opacity: 0;
     35    cursor: pointer;
     36    height: 0;
     37    width: 0;
     38}
     39.hq-checkboxes label span:before {
     40    content: '';
     41    display: inline-block;
     42    position: absolute;
     43    top: 0;
     44    bottom: 0;
     45    left: 0;
     46    margin-top: auto;
     47    margin-bottom: auto;
     48    height: 20px;
     49    width: 20px;
     50    background-color: #fff;
     51    border: 1px solid #999;
     52}
     53.hq-checkboxes label input[type="checkbox"]:checked ~ span:before {
     54    background-color: #fff;
     55}
     56.hq-checkboxes label span:after {
     57    content: '';
     58    display: inline-block;
     59    cursor: pointer;
     60    height: 12px;
     61    width: 8px;
     62    border: none;
     63    transform: rotate(45deg);
     64    top: -5px;
     65    bottom: 0;
     66    left: 6px;
     67    margin-top: auto;
     68    margin-bottom: auto;
     69    position: absolute;
     70}
     71.hq-checkboxes label input[type="checkbox"]:checked ~ span:after {
     72    border: solid #666;
     73    border-width: 0 2px 2px 0;
     74}
     75
     76/* CUSTOM RADIO */
     77.hq-radio label {
     78    cursor: pointer;
     79    display: block!important;
     80    position: relative;
     81    padding-left: 30px;
     82}
     83.hq-radio input[type="radio"] {
     84    position: absolute;
     85    opacity: 0;
     86    cursor: pointer;
     87    height: 0;
     88    width: 0;
     89}
     90.hq-radio label span:before {
     91    content: '';
     92    display: inline-block;
     93    position: absolute;
     94    top: 0;
     95    bottom: 0;
     96    left: 0;
     97    margin-top: auto;
     98    margin-bottom: auto;
     99    height: 20px;
     100    width: 20px;
     101    background-color: #fff;
     102    border: 1px solid #999;
     103    border-radius: 99px;
     104}
     105.hq-radio label input:checked ~ span:before {
     106    background-color: #fff;
     107}
     108.hq-radio label span:after {
     109    content: '';
     110    display: inline-block;
     111    position: absolute;
     112    top: 0;
     113    bottom: 0;
     114    left: 6px;
     115    margin-top: auto;
     116    margin-bottom: auto;
     117    cursor: pointer;
     118    height: 8px;
     119    width: 8px;
     120    border-radius: 99px;
     121    background: none;
     122}
     123
     124.hq-radio label input:checked ~ span:after {
     125    background: #666;
    19126}
    20127
  • hq-widgets-for-elementor/tags/1.0.1/hq-widgets-for-elementor.php

    r2389368 r2390991  
    55 * Plugin URI:        https://hqtheme.net/hq-widgets-for-elementor/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_term=hq-widgets-for-elementor&utm_content=plugin-uri
    66 * Description:       The HQ Widgets for Elementor is an elementor addons package for Elementor page builder plugin for WordPress. Works Best with HQTheme
    7  * Version:           1.0.0
     7 * Version:           1.0.1
    88 * Requires at least: 5.3
    99 * Requires PHP:      7.2
     
    6262 * @var string
    6363 */
    64 const VERSION = '1.0.0';
     64const VERSION = '1.0.1';
    6565
    6666// Load Autoloader
  • hq-widgets-for-elementor/tags/1.0.1/inc/widget/theme/post-content.php

    r2389368 r2390991  
    1515use const HQWidgetsForElementor\VERSION;
    1616
    17 class Post_Content extends Widget_Base {
     17class Post_Content extends \HQWidgetsForElementor\Widget\Base {
    1818
    1919    public function __construct($data = [], $args = null) {
     
    4848
    4949    protected function _register_controls() {
     50
     51        $this->register_test_post_item_section_controls();
     52
    5053        $this->start_controls_section(
    5154                'section_content', [
     
    226229
    227230        $post = get_post();
    228        
     231
    229232        if (empty($post)) {
    230233            return;
     
    236239            return;
    237240        }
    238        
     241
    239242        // Avoid recursion
    240243        if (isset($did_posts[$post->ID])) {
     
    244247        // End avoid recursion
    245248
     249        $settings = $this->get_settings_for_display();
     250
     251        // Prepare post for editor mode
    246252        if (Plugin::instance()->editor->is_edit_mode()) {
    247             try {
    248                 echo file_get_contents(dirname(__FILE__) . '/../demo-content/post-content.html');
    249             } catch (Exception $exc) {
    250                 echo '<p>This is demo content.</p>';
     253            if (!$settings['test_post_item']) {
     254                ?>
     255                <div class="elementor-alert elementor-alert-info" role="alert">
     256                    <span class="elementor-alert-title">
     257                        <?php esc_html_e('Please select Test Item', 'hq-widgets-for-elementor'); ?>
     258                    </span>
     259                    <span class="elementor-alert-description">
     260                        <?php esc_html_e('Test Item is used only in edit mode for better customization. On live page it will be ignored.', 'hq-widgets-for-elementor'); ?>
     261                    </span>
     262                </div>
     263                <?php
     264                return;
    251265            }
     266            Plugin::instance()->db->switch_to_post($settings['test_post_item']);
    252267        } else {
     268
    253269            Plugin::instance()->frontend->remove_content_filter();
    254270
    255271            // Split to pages.
    256272            setup_postdata($post);
    257 
    258             /** This filter is documented in wp-includes/post-template.php */
    259             echo apply_filters('the_content', get_the_content());
     273        }
     274
     275        /** This filter is documented in wp-includes/post-template.php */
     276        echo apply_filters('the_content', get_the_content());
     277
     278        // Rollback to the previous global post
     279        if (Plugin::instance()->editor->is_edit_mode()) {
     280            Plugin::instance()->db->restore_current_post();
     281        } else {
    260282
    261283            Plugin::instance()->frontend->add_content_filter();
    262 
    263             return;
    264284        }
    265285    }
  • hq-widgets-for-elementor/tags/1.0.1/inc/widget/theme/post-excerpt.php

    r2389368 r2390991  
    1010use Elementor\Scheme_Color;
    1111use Elementor\Scheme_Typography;
    12 use Elementor\Widget_Base;
    1312use const HQWidgetsForElementor\PLUGIN_SLUG;
    1413
    15 class Post_Excerpt extends Widget_Base {
     14class Post_Excerpt extends Posts {
    1615
    1716    public function get_name() {
     
    3635
    3736    protected function _register_controls() {
     37
     38        $this->register_test_post_item_section_controls();
    3839
    3940        $this->start_controls_section(
     
    111112
    112113    protected function render() {
     114        $settings = $this->get_settings_for_display();
     115
     116        // Prepare post for editor mode
    113117        if (Plugin::instance()->editor->is_edit_mode()) {
    114             try {
    115                 echo file_get_contents(dirname(__FILE__) . '/../demo-content/post-excerpt.html');
    116             } catch (Exception $exc) {
    117                 echo '<p>This is demo excerpt.</p>';
     118            if (empty($settings['test_post_item'])) {
     119                ?>
     120                <div class="elementor-alert elementor-alert-info" role="alert">
     121                    <span class="elementor-alert-title">
     122                        <?php esc_html_e('Please select Test Item', 'hq-widgets-for-elementor'); ?>
     123                    </span>
     124                    <span class="elementor-alert-description">
     125                        <?php esc_html_e('Test Item is used only in edit mode for better customization. On live page it will be ignored.', 'hq-widgets-for-elementor'); ?>
     126                    </span>
     127                </div>
     128                <?php
     129                return;
    118130            }
    119         } else {
    120             the_excerpt();
     131            Plugin::instance()->db->switch_to_post($settings['test_post_item']);
     132        }
     133
     134        the_excerpt();
     135
     136        // Rollback to the previous global post
     137        if (Plugin::instance()->editor->is_edit_mode()) {
     138            Plugin::instance()->db->restore_current_post();
    121139        }
    122140    }
  • hq-widgets-for-elementor/tags/1.0.1/inc/widget/theme/post-meta-data.php

    r2389368 r2390991  
    10321032        </ul>
    10331033        <?php
    1034         //Rollback to the previous global post
     1034        // Rollback to the previous global post
    10351035        if (Plugin::instance()->editor->is_edit_mode()) {
    10361036            Plugin::instance()->db->restore_current_post();
  • hq-widgets-for-elementor/tags/1.0.1/readme.txt

    r2389368 r2390991  
    55Tested up to: 5.5
    66Requires PHP: 7.2
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPL v2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    131131= 1.0.0 - 2020-09-20 =
    132132* Initial Public Release!
     133
     134
     135= 1.0.1 - 2020-09-20 =
     136* Updating post content and post excerpt widgets
  • hq-widgets-for-elementor/trunk/assets/css/templates/widgets.tpl.css

    r2389368 r2390991  
    1717.swiper-pagination .swiper-pagination-bullet:focus {
    1818    outline: none;
     19}
     20
     21/* CUSTOM CHECKBOXES */
     22.hq-checkboxes label {
     23    cursor: pointer;
     24    display: inline-block;
     25    position: relative;
     26    padding-left: 30px;
     27    -webkit-user-select: none;
     28    -moz-user-select: none;
     29    -ms-user-select: none;
     30    user-select: none;
     31}
     32.hq-checkboxes input[type="checkbox"] {
     33    position: absolute;
     34    opacity: 0;
     35    cursor: pointer;
     36    height: 0;
     37    width: 0;
     38}
     39.hq-checkboxes label span:before {
     40    content: '';
     41    display: inline-block;
     42    position: absolute;
     43    top: 0;
     44    bottom: 0;
     45    left: 0;
     46    margin-top: auto;
     47    margin-bottom: auto;
     48    height: 20px;
     49    width: 20px;
     50    background-color: #fff;
     51    border: 1px solid #999;
     52}
     53.hq-checkboxes label input[type="checkbox"]:checked ~ span:before {
     54    background-color: #fff;
     55}
     56.hq-checkboxes label span:after {
     57    content: '';
     58    display: inline-block;
     59    cursor: pointer;
     60    height: 12px;
     61    width: 8px;
     62    border: none;
     63    transform: rotate(45deg);
     64    top: -5px;
     65    bottom: 0;
     66    left: 6px;
     67    margin-top: auto;
     68    margin-bottom: auto;
     69    position: absolute;
     70}
     71.hq-checkboxes label input[type="checkbox"]:checked ~ span:after {
     72    border: solid #666;
     73    border-width: 0 2px 2px 0;
     74}
     75
     76/* CUSTOM RADIO */
     77.hq-radio label {
     78    cursor: pointer;
     79    display: block!important;
     80    position: relative;
     81    padding-left: 30px;
     82}
     83.hq-radio input[type="radio"] {
     84    position: absolute;
     85    opacity: 0;
     86    cursor: pointer;
     87    height: 0;
     88    width: 0;
     89}
     90.hq-radio label span:before {
     91    content: '';
     92    display: inline-block;
     93    position: absolute;
     94    top: 0;
     95    bottom: 0;
     96    left: 0;
     97    margin-top: auto;
     98    margin-bottom: auto;
     99    height: 20px;
     100    width: 20px;
     101    background-color: #fff;
     102    border: 1px solid #999;
     103    border-radius: 99px;
     104}
     105.hq-radio label input:checked ~ span:before {
     106    background-color: #fff;
     107}
     108.hq-radio label span:after {
     109    content: '';
     110    display: inline-block;
     111    position: absolute;
     112    top: 0;
     113    bottom: 0;
     114    left: 6px;
     115    margin-top: auto;
     116    margin-bottom: auto;
     117    cursor: pointer;
     118    height: 8px;
     119    width: 8px;
     120    border-radius: 99px;
     121    background: none;
     122}
     123
     124.hq-radio label input:checked ~ span:after {
     125    background: #666;
    19126}
    20127
  • hq-widgets-for-elementor/trunk/hq-widgets-for-elementor.php

    r2389368 r2390991  
    55 * Plugin URI:        https://hqtheme.net/hq-widgets-for-elementor/?utm_source=wp-admin&utm_medium=link&utm_campaign=default&utm_term=hq-widgets-for-elementor&utm_content=plugin-uri
    66 * Description:       The HQ Widgets for Elementor is an elementor addons package for Elementor page builder plugin for WordPress. Works Best with HQTheme
    7  * Version:           1.0.0
     7 * Version:           1.0.1
    88 * Requires at least: 5.3
    99 * Requires PHP:      7.2
     
    6262 * @var string
    6363 */
    64 const VERSION = '1.0.0';
     64const VERSION = '1.0.1';
    6565
    6666// Load Autoloader
  • hq-widgets-for-elementor/trunk/inc/widget/theme/post-content.php

    r2389368 r2390991  
    1515use const HQWidgetsForElementor\VERSION;
    1616
    17 class Post_Content extends Widget_Base {
     17class Post_Content extends \HQWidgetsForElementor\Widget\Base {
    1818
    1919    public function __construct($data = [], $args = null) {
     
    4848
    4949    protected function _register_controls() {
     50
     51        $this->register_test_post_item_section_controls();
     52
    5053        $this->start_controls_section(
    5154                'section_content', [
     
    226229
    227230        $post = get_post();
    228        
     231
    229232        if (empty($post)) {
    230233            return;
     
    236239            return;
    237240        }
    238        
     241
    239242        // Avoid recursion
    240243        if (isset($did_posts[$post->ID])) {
     
    244247        // End avoid recursion
    245248
     249        $settings = $this->get_settings_for_display();
     250
     251        // Prepare post for editor mode
    246252        if (Plugin::instance()->editor->is_edit_mode()) {
    247             try {
    248                 echo file_get_contents(dirname(__FILE__) . '/../demo-content/post-content.html');
    249             } catch (Exception $exc) {
    250                 echo '<p>This is demo content.</p>';
     253            if (!$settings['test_post_item']) {
     254                ?>
     255                <div class="elementor-alert elementor-alert-info" role="alert">
     256                    <span class="elementor-alert-title">
     257                        <?php esc_html_e('Please select Test Item', 'hq-widgets-for-elementor'); ?>
     258                    </span>
     259                    <span class="elementor-alert-description">
     260                        <?php esc_html_e('Test Item is used only in edit mode for better customization. On live page it will be ignored.', 'hq-widgets-for-elementor'); ?>
     261                    </span>
     262                </div>
     263                <?php
     264                return;
    251265            }
     266            Plugin::instance()->db->switch_to_post($settings['test_post_item']);
    252267        } else {
     268
    253269            Plugin::instance()->frontend->remove_content_filter();
    254270
    255271            // Split to pages.
    256272            setup_postdata($post);
    257 
    258             /** This filter is documented in wp-includes/post-template.php */
    259             echo apply_filters('the_content', get_the_content());
     273        }
     274
     275        /** This filter is documented in wp-includes/post-template.php */
     276        echo apply_filters('the_content', get_the_content());
     277
     278        // Rollback to the previous global post
     279        if (Plugin::instance()->editor->is_edit_mode()) {
     280            Plugin::instance()->db->restore_current_post();
     281        } else {
    260282
    261283            Plugin::instance()->frontend->add_content_filter();
    262 
    263             return;
    264284        }
    265285    }
  • hq-widgets-for-elementor/trunk/inc/widget/theme/post-excerpt.php

    r2389368 r2390991  
    1010use Elementor\Scheme_Color;
    1111use Elementor\Scheme_Typography;
    12 use Elementor\Widget_Base;
    1312use const HQWidgetsForElementor\PLUGIN_SLUG;
    1413
    15 class Post_Excerpt extends Widget_Base {
     14class Post_Excerpt extends Posts {
    1615
    1716    public function get_name() {
     
    3635
    3736    protected function _register_controls() {
     37
     38        $this->register_test_post_item_section_controls();
    3839
    3940        $this->start_controls_section(
     
    111112
    112113    protected function render() {
     114        $settings = $this->get_settings_for_display();
     115
     116        // Prepare post for editor mode
    113117        if (Plugin::instance()->editor->is_edit_mode()) {
    114             try {
    115                 echo file_get_contents(dirname(__FILE__) . '/../demo-content/post-excerpt.html');
    116             } catch (Exception $exc) {
    117                 echo '<p>This is demo excerpt.</p>';
     118            if (empty($settings['test_post_item'])) {
     119                ?>
     120                <div class="elementor-alert elementor-alert-info" role="alert">
     121                    <span class="elementor-alert-title">
     122                        <?php esc_html_e('Please select Test Item', 'hq-widgets-for-elementor'); ?>
     123                    </span>
     124                    <span class="elementor-alert-description">
     125                        <?php esc_html_e('Test Item is used only in edit mode for better customization. On live page it will be ignored.', 'hq-widgets-for-elementor'); ?>
     126                    </span>
     127                </div>
     128                <?php
     129                return;
    118130            }
    119         } else {
    120             the_excerpt();
     131            Plugin::instance()->db->switch_to_post($settings['test_post_item']);
     132        }
     133
     134        the_excerpt();
     135
     136        // Rollback to the previous global post
     137        if (Plugin::instance()->editor->is_edit_mode()) {
     138            Plugin::instance()->db->restore_current_post();
    121139        }
    122140    }
  • hq-widgets-for-elementor/trunk/inc/widget/theme/post-meta-data.php

    r2389368 r2390991  
    10321032        </ul>
    10331033        <?php
    1034         //Rollback to the previous global post
     1034        // Rollback to the previous global post
    10351035        if (Plugin::instance()->editor->is_edit_mode()) {
    10361036            Plugin::instance()->db->restore_current_post();
  • hq-widgets-for-elementor/trunk/readme.txt

    r2389368 r2390991  
    55Tested up to: 5.5
    66Requires PHP: 7.2
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPL v2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    131131= 1.0.0 - 2020-09-20 =
    132132* Initial Public Release!
     133
     134
     135= 1.0.1 - 2020-09-20 =
     136* Updating post content and post excerpt widgets
Note: See TracChangeset for help on using the changeset viewer.