wp-shortcake / shortcake

Shortcake makes using WordPress shortcodes a piece of cake.
GNU General Public License v2.0
665 stars 143 forks source link

Gutenberg compatibility issue #806

Closed billerickson closed 3 years ago

billerickson commented 5 years ago

When Shortcode UI is active in WordPress 5.0 or higher, it triggers a php notice:

PHP Notice: edit_form_advanced is deprecated since version 5.0.0! Use block_editor_meta_box_hidden_fields instead. This action is still supported in the classic editor, but is deprecated in the block editor.

This PHP notice then triggers Gutenberg to load in “Quirks Mode”, which leads to additional issues like metaboxes appearing on top of blocks in the editor. Shortcode UI must be deactivated to make the block editor usable.

screenshot

Here’s a detailed report on the issue: https://github.com/WordPress/gutenberg/issues/12598

kadamwhite commented 5 years ago

I'm also seeing the same quirks mode issue apply on a site that isn't noticeably displaying that error; in our case, it's the Shortcake JS templates which are being output too early.

<script type="text/html" id="tmpl-fusion-shortcake-field-attachment">
<div class="field-block shortcode-ui-field-attachment shortcode-ui-attribute-{{ data.attr }}">
  <label for="{{ data.attr }}">{{{ data.label }}}</label>
  <# if ( typeof data.description=='string' ) { #>
    <p class="description">{{{ data.description }}}</p>
    <# } #>
      <button id="{{ data.attr }}" class="shortcake-attachment-select button button-small add">{{ data.addButton }}</button>
      <div class="attachment-previews"></div>
</div>
</script>

and so on. I would expect these to get output within the <head> or <body> of the page, not before <!doctype>

kasparsd commented 3 years ago

This appears to have been fixed in #807. Should this be marked as closed?

goldenapples commented 3 years ago

Yup, closing now.