Reset recaptcha contact form 7 [closed]

Since the recaptcha is created by contact form 7 without assigning the rendered recaptcha to a variable it was not possible to use grecaptcha.reset(opt_widget_id). Here is what is did: $(“.wpcf7-submit”).click(function(event) { var currentForm=$(this).closest(“form”); $( document ).ajaxComplete(function(event,request, settings) { var responseObj=JSON.parse(request.responseText); if(responseObj.mailSent==true){ //reset recaptcha var recaptchaIFrame=currentForm.find(“iframe”).eq(0); var recaptchaIFrameSrc=recaptchaIFrame.attr(“src”); recaptchaIFrame.attr(“src”,recaptchaIFrameSrc); } }); }); I have cleared the … Read more

Admin Ajax and HTML5 Formdata

So it turns out the only problem was the header content type. By removing request.setRequestHeader(‘Content-Type’, ‘application/x-www-form-urlencoded; charset=UTF-8′); and just leaving it out, it worked fine. That’s also with the form action being grabbed and appended. Ajax call: var formData = new FormData(form); formData.append(‘security’, WP.nonce); formData.append(‘action’, form.getAttribute(‘action’)); u.jax.post(WP.ajax, formData, onSent); Ajax Function: u.jax.post = function(url, data, … Read more

submitting form via admin-ajax.php returns 0

You don’t set an action in your form, so nothing is executed. Add a hidden field with action to the form: <input type=”hidden” value=”submit_filter” name=”action”> Also note that this: $postid = get_the_ID(); won’t work. This is a new request, so there is no post to get the ID from. You have to pass this with … Read more

Form Processing

I’m not sure what the root cause of your issue is. But I do see a syntax error in your last code block, which could be what’s causing the white screen. Your “action” attribute is missing a close quote. Try this instead: <form action=”<?php echo esc_url( admin_url(‘admin-post.php’) ); ?>” id=”new_post” name=”new_post” class=”form-horizontal” method=”post” enctype=”multipart/form-data”>

WordPress posts with multiple fields

Unless you’re eager to program the functionality yourself, I would highly recommend “Advanced Custom Fields” (a plugin). It’s very intuitive, and gives you the ability to add custom fields (duh!) to every post-type in your theme. This means that I could add a “Height”-field above my WYSIWIG-editor in my Post-editor.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)