{CODICTS} Snippets is now available

MyListing Display Rules

The {CODICTS} MyListing Display Rules plugin gives you dynamic, conditional control over your MyListing listing fields, tabs, blocks, terms, explore page filters, and even entire listing types. Show or hide any of these elements based on listing field values or user roles — without writing any code.

Installation & Activation

Start by downloading the plugin from the Downloads page on your dashboard on the CoDicts website.

After downloading, install and activate the plugin in WordPress by navigating to “Plugins” > “Add New” > “Upload Plugin” and selecting the downloaded zip file. Click “Install Now” and then “Activate”.

Once activated, navigate to “Display Rules” in the WordPress admin sidebar to configure your conditions.


Key Features

FeatureDescription
Field-Value ConditionsShow or hide elements based on the current value of any listing field.
User-Role ConditionsShow or hide elements based on the current user’s WordPress role, including a special “Guest” option for logged-out visitors.
Multiple Targets per ConditionA single condition can target listing form fields, single listing tabs, block classes, taxonomy terms, and explore page filters simultaneously.
Per-Listing-Type ConfigEach MyListing listing type gets its own independent set of conditions.
Whole Listing Type ControlHide entire listing types from the explore page, listing feeds, single pages, and the Add Listing widget, with optional redirect.
Owner ExemptionsOptionally exclude listing owners from tab and block hiding rules.
Automatic Field ClearingWhen a field is hidden, its value is automatically cleared to prevent stale data.
Smart Required FieldsRequired fields are automatically made non-required when hidden, and restored when shown again.
Dynamic Term FilteringConditionally filter which taxonomy terms appear in term-select fields.

How It Works

Display Rules works by creating conditions. Each condition has three parts:

1. A trigger — what the condition checks against (a listing field value, or the current user’s role).

2. An action — whether to Hide or Show the targeted elements when the condition matches.

3. One or more targets — what gets hidden or shown (fields, tabs, block classes, terms, or an entire listing type).

Conditions are evaluated in real time on the frontend. On the Add Listing form, fields slide in and out dynamically as values change. On the single listing page and explore page, elements are shown or hidden when the page loads based on the listing’s data or the visitor’s role.


Condition Types

TypeHow It Works
Field-basedThe condition checks the value of a specific listing field. If the field’s current value matches one of the configured values, the condition triggers. You can match against multiple values — if any one matches, the condition fires.
Role-basedThe condition checks the current user’s WordPress role. A special “Guest (Not logged in)” option lets you target visitors who are not logged in.

Hide vs. Show

ActionBehavior
HideWhen the condition matches, the targeted elements are hidden.
ShowWhen the condition matches, the targeted elements are shown. When it does not match, they are hidden. (This is the inverse of Hide.)

What You Can Target

TargetWhere It AppliesDescription
FieldsAdd Listing formHides or shows form fields. When a field is hidden, its value is automatically cleared. Connected display blocks on the single listing page and explore page filters are also affected.
TabsSingle listing pageHides or shows navigation tabs and their content. If the currently active tab is hidden, the first remaining tab is auto-selected.
Block ClassesSingle listing pageHides or shows any element with a specified CSS class. Useful for targeting custom blocks in your listing layout.
TermsAdd Listing form & Explore pageFilters which taxonomy terms are visible in term-select dropdowns and term checklists.
Entire Listing TypeSite-wide (role-based only)Hides a listing type from the explore page, listing feeds, single pages, and the Add Listing widget. Optionally redirects visitors to a specific page.

Getting Started

Important: Make sure the fields you plan to hide are NOT marked as required in MyListing’s listing type editor. While the plugin handles required fields gracefully (temporarily removing the requirement when hidden), it’s best practice to avoid marking conditionally-hidden fields as required.

Step 1: Enable the Listing Type

Navigate to “Display Rules” in the WordPress admin sidebar. The settings page shows each registered MyListing listing type. Check the “Enabled?” toggle for the listing types you want to add conditions to.

Step 2: Add a Condition

Click “Add a Condition” under the listing type. A new condition panel opens as a collapsible accordion.

Step 3: Choose the Filter Type

Select what the condition should check:

Listing fields — The condition evaluates a specific field’s value.

User roles — The condition evaluates the current visitor’s role.

Step 4: Configure the Trigger

For field-based conditions:

a. Select the “Field to use” — the listing field whose value will be checked.

b. In “If the field value is” — select or type the values that should trigger the condition. You can select multiple values (the condition fires if any match). Select “(Empty)” to match when the field has no value.

For role-based conditions:

a. In “If the current user role is in” — select one or more WordPress roles. Choose “Guest (Not logged in)” to match visitors who aren’t logged in.

b. Choose the role matching logic:

OptionBehavior
User has ANY of the selected roles (default)Condition matches if the user has at least one of the selected roles.
User has ALL of the selected rolesCondition matches only if the user has every selected role.

Step 5: Choose the Action

Select Hide or Show from the “Then” dropdown.

Step 6: Select Targets

Check one or more target categories and configure each:

See the sections below for details on each target type.

Step 7: Save

Click “Save Changes” at the bottom of the page. Your conditions are now active on the frontend.


Targeting: Fields

Check “The following fields” and select one or more fields from the dropdown. When the condition triggers:

Add Listing form: The selected fields slide up (hidden) or slide down (shown) in real time as the user fills out the form. Hidden fields have their values automatically cleared and their required attribute temporarily removed.

Single listing page: The plugin also attempts to hide the connected display blocks for those fields on the single listing page.

Explore page: Connected explore page filters for those fields are also hidden or shown, and the listing feed refreshes automatically.

Note: The plugin will try to hide connected display blocks and explore filters based on the primary field automatically. You don’t need to configure those separately.


Targeting: Tabs

Check “The following tabs on the single listing page” and select one or more tabs from the dropdown (tabs are identified by their slug).

When the condition triggers, the selected tabs are hidden from the single listing page’s tab navigation. If the currently active tab is hidden, the first remaining tab is automatically selected.

Affect Listing Owners?

SettingBehavior
“Affect listing owners tabs?” unchecked (default)Listing owners always see all their tabs, even if a condition would hide them for other visitors.
“Affect listing owners tabs?” checkedThe tab hiding rule applies to listing owners too.

Targeting: Block Classes

Check “The following block classes on the single listing page” and type one or more CSS class names (press Enter to add each one).

Any element on the single listing page that has a matching CSS class will be hidden or shown when the condition triggers.

To use this feature, add a custom CSS class to your block in the MyListing listing type editor (layout section), then create a condition targeting that class here.

Affect Listing Owners?

SettingBehavior
“Affect listing owners class blocks?” unchecked (default)Listing owners always see all blocks, even if a condition would hide them.
“Affect listing owners class blocks?” checkedThe block hiding rule applies to listing owners too.

Targeting: Terms

Check “The following terms on a term select field” to conditionally filter which taxonomy terms appear in a dropdown or checklist.

a. Select the “Target field” — the term-select field whose options should be filtered.

b. Select the specific “Terms” to include or exclude (loaded dynamically from your taxonomy).

When the condition triggers with a Hide action, the selected terms are removed from the dropdown or checklist. With a Show action, only the selected terms are shown.

This works on both the Add Listing form and the Explore page term filters.


Targeting: Entire Listing Type

Note: This option is only available for role-based conditions.

Check “The entire listing type” to hide or show the listing type across your entire site. When the condition triggers, the listing type is removed from:

The Explore page type filters, listing feeds (WP queries), single listing pages (returns no results or redirects), and the Add Listing widget type selector.

Additional Options

OptionDescription
Redirect to pageSelect a page to redirect visitors to when they try to view a single listing of this type. Useful for sending blocked visitors to a membership or signup page.
Only redirect listing types?When checked, only redirects single listing pages (that aren’t owned by the current user). Listing creation and the Add Listing widget remain functional. Useful when you want to restrict viewing without blocking creation.

Example Use Cases

Example 1: Show extra fields based on a category selection

You have a “Business” listing type with a category field. When the user selects “Restaurant”, you want to show additional fields like “Menu URL” and “Cuisine Type” that aren’t relevant for other categories.

Create a condition: Filter by → Listing fields → Category field → If value is “Restaurant” → Then ShowFields: “Menu URL”, “Cuisine Type”.

These fields will be hidden by default and only appear when “Restaurant” is selected.

Example 2: Hide tabs from non-logged-in visitors

You want the “Reviews” tab on single listings to only be visible to logged-in users.

Create a condition: Filter by → User roles → If role is “Guest (Not logged in)” → Then HideTabs: “reviews”.

Example 3: Restrict a listing type to specific roles

You have a “Premium Listings” type that should only be visible to users with the “Premium Member” role.

Create a condition: Filter by → User roles → If role is “Subscriber”, “Guest (Not logged in)” → Then HideThe entire listing typeRedirect to: “Membership” page.

Subscribers and guests won’t see the listing type on the explore page, in feeds, or on single pages — and will be redirected to your membership page if they try to access a direct URL.

