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'] ) {