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

Needs porting to Gutenberg #1

Open
NOVALISTIC opened this issue Jan 23, 2020 · 1 comment
Open

Needs porting to Gutenberg #1

NOVALISTIC opened this issue Jan 23, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@NOVALISTIC
Copy link
Owner

After spending an hour whipping up this plugin for blog.NOVALISTIC, where I use the Classic Editor full-time, and another hour reading through the Gutenberg docs, I've realized I have no idea how to port the editor-facing part of my brand new plugin to the JS-based editor.

I could ship the plugin right now and have it require the Classic Editor as a dependency, but before resorting to that I thought I'd try and get some help out here from some more experienced WordPress devs first. Ideally, I'd want the checkbox to appear inside Gutenberg's built-in Discussion panel, like the Discussion meta box in the Classic Editor. Here's a mockup:

"Don't automatically close Comments" checkbox in Gutenberg

I just can't figure out how to modify or hook into Gutenberg's Discussion panel. With the Classic Editor all I had to do was

add_action( 'post_comment_status_meta_box-options', 'nv_kco_classic_meta_box_additions' );

I could do it the ugly way and add an entire legacy meta box to Gutenberg, but I'd really rather not, especially for just one checkbox. Any ideas?

@NOVALISTIC NOVALISTIC added enhancement New feature or request help wanted Extra attention is needed labels Jan 23, 2020
@NOVALISTIC NOVALISTIC self-assigned this Jan 23, 2020
@rmleg
Copy link

rmleg commented Jan 29, 2020

I've been looking into this a little bit. It looks like the only way to do this right now, at least with what is currently documented, is to add the checkbox to the post's Status & Visibility section of the Document panel. The discussion on this pull request seems to imply they will only add the ability to filter other sections based on whether someone can articulate a viable use case: WordPress/gutenberg#6300. I think this would be a reasonable use case if you were interested in submitting it.

Here is the brief doc on adding the checkbox to the Status & Visibility panel: https://developer.wordpress.org/block-editor/developers/slotfills/plugin-post-status-info/. I think it would be better and make more sense in the UI if you can convince the Gutenberg devs of your use case for editing the Discussion panel, but if you want to add the option to Status & Visibility instead, I can give that a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants