Add custom item to dynamic select
-
Hi,
I’m trying to add a custom item as last option of my dynamic select but is very difficult for me ??This is my function:
function cf7_dynamic_select() { $output = array(); $args = array( 'post_type' => 'page', 'post_parent' => '1331', 'order'=> 'ASC', 'orderby'=> 'menu_order', 'hide_empty' => 0 ); // this is my attemp to add last item array_push($args, "altro", "altro"); $the_query = new WP_Query( $args ); while ( $the_query->have_posts() ) : $the_query->the_post(); $output[get_the_title()] = get_the_title(); endwhile; return $output; } add_filter('my-filter', 'cf7_dynamic_select', 10, 2);
and this is my tag:
[dynamicselect* service id:service "my-filter post_type=page post_parent=1331"]
Thank you!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add custom item to dynamic select’ is closed to new replies.