Conditionals around WPBakery blocks

Hi Guys

I’m using a theme with the WPBakery system for page content and I’d like to use conditionals to hide or show blocks based on membership level.

I’ve tried adding an HTML block with the shortcode [s2If !current_user_can(access_s2member_level1)] before the content I want to show, and another block with [/s2If] after the content, but the [/s2If] shortcode is rendered as-is on the page. Has anyone found a way to show and hide WPBakery rows and blocks using conditionals?

Having the same issue. Did you ever get it resolved?

I would be surprised if any legacy wrapping shortcode (a shortcode that wraps content) would work if the content wrapped was one or more blocks.

If you can…just put the shortcode wrapper and the wrapped content in the same block.

What you are really looking for is a block-based equivalent to s2member. I’m not aware of one that exists. If you trip over one…let us know. Be interested in trying it out.

If this is still an issue, I had the same issue and found a workaround. You’re going to have to go into the Classic Mode, in the WYSIWYG content panel, edit your content on the TEXT tab.

That’s where you would enter HTML if you wanted to.

From there, you have to delete out the starting and ending shortcode tags around the s2If tag and the /s2If tag. It’ll be things like vcrow and vcolumn, then /vcrow and /vcolumn. Both the opening and closing s2If tags will have the row and column opening and closing tags, so you’re removing opening and closing tags for each.

One warning. Every time you edit that page with WPBakery, you’re going to have to do the exact thing each time.