Last active
August 29, 2017 17:52
-
-
Save Shelob9/313159cd1edc68ab8ae98588bddde808 to your computer and use it in GitHub Desktop.
Code examples for caldera_forms_easy_pods_autopopulate_label_field filter. See: https://calderaforms.com/doc/caldera_forms_easy_pods_autopopulate_label_field/
This file contains 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 characters
<?php | |
/** | |
* Change which Pods field is used for the label of a Caldera Forms field autopopulated with the results of an Easy Pods query if Pod is a user Pod. | |
*/ | |
add_filter( 'caldera_forms_easy_pods_autopopulate_label_field', function( $label_field, $form, $pod, $easy_pod ){ | |
if( function_exists( 'cep_pod_type' ) && 'user' == cep_pod_type( $pod ) ){ | |
$label_field = 'display_name'; | |
} | |
return $label_field; | |
}, 10, 4 ); | |
This file contains 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 characters
<?php | |
/** | |
* Change which Pods field is used for the label of a Caldera Forms field autopopulated with the results of an Easy Pods for a specific Easy Pod. | |
*/ | |
add_filter( 'caldera_forms_easy_pods_autopopulate_label_field', function( $label_field, $form, $pod, $easy_pod ){ | |
if( 'fancy-search' == $easy_pod['slug'] ){ | |
$label_field = 'slug_of_pods_field'; | |
} | |
return $label_field; | |
}, 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment