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
  • Just a quick note for everyone else... ...getting it to actually 'show up' is a bit of a weird process. I still don't know the exact routine I used, but I clicked 'Options' then enabled 'Custom Fields', then it reloaded, then I switched to 'Code View' and disabled 'Custom Fields', then it reloaded and when I switched back to 'Visual Editor' the metabox was there. Was driving me mad for a while there. Commented May 1, 2020 at 18:24
  • Quick Question - did you have issues getting your post_meta to save? I've got everything working perfectly but can't seem to get it to save. Commented May 1, 2020 at 19:58

1 Answer 1

4

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,
    )
2
  • 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
    Commented Nov 2, 2018 at 15:31
  • 1
    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... Commented Nov 2, 2018 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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