Skip to content

Instantly share code, notes, and snippets.

@paullacey78
Created December 14, 2017 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paullacey78/92d839e6522cd7eae43fbd78c9b8dd4a to your computer and use it in GitHub Desktop.
Save paullacey78/92d839e6522cd7eae43fbd78c9b8dd4a to your computer and use it in GitHub Desktop.
<?php
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 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment