-
Notifications
You must be signed in to change notification settings - Fork 0
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
Create a Generic Control to edit post meta data #2
Comments
ExplanationThis is a documented pre-requisite; the post type needs to support For bigram, I'd already changed the post type registration. The CPTs registered by oik-plugins did not support custom fields. |
Having resolved the problem of not being able to access the post meta data I've got to the point where I can display a plain text value and even attempt to change it. If I change the value of the post meta field in the Field block then the value does get updated in the
But in the subsequent request the metabox update overrides the change in the block.
So how do we synchronize the values between the block and the meta box and/or prevent the metabox update from changing the value back to the original setting? |
I can use Options > Preferences > Panels to toggle off the display of the Fields meta box. But this doesn't prevent the meta box from submitting its values, which have not been changed. Somewhere I read about the fact that updating the meta data doesn't cause the Update button to be set. |
OK, so I'm not the only person with this problem. Gutenberg issue 23078 is over a year old, so even though the bug was triaged yesterday, I imagine the chance of a solution being developed in the next couple of weeks appears to be very low. A workaround for the problem was documented against another issue that was closed as a duplicate of 23078. Solving this problem is just the first of many challenges of replacing Meta boxes with blocks.
|
In March, while developing the SB theme, for
s.b/bigram
I developed logic to deal with the_seen_before
post meta field in the bigram plugin._seen_before
field is registered usingbigram_register_post_meta
which callsregister_post_meta
.bigram_register_seen_before
, inbigram_oik_fields_loaded
which is the action hook foroik_fields_loaded
.bigram/seen-before
block that pretty much duplicates the logic documented in https://developer.wordpress.org/block-editor/how-to-guides/metabox/meta-block-3-add/When using the REST request
http://s.b/bigram/wp-json/wp/v2/bigram
themeta
field is correctly populated.In
s.b/wordpress
I'm using a different method to register the post meta fields. They don't show up inmeta
.Why not?
The text was updated successfully, but these errors were encountered: