Custom forms + Polylang

for the action label, there are some reserved terms, that wordpress uses internally. so you should avoid this terms (specially true in http_post ot get requests). ‘s’ stands for search, that’s why the output is a search result page. here you can find reserved terms: https://codex.wordpress.org/Reserved_Terms If you need very simple forms (so it seems … Read more

wp_nonce for Front-End submission form not working

You missed the wp_nonce_field action name. wp_nonce_field(‘submit-users-note”notes_nonce_field’ ); $nonce = $_POST[“notes_nonce_field”]; if ( ! isset($nonce) ! wp_verify_nonce( $nonce, ‘submit-users-note’ ) ) { exit; // Get out of here, the nonce is rotten! }

Submitting custom post from frontend,jQuery ajax, and custom validation – can’t find proper place to insert wp_insert_post()

You can achieve the goal through many ways. though the way you have selected is not an appropriate one but you can go with it also. just include the file wp-blog-header.php file (placed at the wordpress root) into validation.php above all other code. you can find all the wordpress related functions will work like a … Read more

Getting Custom post category from Form

Its pretty much what you already have, just add the following after $pid = wp_insert_post($new_post);: #categories if( !empty ( $_POST [‘categories’] ) ){ update_post_meta ( $pid, “_testimonials_category”, stripslashes ( $_POST [‘categories’] ) ); } I would probably advise you to change the name of this from categories though to something more relative, like testimonials_categories Then … Read more

Create a custom and powerful search form

Alright folks, so APPARENTLY I managed to solve this myself. This code was provoking the “Starbucks case” that I was explaining before if(!empty($keywords)){ $args[‘s’] = $keywords; $words = explode(” “, $keywords); foreach($words as $word){ $slug = slugify($word); $categoria = get_category_by_slug($slug); if(!empty($categoria)){ array_push($cats, $categoria->cat_ID); } } $args[‘category__in’] = $cats; } I changed it to if(!empty($keywords)){ $args[‘s’] … Read more

How to change number field to text field using JS

The original code is using prevAll on the minus button, but the target input appears later in the DOM. PrevAll worked fine for the plus button though, since the targeted input comes before the plus button. The modified code below is tested and working: jQuery(document).ready(function ($) { // Containing selector var parentSelector = $(‘.quantity’); // … Read more

Error while submitting form using AJAX and php

I believe it is because you are trying to set object properties that are undefined. Your javascript should look like this var measrumentData = { profile_name:null, value_one:null, value_two:null }; // Grab our post meta value measrumentData.profile_name = $( ‘#savem #profile_name’ ).val(); measrumentData.value_one = $(‘ #savem #value1’).val(); measrumentData.value_two = $(‘ #savem #value2’).val(); or var measrumentData = … Read more

Form direction to .php on localhost

You may want to make sure you are creating a brand new page template for this. http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/ Sve the template in your Child Theme folder In this template, place you form code where you want it to display. In the tag, change it to this: <form id=”quiz” method=”post”> Also, you should add your grade.php code … Read more

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