12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on May 12, 2023

[Condition] Current user has published at least one post of the specified post types

Sridhar Katakam

This members-only tutorial provides the code to register a custom condition for outputting elements depending on if the current user has at least 1 published post of the specified post types in Oxygen builder.

We are going to specify the post types in the condition.

If true is selected, the elements on which the condition is applied will be rendered only if the currently logged-in user has published at least one entry of any post types specified in an array in the condition code.

If false is selected, the elements on which the condition is applied will be rendered only if the currently logged-in user has NOT published at least one entry of any post types specified in an array in the condition code.

Create a new code snippet using a plugin like WPCodeBox.

Title: [Condition] Current user has published at least one post of the specified post types

Hook: Root (Default)

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $599 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right