-
-
Notifications
You must be signed in to change notification settings - Fork 269
Add settings to enable visual or text editor for TinyMCE #6179
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
base: main
Are you sure you want to change the base?
Changes from all commits
2586034
45547a9
e30f391
c0cfe88
9437442
0c96bc5
cd20af4
3f317e9
c219ee7
3cb43c6
3c075b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"dependencies":["wp-api-fetch","wp-autop","wp-block-editor","wp-blocks","wp-components","wp-compose","wp-date","wp-element","wp-i18n","wp-keycodes","wp-server-side-render","wp-url"],"version":"1ae572d3f990891697f42359d4789570"} | ||
{"dependencies":["wp-api-fetch","wp-autop","wp-block-editor","wp-blocks","wp-components","wp-compose","wp-date","wp-element","wp-i18n","wp-keycodes","wp-server-side-render","wp-url"],"version":"eee47e8051ea21b3ee6a152dd4851aad"} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"dependencies":["moment","wp-api-fetch","wp-autop","wp-components","wp-compose","wp-data","wp-element","wp-i18n","wp-keycodes","wp-plugins","wp-primitives","wp-url"],"version":"24a252ba15d83803f1b7826ab7b44b4c"} | ||
{"dependencies":["moment","wp-api-fetch","wp-autop","wp-components","wp-compose","wp-data","wp-element","wp-i18n","wp-keycodes","wp-plugins","wp-primitives","wp-url"],"version":"c469aceb94e7980870ea6c5c1fdb8067"} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ const TinyMCE = ( { | |
setValue, | ||
editorHeight, | ||
mediaButtons, | ||
enableTinyMCE, | ||
enableQuicktags, | ||
onBlur, | ||
} ) => { | ||
const fieldId = `pods-form-ui-${ name }`; | ||
|
@@ -99,6 +101,17 @@ const TinyMCE = ( { | |
settings.toolbar4 = settings.toolbar4.replace( 'wp_add_media,', '' ).replace( ',wp_add_media', '' ).replace( 'wp_add_media', '' ); | ||
} | ||
|
||
if ( ! enableTinyMCE && ! enableQuicktags ) { | ||
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 need to address other areas like in 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. Can you elaborate? 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. Basically checking enableTinyMCE before calling other tinymce/editor specific functions elsewhere in this file |
||
// Plain paragraph. | ||
return; | ||
} | ||
|
||
if ( ! enableTinyMCE ) { | ||
// Quicktags only. | ||
window.quicktags( { ...wp.oldEditor.getDefaultSettings().quicktags, id: fieldId } ); | ||
return; | ||
} | ||
|
||
window.wp.oldEditor.initialize( fieldId, { | ||
tinymce: { | ||
...settings, | ||
|
@@ -107,7 +120,7 @@ const TinyMCE = ( { | |
height: editorHeight, | ||
}, | ||
mediaButtons, | ||
quicktags: true, | ||
quicktags: enableQuicktags, | ||
} ); | ||
} | ||
|
||
|
@@ -154,6 +167,8 @@ TinyMCE.propTypes = { | |
setValue: PropTypes.func.isRequired, | ||
editorHeight: PropTypes.number, | ||
mediaButtons: PropTypes.bool, | ||
enableTinyMCE: PropTypes.bool, | ||
enableQuicktags: PropTypes.bool, | ||
onBlur: PropTypes.func.isRequired, | ||
}; | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.