Can I just get the actual option that was selected
sure, you should be able to, however, you’ll need to filter the values using the hook provided for the email tags. See this tutorial for more information.
You are saying I can filter out the taxonomy?
Am I filtering a tabled mail tag or filters?
When I look at the post form submit hooks the fitler tabled/tabbed mail tags it looks like I need to use $data to adjust the array of submitted data
I’m not a PHP expert but I don’t think this filter out the parent/taxonomy
Could it be this: https://developer.wordpress.org/reference/classes/wp_term_query/__construct/
add_filter( ‘cf7sg_dynamic_checkbox_taxonomy_query’,’dynamic_checkbox_725_taxonomy_query’,10,4);
/**
- Filter dropdown taxonomy query parameter.
- (see https://developer.wordpress.org/reference/classes/wp_term_query/__construct/)
- @param array $args array of taxonomy query attributes.
- @param WPCF7_FormTag $tag the field being populated.
- @param string $cf7_key the form unique key.
- @param array $branch an array of term IDs representing the current taxonomy branch being queried, the last term is the query parent value.
- @return array of query attributes.
*/
function dynamic_checkbox_725_taxonomy_query($args, $tag, $cf7_key, $branch){
//these are the label users will see when the dropdown opens.
if(‘request-test’!==$cf7_key || ‘dynamic_checkbox-725’ !== $tag->name){
return $args;
}
//use only the child terms of a parent.
if($args[‘parent’]!=0) $args=null;
// or if you want to list only the 2nd level of your tree,
if(count($args)>2) $args=null;
return $args;
You are saying I can filter out the taxonomy?
no, you filter only the selected values, I am assuming you are displaying a tree HybirdDropdown field which gives you the entire branch selected in the mail tag, and you can filter it to display only the term you need.
Am I filtering a tabled mail tag or filters?
the tutorial is showing an example of a filtered mail tag which happens to be a repetitive table field, but in your case you have a dynamic dropdown field, and its corresponding mail tag can also filtered.
Iβm not a PHP expert but I donβt think this filter out the parent/taxonomy
Indeed, you need to use the filter associate with your field mail tag. If you do not have any experience with PHP, I strongly suggest you get the help from someone who does to figure it out. You may also hire my services if your project has the budget π
@aurovrata could you contact me and let me know how much an update like this would cost?
https://flashmarketingsolutions.com/contact-us/