From c3d8a73d9760352719da271ee13cfe676f5af075 Mon Sep 17 00:00:00 2001 From: stiofan Date: Mon, 14 Feb 2022 16:31:38 +0000 Subject: [PATCH] 1.0.28 --- change-log.txt | 6 +++--- composer.json | 2 +- wp-super-duper.php | 12 ++++-------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/change-log.txt b/change-log.txt index 9f15422..dbd9150 100644 --- a/change-log.txt +++ b/change-log.txt @@ -1,8 +1,8 @@ -= 1.0.29 = -* Block editor multi-select dropdown style issue - FIXED - = 1.0.28 = * Some extra escaping block parameters - CHANGED +* Block editor multi-select dropdown style issue - FIXED +* If tinyMCE is undefined the inserter can fail - FIXED +* block_show_advanced() sometimes has no arguments - FIXED = 1.0.27 = * Category settings loads only 10 categories on CPT change - FIXED diff --git a/composer.json b/composer.json index 344cad5..f7b77f4 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "ayecode/wp-super-duper", - "version": "2.0.2", + "version": "1.0.28", "type": "library", "description": "Lets you create a widget, block and shortcode all from the one file .", "keywords": ["WordPress","super duper","wp"], diff --git a/wp-super-duper.php b/wp-super-duper.php index c2ce0af..c8cbd91 100755 --- a/wp-super-duper.php +++ b/wp-super-duper.php @@ -17,7 +17,7 @@ */ class WP_Super_Duper extends WP_Widget { - public $version = "1.0.27"; + public $version = "1.0.28"; public $font_awesome_icon_version = "5.11.2"; public $block_code; public $options; @@ -691,7 +691,7 @@ function sd_insert_shortcode($editor_id) { $editor_id = '#generate-sections-modal-dialog ' + $editor_id; tmceActive = jQuery($editor_id).closest('.wp-editor-wrap').hasClass('tmce-active') ? true : false; } - if (tinyMCE && tinyMCE.activeEditor && tmceActive) { + if (typeof tinyMCE !== 'undefined' && tinyMCE.activeEditor && tmceActive) { tinyMCE.execCommand('mceInsertContent', false, $shortcode); } else { var $txt = jQuery($editor_id); @@ -1548,12 +1548,8 @@ public function register_block() { public function block_show_advanced() { $show = false; - $arguments = $this->arguments; - - if ( empty( $arguments ) ) { - $arguments = $this->get_arguments(); - } - + $arguments = $this->get_arguments(); + if ( ! empty( $arguments ) ) { foreach ( $arguments as $argument ) { if ( isset( $argument['advanced'] ) && $argument['advanced'] ) {