Title: receter's Replies | WordPress.org

---

# receter

  [  ](https://wordpress.org/support/users/receter/)

 *   [Profile](https://wordpress.org/support/users/receter/)
 *   [Topics Started](https://wordpress.org/support/users/receter/topics/)
 *   [Replies Created](https://wordpress.org/support/users/receter/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/receter/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/receter/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/receter/engagements/)
 *   [Favorites](https://wordpress.org/support/users/receter/favorites/)

 Search replies:

## Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form 7 Mail Conditions] Fixed Plugin](https://wordpress.org/support/topic/fixed-plugin-1/)
 *  Thread Starter [receter](https://wordpress.org/support/users/receter/)
 * (@receter)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/fixed-plugin-1/#post-7265070)
 * There is just one very short file in the plugin folder (besides the readme.txt).
   Open it and replace the functions inside with the functions I sent you. If you
   need further assistance, my email address is my wordpress username at gmail com.
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Contact Form 7 Mail Conditions] Fixed Plugin](https://wordpress.org/support/topic/fixed-plugin-1/)
 *  Thread Starter [receter](https://wordpress.org/support/users/receter/)
 * (@receter)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/fixed-plugin-1/#post-7265067)
 * This should do the trick:
 *     ```
       /**
       	 * Modifies the emails by replacing the conditionals [if field_name][/if]
       	 *
       	 * @param [Object] $cf7 the contanct form 7 object
       	 * @return void
       	 * @author Tobias Braner
       	 **/
       	public function before_send_mail($contact_form) {
         		$submission = WPCF7_Submission::get_instance();
       		if ( $submission ) {
       			$posted_data = $submission->get_posted_data();
       			$mail = $contact_form->prop('mail');
       			$mail2 = $contact_form->prop('mail2');
       			$mail_body = $mail['body'];
       			$mail2_body = $mail2['body'];
       			$mail['body'] = $this->process_conditions($mail_body, $posted_data);
       			$mail2['body'] = $this->process_conditions($mail2_body, $posted_data);
       			$contact_form->set_properties(array('mail' => $mail, 'mail2' => $mail2));
       		}
       	}
   
       	/**
       	 * Takes the wpcf7 object and replaces all conditions.
       	 *
       	 * @return void
       	 * @author Tobias Braner
       	 **/
       	private function process_conditions($mail_body, $posted_data) {
       		$updated_email_body = $mail_body;
       		$matches = array();
       		$num_matches = preg_match_all($this->regexp, $mail_body, $matches);
       		for ($i=0; $i < $num_matches; $i++) {
       			$expression = $matches[WPCF7MC_EXPRESSION][$i];
       			$variable = $matches[WPCF7MC_VARIABLE][$i];
       			$value = $matches[WPCF7MC_VALUE][$i];
       			if (empty($posted_data[$variable][0]) and array_key_exists($variable, $posted_data)) {
       				$updated_email_body = str_replace($expression, '', $updated_email_body);
       			} else {
       				$updated_email_body = str_replace($expression, $value, $updated_email_body);
       			}
       		}
       		return $updated_email_body;
       	}
       ```
   
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[Custom Post Type Submenu] Issues with 3.5](https://wordpress.org/support/topic/issues-with-35-37/)
 *  Plugin Author [receter](https://wordpress.org/support/users/receter/)
 * (@receter)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/issues-with-35-37/#post-7737848)
 * Hi Jared,
 * thanks for your feedback. If you still need this plugin, I uploaded an update
   that fixes all of this.
 *   Forum: [Reviews](https://wordpress.org/support/forum/reviews/)
    In reply to:
   [[Custom Post Type Submenu] So close, yet so far away.](https://wordpress.org/support/topic/so-close-yet-so-far-away/)
 *  Plugin Author [receter](https://wordpress.org/support/users/receter/)
 * (@receter)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/so-close-yet-so-far-away/#post-7745123)
 * Hi,
 * I uploaded an update that fixes spinning wheel and links to archive if an archive
   exists.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Why can't wordpress embed this single vimeo.com Link?](https://wordpress.org/support/topic/why-cant-wordpress-embed-this-single-vimeocom-link/)
 *  Thread Starter [receter](https://wordpress.org/support/users/receter/)
 * (@receter)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/why-cant-wordpress-embed-this-single-vimeocom-link/#post-2612141)
 * Ok it seems that in an vimeo pro account, it is possible to deny embeding on 
   other sites. And if so, WordPress doesnt change the text link in embeding code.

Viewing 5 replies - 1 through 5 (of 5 total)