• Pamela

    (@infoknutsford-softwarecouk)


    I have this

    add_filter( 'wpcf7_posted_data', 'remove_data', 10, 1 );
    function remove_data( $posted_data ) {
    	if (isset($posted_data['whatyouwant'][0])) {	
    		
    		if ($posted_data['whatyouwant'][0] == "") {		
    			unset($posted_data['marquee'], $posted_data['lining'], $posted_data['flooring'], $posted_data['noofchairs'], $posted_data['chairtype'], $posted_data['tableslinen'], $posted_data['dance'], $posted_data['bar'], $posted_data['djlights'], $posted_data['heating'], $posted_data['porta'], $posted_data['porta']);	
    			
    		}		
    	}		
    	return $posted_data;
    }

    Which removes the posted data that isn’t required but how do I remove the unwanted tags from the form as the email is coming out with “Lining: [lining]” etc for the lines that aren’t needed.

Viewing 1 replies (of 1 total)
  • Thread Starter Pamela

    (@infoknutsford-softwarecouk)

    There is wpcf7_remove_form_tag but I have no idea where to use it, It didn’t work when I tried it in my wpcf7_posted_data filter

Viewing 1 replies (of 1 total)
  • The topic ‘Removing tags from email’ is closed to new replies.