Custom Fields
Re-Envisioned
Support MB Frontend Submission Hide Metabox Field on Custom Frontend Form

This topic contains 3 replies, has 2 voices, and was last updated by  Anh Tran 1 year, 2 months ago.

  • Creator
    Topic
  • #9479

    thomastran40
    Participant

    How do I hide a metabox field on a frontend submission form? I have an internal custom field that is for admins only.

    One solution is to use the standard WordPress field rather than metabox but wondering if I’m missing a better way?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #9480

    Anh Tran
    Keymaster

    Hi, you can use a hidden field for that purpose. Alternatively you can hide it with CSS. Or more advanced – use Meta Box Conditional Logic to hide it.

    #9512

    thomastran40
    Participant
    
                array(
                    'name'  => 'Website Screenshot URL:',
                    'desc'  => '',
                    'id'    => $prefix . 'website_screenshot',
                    'type'  => 'text',
                    'type' => 'hidden'
    
                ),
    

    It works but the label still shows. Im also setting the type variable twice which seems wrong.

    What am i missing here?

    I could use CSS for the label but just trying to familiarize myself with metabox a bit more.

    #9514

    Anh Tran
    Keymaster

    I see. Can you try CSS approach, like this:

    array(
        'name'  => 'Website Screenshot URL:',
        'desc'  => '',
        'id'    => $prefix . 'website_screenshot',
        'type'  => 'text',
        'class' => 'hidden',
    ),

    And in the Customizer > CSS and add this:

    .hidden { display: none; }

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Hide Metabox Field on Custom Frontend Form’ is closed to new replies.