2

I don't know what the new side area is called for the Gutenberg Editor. On the editing screen, it's the side bar on the right side with "Publish" button, and other post related settings such as Category. (What does the Gutenberg Editor call it?)

I've searched online for a while, but I can't find anything that specifically tells me how to build/configure custom settings in "that side bar". I'm expecting a new function to register a new "not-meta-box-thing-anymore".

EDIT Now that I have actually solved my problem... I can clarify my issue and the answer. Previously, I had meta boxes showing under the "Visual Editor" and I wanted them to appear in the right-sidebar under "Publish" with WordPress 5.0 (WP5) -- I just ASSUMED it would require "something-new-with-WP5"

but, really, i just needed to change the context value to side as André said in terms of "area" BUT I thought that was in reference to new WP5 stuff he linked to.

His answer did ultimately lead me to the answer (and to a lot of other information along the way...) BUT it could have been answered with this so simply using the same ol' WP function:

add_meta_box(
    'YOUR_ID',
    'YOUR_TITLE',
    'YOUR_CALLBACK',
    'YOUR_POST_TYPE',
    'side', // <-- context (what I really needed)
    'YOUR_PRIORITY'
    'YOUR_CALLBACK_ARGS'
);

so, I feel pretty dumb... but it all hinged on my assumption I needed a new function to add meta boxes in WP5...

NOTE: I did not actually need the meta box compatibility vars shown in the answer because my meta boxes were page/post settings and were fully compatible with WP5. I did, however, change the styling to match the new WP5 appearance and architecture.

2

The area is called the same. Just side, for sidebar.

I found help for migration here: https://wordpress.org/gutenberg/handbook/extensibility/meta-box/

The PHP, for setting up your meta field to migrate, code needs some tweaks. First set in following as new argument on your meta field setup

array(
    '__block_editor_compatible_meta_box' => false,
)

let's you decide on next load of the backend, if you want to use the old or gutenberg editor.

and then you shall insert this, which kind of finishes the migration:

array(
        '__back_compat_meta_box' => false,
    )
  • the link you posted is exactly the answer i'm looking for -- my web searching could not come up with that for some reason... thanks! – aequalsb Nov 2 '18 at 15:31
  • yes, I had a long journey through the web just yesterday >.< hard to find gutenberg docs. google just keeps up showing same and same pages.. i might try another search engine... – André Kelling Nov 2 '18 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.