Last active
November 8, 2020 11:43
-
-
Save tdrayson/c2fefaa3c9fd5c69e7f5b68334e3e915 to your computer and use it in GitHub Desktop.
Revisions
-
tdrayson revised this gist
Nov 8, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,7 @@ // Create a condition in the builder to the section where you want to hide // Select dynamic data -> php function -> “Check_CPT_Repeater” // Inside the arguments section add your "cpt_name" and post object "acf_field" // Set dynamic data == 0 (to hide if no results are returned) function Check_CPT_Repeater( $cpt_name, $acf_field ){ -
tdrayson revised this gist
Nov 8, 2020 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,8 @@ // Add the function to advanced scripts (or code snippet) // Create a condition in the builder to the section where you want to hide // Select dynamic data -> php function -> “Check_CPT_Repeater” // Inside the arguments section add your "cpt_name" and post object "acf_field" function Check_CPT_Repeater( $cpt_name, $acf_field ){ //WP_Query arguments -
tdrayson revised this gist
Nov 5, 2020 . No changes.There are no files selected for viewing
-
tdrayson revised this gist
Nov 5, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ function Check_CPT_Repeater( $cpt_name, $acf_field ){ //WP_Query arguments $args = array( -
tdrayson revised this gist
Nov 5, 2020 . 2 changed files with 24 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ function get_CPT_NAME( $cpt_name, $acf_field ){ //WP_Query arguments $args = array( 'post_type' => array( $cpt_name ), 'meta_query' => array( array( 'key' => $acf_field, 'value' => get_the_ID(), 'compare' => 'LIKE', ), ), ); // The Query $query = new WP_Query( $args ); if ( ! ( $query->have_posts() ) ) { return 1; } else { return 0; } } -
tdrayson created this gist
Nov 5, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ _