From http://kb.wpbeaverbuilder.com/article/462-hide-rows-or-modules-based-on-field-connections-themer Hide unfilled variables in Beaver Themer
/*Hide elements if field connection is empty*/
function check_field_connections( $is_visible, $node ) {
if ( isset( $node->settings->connections ) ) {
foreach ( $node->settings->connections as $key => $connection ) {
if ( ! empty( $connection ) && empty( $node->settings->$key ) ) {
return false;
}
}
}
return $is_visible;
}
add_filter( 'fl_builder_is_node_visible', 'check_field_connections', 10, 2 );
function check_field_connections( $is_visible, $node ) {
if ( isset( $node->settings->connections ) ) {
foreach ( $node->settings->connections as $key => $connection ) {
if ( ! empty( $connection ) && empty( $node->settings->$key ) ) {
return false;
}
}
}
return $is_visible;
}
add_filter( 'fl_builder_is_node_visible', 'check_field_connections', 10, 2 );