admin管理员组文章数量:1130349
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.
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.
Share Improve this question edited Nov 12, 2018 at 18:23 aequalsb asked Nov 2, 2018 at 15:17 aequalsbaequalsb 1379 bronze badges 2 |1 Answer
Reset to default 4The area is called the same. Just side, for sidebar.
I found help for migration here: https://wordpress/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,
)
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.
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.
Share Improve this question edited Nov 12, 2018 at 18:23 aequalsb asked Nov 2, 2018 at 15:17 aequalsbaequalsb 1379 bronze badges 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. – Tony Djukic Commented May 1, 2020 at 18:24
-
Quick Question - did you have issues getting your
post_metato save? I've got everything working perfectly but can't seem to get it to save. – Tony Djukic Commented May 1, 2020 at 19:58
1 Answer
Reset to default 4The area is called the same. Just side, for sidebar.
I found help for migration here: https://wordpress/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,
)
版权声明:本文标题:metabox - How do I migrate meta boxes from the Classic Editor to the "side area" in Gutenberg Editor? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749188268a2329755.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


post_metato save? I've got everything working perfectly but can't seem to get it to save. – Tony Djukic Commented May 1, 2020 at 19:58