Unable to save a custom meta value for Template (and Template Part) post type #69983
Unanswered
alexandrebuffet
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m developing an extension for the Block Editor that allows assigning a color theme not only to a post or a block, but also to templates and template parts.
For blocks, the color theme is saved as an attribute; for posts, it’s stored as a meta field.
I had no issues extending the Block Editor and adding controls to the block or post sidebars.
However, when it comes to template post types—like templates or template parts—I can’t seem to save the color theme as a meta.
These post types don’t appear to support meta fields, and their REST API controllers don’t extend the Posts controller like blocks do. There are no filters available in the template controller either.
Does this seem like a limitation, or is there another way to extend the controller? Or will I have to store the color theme for a template in an option instead?
Beta Was this translation helpful? Give feedback.
All reactions