Save CPT content and title to MB Custom Table?

Support MB Custom Table Save CPT content and title to MB Custom Table?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #39380
    Digital RockeryDigital Rockery
    Participant

    I have a CPT with multiple custom fields. All are saving to a custom table as expected, and all are renderable on the front end as needed. No problems or issues with any of the custom fields in this CPT.

    This CPT is using Gutenberg. I'd like to save the content of each CPT post and the title of each CPT post to the same custom table that is already working well for the associated custom fields (as described above).

    Is there a way to do this?

    #39393
    PeterPeter
    Moderator

    Hello,

    Saving the post title to the custom table will lead to some unexpected issues. If you want to do that, when registering the CPT, please uncheck the support fields Title, Editor.
    Then register 2 custom fields with ID title and content and save the value to the custom table.

    #39399
    Digital RockeryDigital Rockery
    Participant

    Please clarify "Saving the post title to the custom table will lead to some unexpected issues." If this is a bad idea, I won't do it, but I'd like to know more about your concern.

    Regarding the content: Yes, creating alternative/replacement fields to use in place of the native WP content has indeed been the strategy thus far. The reason I asked the above, however, is that I wanted to keep the Gutenberg functionality for the main content on the CPT page.

    Is there a way to load Gutenberg into a Metabox-generated field that is saving to a Custom Table?

    #39420
    PeterPeter
    Moderator

    Hello,

    I see the post permalink is not generated, so the search form and other plugins might not work if the title is missing. I'm not sure what other issues will happen so far.

    As I understand it is not possible to "load Gutenberg into a Metabox-generated field that is saving to a Custom Table". But if you create a custom table with custom fields, you can save the field value to the custom table as the post fields as well.

    Please read more on the documentation https://docs.metabox.io/extensions/mb-blocks/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.