Quantcast
Channel: WordPress.org Forums » [Contact Form 7] Support
Viewing all articles
Browse latest Browse all 49500

kingstretch on "[Plugin: Contact Form 7] Cant Add New Forms? Get an error everytime"

$
0
0

It's probably a little late for this, but I just had to figure this out too so I'm posting here so I don't have to figure it out again!

Chances are, you've got a theme that's including "Enhanced Custom Fields" functionality. You'll need to find where that code is and slightly modify it (mine was in "_framework/custom_fields/fields.php". The code you're looking for looks like this:

function load() {
		if (empty($this->post_id)) {
			ecf_conf_error("Cannot load -- unknow POST ID");
		}
		$single = true;
		if ($this->is_multiply) {
			$single = false;
		}
		$value = get_post_meta($this->post_id, $this->name, $single);
	    $this->set_value($value);
	}

I just commented out the error message and added a return statement to stop execution of the function, like this:

function load() {
		if (empty($this->post_id)) {
			//ecf_conf_error("Cannot load -- unknow POST ID");
			return;
		}
		$single = true;
		if ($this->is_multiply) {
			$single = false;
		}
		$value = get_post_meta($this->post_id, $this->name, $single);
	    $this->set_value($value);
	}

This allowed me to use the Contact Form 7 plugin properly.


Viewing all articles
Browse latest Browse all 49500

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>