Custom Fields
Re-Envisioned
Support MB Frontend Submission frontend form shortcode to exclude certain custom fields

  • Creator
    Topic
  • #30949
    dp
    Participant

    Is there anyway to exclude certain custom fields (NOT the docs default fields [title, content, excerpt, date, thumbnail]) from the frontend form shortcode ([mb_frontend_form id="meta-box-id"])?

    eg.
    Page A requires a form with 8 custom fields
    Page B requires a form with only 5 of the same custom fields as above
    Page C requires 3 of the same custom fields

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #30961
    Long Nguyen
    Moderator

    Hi,

    You can use the extension MB Conditional Logic to show/hide a field based on the page ID. Please read more on the documentation https://docs.metabox.io/extensions/meta-box-conditional-logic/

    #30982
    dp
    Participant

    just tested but i realize that's done in the frontend to hide the fields (which can still be edited). What i actually meant is to exclude the specified custom fields from the backend, rather than hide using jquery and css

    eg. ref -> like [mb_frontend_form id="meta-box-id"] has post_title and post_content omitted from the bkend [mb_frontend_form id="meta-box-id" post-fields="title,content"]

    #30990
    Long Nguyen
    Moderator

    Hi,

    The extension MB Include Exclude helps you to include/exclude the meta boxes but it does not work with the custom fields. So you can create more meta boxes, assign them to one post type and show them on the frontend via shortcode ID by adding commas. For example:

    [mb_frontend_form id="meta-box-id1,meta-box-id2,meta-box-id3"]

    Get more details on the documentation
    https://docs.metabox.io/extensions/meta-box-include-exclude/
    https://docs.metabox.io/extensions/mb-frontend-submission/#shortcode-attributes

    #30991
    dp
    Participant

    nice but that would involve creating more forms, which can be hard to manage. Would ur development team consider something like this.. for a better UX management? Just suggesting, hope u dun mind or what're ur thoughts?

    eg. form with 10 custom fields - [mb_frontend_form id='advice-form']
    - form [mb_frontend_form id='advice-form' fields='-cf1,-cf3'] to dynamically display 8 custom fields,
    - another form [mb_frontend_form id='advice-form' fields='-cf8,-cf9,-cf0'] to dynamically display 7.

    #30992
    dp
    Participant

    the reason for above - the shortcodes can be placed in templates/scopes where the different customized conditions are already set by builders like oxygen, etc

    #30995
    Long Nguyen
    Moderator

    Hi,

    Thank you for your feedback.

    I'm going to inform the developer team to consider adding this feature to the to-do list for the future development of the plugin.

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