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

Prevent a notice from appearing in the Compatibility Tool meta box #1605

Merged
merged 1 commit into from
Nov 10, 2018

Conversation

kienstra
Copy link
Contributor

@kienstra kienstra commented Nov 10, 2018

It looks like this notice doesn't appear with WordPress 5.0-beta3 and Gutenberg 4.2.0.

But it appeared on the single URL validation page, with earlier versions of both. I can't reproduce this (even with WP_DEBUG set to true):

meta-box

Still, it might be good to ensure that in future versions of Core and Gutenberg, that notice doesn't appear.

This might not be the right flag. But this sets __back_compat_meta_box to true, to indicate that:

...this meta box should only be loaded in the classic editor interface, and the block editor should not display it. (source)

That document also notes:

If you register your meta box with the __back_compat_meta_box set to true, then this warning will never be displayed with your meta box, now, or in future WordPress releases.

If this notice appeared in WP 5.0-beta3 and Gutenberg 4.2.0, maybe another flag would be better.

This is based on this Make post that @westonruter mentioned:
See https://make.wordpress.org/core/2018/11/07/meta-box-compatibility-flags/

…block editor

There isn't a notice in the single error URL 'Publish' meta box now.
But by passing the '__back_compat_meta_box' flag,
this could prevent a message from appearing in the future.
This meta box isn't intended for use with a block editor.
It uses a list table,
so there's no case (without completely reworking it)
where it would be used in a block editor.
See https://make.wordpress.org/core/2018/11/07/meta-box-compatibility-flags/
@kienstra
Copy link
Contributor Author

Request For Review

Hi @westonruter,
Could you please review this when you have a chance?

This uses the __back_compat_meta_box flag, which is a little different from what we talked about.

I can't reproduce this notice appearing, but it might be good to pass some flag to prevent this notice in future versions of Core or Gutenberg.

@kienstra kienstra requested a review from westonruter November 10, 2018 19:59
@westonruter westonruter added this to the v1.0 milestone Nov 10, 2018
@westonruter westonruter merged commit 8dd1b48 into 1.0 Nov 10, 2018
@westonruter westonruter deleted the add/back-compat-meta-box branch November 10, 2018 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants