jcchavezs / cmb2-conditionals

Plugin to relate fields in a CMB2 metabox
GNU General Public License v2.0
85 stars 61 forks source link

Allow conditionals for non-input fields #80

Open vladolaru opened 3 years ago

vladolaru commented 3 years ago

Allow for non-input fields (like titles) to be conditionally shown.

The trick involved is to use the id attribute as a substitute for the name fields of inputs to remember the seen dependents. The rest of the logic works since it relies on the parent rows.

This solves https://github.com/jcchavezs/cmb2-conditionals/issues/27