Hide Metabox Field on Custom Frontend Form

Support MB Frontend Submission Hide Metabox Field on Custom Frontend Form

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9479
    thomastran40thomastran40
    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?

    #9480
    Anh TranAnh Tran
    Keymaster

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

    #9512
    thomastran40thomastran40
    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 TranAnh 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 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Hide Metabox Field on Custom Frontend Form’ is closed to new replies.