Add wysiwyg support#6
Conversation
|
Just a comment, as I know this sortof the v1 or whatever, but not all post-types will have the content field as a registered support, so in those cases, you wouldn't have the global default available. |
|
Yea it will definitely need to be amended before this is even truly beta. I want to step through and pull it from the WP hook dynamically, but this was a good first step. |
jjeaton
left a comment
There was a problem hiding this comment.
Code LGTM, is this up on staging? I wasn't able to see the wysiwyg working there.
|
@jjeaton never pushed it to staging. It's up in the image group now. |
jjeaton
left a comment
There was a problem hiding this comment.
Autosave appears to be broken on the staging site. I see "error when saving" in the bottom right of the editor when I'm creating a new page.
$prefix was undefined in the twentyseventeen/functions.php but even after fixing that the autosave isn't working.
| } ); | ||
| } | ||
|
|
||
| cmb_flexible.setWysiwygRow = function( $el ) { |
There was a problem hiding this comment.
A comment explaining why this is required would be helpful here. 🌴 I'll still merge though.
|
I wasn't able to reproduce the "error while saving" issue locally. I'm going to merge this, and we can come back to fix anything later. |
Ok, this adds WYSIWYG support in a basic way.
It uses the global defaults of the content field to initiate tinyMCE instead of a custom setup, but it gets us a good amount of the way there.
In order for it to work generally, each group that's created is given a separate name, then a hidden field is added to capture that name and piece it all together during sanitization.
Also cleans up some styles.