Skip to content
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

Add settings to enable visual or text editor for TinyMCE #6179

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

JoryHogeveen
Copy link
Member

Description

This will allow users to optionally disable the visual editor or the quicktags.

Related GitHub issue(s)

Fixes #6176

Changelog text for these changes

PR checklist

@JoryHogeveen JoryHogeveen added Type: Enhancement Enhancements to features that already exist, but are not major additions Status: In Progress Issue or PR is currently in progress but not yet done labels Oct 19, 2021
@JoryHogeveen JoryHogeveen added this to the Pods 2.8.1 milestone Oct 19, 2021
@sc0ttkclark
Copy link
Member

sc0ttkclark commented Oct 20, 2021

To initialize a quicktags-only textarea, you can call:

window.quicktags( { ...wp.editor.getDefaultSettings().quicktags, id: 'the-field-id' } );

However, it does not appear well unless the textarea is wrapped with <div class="wp-editor-container">

@sc0ttkclark
Copy link
Member

We'll need to fix #6178 as a prerequisite for this

@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.1, Pods 2.8.2 Oct 20, 2021
@JoryHogeveen JoryHogeveen added Status: PR > Pending Code Review PR is pending code review by core developers Status: PR > QA pending QA needs to be done labels Oct 20, 2021
@@ -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 ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to address other areas like in onSetup and the first useEffect perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate?

Copy link
Member

Choose a reason for hiding this comment

The 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

@sc0ttkclark sc0ttkclark changed the base branch from main to release/2.8.2 October 22, 2021 14:00
Copy link
Member

@sc0ttkclark sc0ttkclark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is close

classes/fields/wysiwyg.php Outdated Show resolved Hide resolved
@sc0ttkclark sc0ttkclark removed this from the Pods 2.8.2 milestone Oct 24, 2021
@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.3, Pods 2.8.4 Oct 24, 2021
Base automatically changed from release/2.8.2 to main October 26, 2021 22:04
@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.4, Pods 2.8.5 Nov 5, 2021
@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.6, Pods 2.8.8 Nov 24, 2021
@sc0ttkclark sc0ttkclark modified the milestones: Pods 2.8.10, Backlog Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress Issue or PR is currently in progress but not yet done Status: PR > Pending Code Review PR is pending code review by core developers Status: PR > QA pending QA needs to be done Type: Enhancement Enhancements to features that already exist, but are not major additions
Projects
Status: 📋 Backlog
Development

Successfully merging this pull request may close these issues.

WYSIWYG field not picking up last used visual vs text setting, not loading in text can change some HTML
3 participants