Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Dropdown for List Field
- add_filter( 'gform_column_input_3_43_1', 'hrx_list_colum_select', 10, 5 );
- function hrx_list_colum_select( $input_info, $field, $column, $value, $form_id ) {
- global $post;
- $exclude_events = get_post_meta($post->ID, 'same_night_events' );
- $choices = array();
- $choices[] = array( 'text' => 'Click to select', 'value' => '');
- $additional_events_query = new WP_Query(array(
- 'post_type' => 'tribe_events',
- 'posts_per_page' => -1,
- 'tax_query' => array(
- array(
- 'taxonomy' => 'tribe_events_cat',
- 'field' => 'slug',
- 'terms' => array('series-classes', 'technique-clinics', 'workshops'),
- ),
- ),
- 'post__not_in' => $exclude_events,
- ));
- if($additional_events_query->have_posts()){
- while ($additional_events_query->have_posts()) {
- $additional_events_query->the_post();
- $choices[] = array( 'text' => get_the_title(), 'value' => get_the_title() );
- }
- }
- return array( 'type' => 'select', 'choices' => $choices);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement