wp-shortcake / shortcake

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

Javascript race condition when registering wp-views in WP 5.6.1 #822

Open joeyblake opened 3 years ago

joeyblake commented 3 years ago

Using the classic editor, in WordPress 5.6.1, with concatenated scripts enabled, wp-tinymce.js includes the wp-view plugin. wp-tinymce does not wait for jQuery domready, and this causes wp-views to start initializing before shortcake views are registered. This results in existing shortcake shortcodes to not render in the editor on page load.

This can be fixed by moving the shortcode registration out of jQuery domready.

I have a fix for this coming in a few minutes.

krokodok commented 2 months ago

Thaks Joey! I'm implementing this as a patch locally now in my project.