Change the term based on the value of a $variable using wp_update_post in submitting a form

Your problem is this line: if (isset($_POST[‘call_16’]) == ‘No’ ) { isset() returns true or false based on whether the ‘call_16′ item exists in the $_POST array. It doesn’t return the value. So isset($_POST[‘call_16’]) is true, not ‘No’. If you want to check if it’s set and that it has a specific value (which you … Read more

WordPress – Form does not filter the results of taxonomies

Try below code for search using date and category. $_name = $_GET[‘date-picker-example’]; $categoria = $_GET[‘categoria_evento’]; $today = date(‘Ymd’); // Start the Query $v_args = array( ‘post_type’ => array(‘eventi-suite’), // your CPT ‘posts_per_page’ => -1, ‘meta_value’ => $_name, // looks into everything with the keyword from your ‘name field’ ‘order’ => ‘ASC’, ‘orderby’ => ‘metakey_AMC_data’, ‘meta_query’ … Read more

WordPress retrieving $post based on random key in $_POST

While I was typing up this question, I left it for a while, found out the problem, and decided to post the answer just in case it helped anyone else. Apparently, in WordPress’s infinite wisdom, it decided to make this argument in its register_post_types function: ‘publicly_queryable’ When this is set to true, it causes this … Read more

Form element name – array type is not working

Why the ?pgggo-taxon-select%5B%5D=14&pgggo-taxon-select%5B%5D=1 in the URL There are three common reasons why would one see that upon submitting the form: The form’s method is post (which corresponds to the HTTP POST method) and either: a) The current page indeed has that string in the URL. E.g. You’re on example.com/my-page/?pgggo-taxon-select%5B%5D=14&pgggo-taxon-select%5B%5D=1 b) The form’s action has that … Read more