Metabox Visibility

By default any MetaBox is hidden in the edit screen. We want to make sure to display only the needed MetaBoxes. To make your MetaBox visible you have the following hook:

add_filter('postbox_classes_METABOX','buddyforms_metabox_class');

Please see the WordPress Documentation:  https://developer.wordpress.org/reference/hooks/postbox_classes_page_id/

This hook will add the class *buddyforms-metabox* to your MetaBox and make it visible. Often it makes sense to restrict your metabox to post forms or other form relevant options. BuddyForms comes with the following default classes to define the visibility.

buddyforms-metabox-hide-if-form-type-contact
buddyforms-metabox-hide-if-form-type-register
buddyforms-metabox-hide-if-form-type-post

Inside the MetaBox you can define the field visibility by add classes to the form element.

bf_show_if_f_type_post
bf_show_if_f_type_registration
bf_show_if_f_type_all

Still need help? Contact Us Contact Us