Help Center

Meta Boxes Visibility Conditions Overview

Meta Boxes Visibility Conditions Overview

From this tutorial, you will learn how to add Visibility Conditions to Meta Boxes with the WordPress JetEngine plugin.

Meta Box is a container for meta fields in the WordPress JetEngine plugin. It stores the meta fields you put inside and helps to organize and maintain them. You can add meta boxes to any post type, user, or taxonomy. But what if you need to show meta boxes to the administrator or hide them from the editor? Do you need to apply meta boxes to some exact posts or terms? That is doable with the Visibility Conditions feature.

Proceed to JetEngine > Meta Boxes. After the General Settings tab, you can see the Visibility Conditions. That’s how they look if you select “Post” in the Meta Box for field.

meta box for post visibility conditions

You can add any Post Types to the Enable For Post Types field for the meta box visibility condition. This field is required because it should specify where conditions will be applied. After you hit the “+ New condition” button, you will see the Add new condition field.

add new condition jetengine meta box

Such options are available in this drop-down menu:

  • Include Posts. Here you can enter the names of posts that you want the meta box to be shown for;
include posts condition
  • Exclude Posts. Here you can enter the names of posts that you want to exclude the meta box from;
exclude posts condition
  • Included for User Roles. Here you can specify the user roles that such meta box will be shown for;
included for user roles condition
  • Exclude for User Roles. Specify here the user roles that will be unable to see meta boxes;
exclude for user roles condition
  • Post Has Taxonomy Terms. Choose the taxonomy name in the drop-down menu and enter the names of the terms in the nearby field.
post has taxonomy terms condition

After you set one condition, you can add another one. Feel free to add as many conditions as you need.

We have quite familiar settings for the Taxonomy meta boxes. The difference is that you should select the taxonomies for visibility conditions. And there are only two available conditions — Included for User Roles and Exclude for User Roles.

meta box for taxonomy jetengine

If you create a meta box for User, a new Visible at selector with two new options will appear:

  • Edit User. It adds meta fields to the Edit User page. Since only administrators can edit users, such fields became visible only to people with such a role;
  • Edit User & Profile. This option adds meta fields to the Edit User page and the Profile Page, which users can edit.
meta box for user jetengine

Meta boxes for User also have the same two conditions: Included for User Roles and Exclude for User Roles.

visibility condition for user meta box
Things to know

If you need the same meta box, e.g., for post and user, you should create two meta boxes because there is no way to extend the Meta Box for option.

That’s all. Add as many conditions as you need and organize the meta fields on the WordPress website faster and easier.

Was this article helpful?
YesNo

Need help?

Ask Facebook community

Get answers from 22K Crocoblock Community experts from all over the world.

Start a live chat

Ask question to support agent and share its details via chat messages.