-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a post is saved, check for tinymce and save any editors. #12568
Changes from 3 commits
1fa46e4
7654273
8a1a38b
55e799d
fb38486
4ce7e74
4a2af66
04ca775
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
## 3.1.5 (Unreleased) | ||
|
||
### Bug Fixes | ||
- Fix saving WYSIWYG Meta Boxes | ||
|
||
## 3.1.4 (2018-11-30) | ||
|
||
## 3.1.3 (2018-11-30) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
* External dependencies | ||
*/ | ||
import { reduce } from 'lodash'; | ||
import tinymce from 'tinymce'; | ||
|
||
/** | ||
* WordPress dependencies | ||
|
@@ -72,6 +73,11 @@ const effects = { | |
} ); | ||
}, | ||
REQUEST_META_BOX_UPDATES( action, store ) { | ||
// Saves the wp_editor fields | ||
for ( var i = 0; i < tinyMCE.editors.length; i++ ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so this means you're loading the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can use the global tinyMCE without importing tinymce at the top. If we import tinymce and call tinymce.triggerSave or tinymce.editors, they don't work as we would expect to save the extra editors. Thanks again for the time on this. We're going to fix this issue, which is important for plugins. I'm getting an education in Gutenberg, node, and JS here. I apologize for the confusion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your help here :). That's interesting though, now I'm curious. What is the difference between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. window.tinymce and window.tinyMCE seem to be the same object in my console (or 2 copies of the same object in sync). TinyMCE might setup both??? |
||
tinyMCE.editors[i].save(); | ||
} | ||
|
||
const state = store.getState(); | ||
|
||
// Additional data needed for backwards compatibility. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The versions are actually changed automatically when we publish the packages. So we should keep it as is and only update the change log for now