Title: parent class based condition
Last modified: March 20, 2025

---

# parent class based condition

 *  Resolved [Hozefa Saleh](https://wordpress.org/support/users/hozefasmile/)
 * (@hozefasmile)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/parent-class-based-condition/)
 * Hi [@ndiego](https://wordpress.org/support/users/ndiego/) , can we have one more
   condition feature in your plugin? Condition based on parent class.
 * For example if parent container have class “active” then show the block , otherwise
   hide? It can be put like this
 * Condition Name : Parent Class or ID
 * Parent container Class or ID (input field to put name of the class or id => .
   active, #active
 * switch to show or hide
 * This will be helpful in some special kind of blocks where classes added dynamically
   to parent block on various actions like click, mouseover etc.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Nick Diego](https://wordpress.org/support/users/ndiego/)
 * (@ndiego)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/parent-class-based-condition/#post-18389991)
 * Hi [@hozefasmile](https://wordpress.org/support/users/hozefasmile/),
 * Thanks for reaching out and I apologize for the delayed reply. I don’t have any
   current plans to support this functionality in Block Visibilty. That said, the
   codebase is [available on GitHub](https://github.com/ndiego/block-visibility)
   if anyone wants to explore adding this functionality.
 * That said, Block Visibility is not well setup to handle dynamic content like 
   you are looking for. You will probably need a JavaScript-based solution.
 * Best,
   Nick 

Viewing 1 replies (of 1 total)

The topic ‘parent class based condition’ is closed to new replies.

 * ![](https://ps.w.org/block-visibility/assets/icon-256x256.png?rev=3122657)
 * [Block Visibility — Conditional Visibility Control for the Block Editor](https://wordpress.org/plugins/block-visibility/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/block-visibility/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/block-visibility/)
 * [Active Topics](https://wordpress.org/support/plugin/block-visibility/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/block-visibility/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/block-visibility/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Nick Diego](https://wordpress.org/support/users/ndiego/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/parent-class-based-condition/#post-18389991)
 * Status: resolved