Example 4: Filter terms based on user role

You want free-tier users to only see a subset of categories when creating a listing.

Create a condition: Filter by → User roles → If role is “Subscriber” → Then ShowTerms: Target “Category” field → Select only the free-tier categories.

Subscribers will only see the selected categories in the dropdown. Other roles will see all categories.


Multiple Conditions on the Same Field

You can create multiple conditions that target the same field. When multiple “Hide” conditions affect the same element, it stays hidden until all hiding conditions are cleared. This lets you build complex logic by layering conditions.


Frequently Asked Questions

Can I hide fields on the Add Listing form AND the single listing page with one condition?

Yes. When you target fields, the plugin hides the matching field on the Add Listing form and also hides connected display blocks on the single listing page automatically.

What happens if I hide a required field?

The plugin automatically removes the required attribute when a field is hidden and restores it when shown again. However, it’s best practice to not mark conditionally-hidden fields as required in the MyListing listing type editor.

Does hiding fields clear their values?

Yes. When a field is hidden on the Add Listing form, its value is automatically cleared. This includes text inputs, textareas, selects, checkboxes, radios, TinyMCE editors, and file upload fields.

Does it work on the Explore page?

Yes. Conditions that target fields also affect explore page filter widgets. When a filter is hidden, the listing feed refreshes automatically.

What is the “Guest” role?

“Guest (Not logged in)” is a special option that matches visitors who are not logged into WordPress. Use it to create conditions targeting anonymous users.

Can I require a user to have ALL selected roles?

Yes. Use the role matching logic dropdown and select “User has ALL of the selected roles”. This is useful for multi-role setups.

Can I target custom layout blocks on the single listing page?

Yes. Add a custom CSS class to your block in the MyListing listing type editor (in the layout section), then create a condition targeting that class using the “Block Classes” feature.

What does “Only redirect listing types?” do?

It limits the whole-listing-type hiding to only redirect single listing pages (that the current user doesn’t own). Listing creation and the Add Listing widget remain unaffected. Useful for restricting viewing while still allowing users to create listings.


Troubleshooting

“MyListing Theme Not Detected” Error

The MyListing theme must be installed and active. Go to Appearance → Themes to verify. The plugin’s settings and functionality do not load without MyListing.

Conditions Not Taking Effect

CauseSolution
Listing type not enabledCheck the “Enabled?” toggle for the listing type on the Display Rules settings page.
Settings not savedClick “Save Changes” after adding or editing conditions.
Wrong filter type selectedVerify you’ve selected the correct filter type (Listing fields vs. User roles) for your condition.
No matching values configuredFor field-based conditions, ensure you’ve selected values in the “If the field value is” input.
No targets selectedAt least one target category (Fields, Tabs, Block Classes, Terms, or Entire Listing Type) must be checked and configured.

Fields Not Hiding on the Add Listing Form

CauseSolution
Wrong field selected as triggerVerify the “Field to use” is the field whose value determines visibility, not the field you want to hide.
Value mismatchCheck that the values in “If the field value is” match exactly what the field produces (e.g., term IDs for taxonomy fields).
JavaScript error on pageCheck the browser console for errors that may prevent the display engine from running.

Tabs Still Visible to Listing Owners

By default, listing owners are exempt from tab hiding rules. Check “Affect listing owners tabs?” in the condition if you want the rule to apply to owners as well.

Block Classes Not Being Hidden

CauseSolution
CSS class mismatchVerify the class name you entered matches exactly what’s on the element (class names are case-sensitive).
Owner exemption activeCheck “Affect listing owners class blocks?” if you want the rule to apply to owners.

Explore Page Filters Not Hiding

CauseSolution
Condition targets fields, not filtersWhen you target fields, connected explore page filters are hidden automatically. Verify the field you’re targeting has a corresponding explore filter.
Listing feed not refreshingThe plugin calls MyListing’s listing refresh after hiding filters. If this isn’t working, check the browser console for errors.

Form Submission Fails After Hiding Fields

If a hidden field is still marked as required in the MyListing listing type editor, it may prevent form submission in edge cases. Remove the “required” setting from any field that may be conditionally hidden by a display rule.

Settings Page Not Appearing

CauseSolution
MyListing not activeThe settings page only loads when MyListing is detected. Install and activate MyListing first.
Insufficient permissionsOnly users with the manage_options capability (typically Administrators) can access the settings page.

For further support, visit codicts.com or contact us at support@codicts.com.

CoDicts Co., Ltd. © 2021-2026. All rights reserved