If you add handler for action with add_action, you should call this with do_action, but I does not see it. Also actions using in AJAX, simple POST/GET request is not need of
Simple example of form handling
<form method="POST" action="" class="my-form">
<input type="hidden" name="category" value="" />
<input type="hidden" name="action" value="recipe_filter" value="123" />
<input type="submit" />
</form>
// PHP somewhere like functions.php or this page exactly
<?php
if( ($_POST['action'] ?? '') == 'recipe_filter' ){
$value = empty($POST['category']) ? 'default value for category' : $POST['some'];
}
?>
JS
run $('form.my-form').submit() when dropdown value is changed
Related Posts:
- WordPress Ajax always returns a 404 error
- Calling a method from functions.php on a click of a button
- Nice scroll to wordpress
- Javascript code inside “” in core WordPress files .php
- Minify HTML, CSS, JS with PHPWee?
- Slide in Panel WordPress Post
- Show post in slider
- Populate dropdown with Child Pages based on Parent Page chosen
- search and replace preword from author
- How to change redirection route to a php page for making it only accessible by logged-in members?
- parts of url disappear when using # inside href=”” [closed]
- Noscript not working as it should in wordpress site
- Add Codepen animation as Preloader to WordPress
- HTML escaping data with ajax requests
- Override user-edit.php to design own profile page
- Calling PHP Titles inside Javascript Markup
- Link to page with posts of specific type
- Replacing WordPress Icons (menu,icons32, etc)?
- Is it possible to isolate and use WordPress functions outside of wordpress
- Time Delay a URL Redirect for Specific Page
- Cascading dropdown select search based on Parent Page & Child Page
- WordPress cascading dropdown selection search based on Parent Page & Child Page
- Display WordPress search results based on the selected Sub-Category
- html form: redirect page after form completes submit function and posts data
- WordPress User Meta value variable into Google Gauge Chart
- Search bar for wp menu
- Adding HTML Code to Replace Text in PHP
- Executing php on button press
- Add other class content with reference class value
- Using Google Analytics in an enqueued JS file
- separate list of programs in html/javascript coming from php
- How to use wp_ajax_set_post_thumbnail?
- How do I disable cache for a certain page?
- WordPress Slider is not working
- Show subcategory name selected in specific category woocoommerce
- sessionStorage saves input value in browser but it is not loaded in the form field
- Collapsible menu on post sidebar only expands and does not collapse
- Target a specific container to style on WordPress storefront theme
- scroll scrpit to particular button position to next id when click button
- Bootstrap Carousel Indicators Won’t Cycle On Custom WordPress Theme
- Where to find the html for WordPress site? [closed]
- I need help implement a Javascript code into the PHP file
- Trying to customize wordpress drop down categories
- Is there a better way to output HTML as a shortcode?
- Load wp_editor on button click
- Slick slider not working on wordpress
- How to enable button onClick functions and java script in wordpress post
- WordPress Infinite Scroll without using any plugin
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- How to resize image on client-side before upload?
- Limit the Excerpt field in WP-Admin in words
- WordPress Wysiwyg Content not being displayed
- Create custom blocks for bootstrap
- How do I add HTML to a PHP function [closed]
- WordPress automatically adding html tag around PHP code
- Missing sidebar parameter “fix” – before_content
- Converting HTML Template to WordPress Theme
- How to add a Custom Mailchimp AJAX Newsletter Subscribe Form
- How do I add a custom css to all posts without affecting homepage css? [closed]
- Wrapping a Sidebar within
- How to add API security keys into JS of wordpress securely
- How to edit HTML of my website on WordPress? [closed]
- Get related product based on subcategory selected from category id with ID 142
- wp_nav_menu not working correctly in my underscores theme
- How to add post meta in while loop?
- Adding function to child theme’s function.php
- random reason on refresh
- Change Query Arguments (filter) with jQuery/Ajax or PHP?
- Hook on file upload
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- Tracking Visitor LatLng with WordPress using JS, PHP. How to put data which was extract using JS into DB
- Create a WordPress Contact Form to call a POST AWS API Gateway and send user data
- Admin-ajax.php 404 error
- Drop down question
- How To Get HTML Eelement From Another Page
- AJAX and custom pages
- $.ajax results in 403 forbidden
- How can I create a shortcode from an html and php code written together
- Filter portforlio with librairie isotop
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- Serve cookie free URLs in WordPress without using a CDN
- Allowing HTML elements in title widgets spacing problem
- Force ‘permanent’ post cache of shortcode results
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- Add extra markup to WP menus
- How to style this wp_list_pages markup
- How To: Simple domPDF Example
- Can you not edit the HTML and PHP of your WordPress without paying?
- Adding jquery using php function
- How to hide .js files on wordpress website using php or wp plugins or any? [closed]
- notify users when changed database
- Import js variables loaded via wp_localize_script() into js module without global scope connection
- Weird Javascript:void(0) code in my website
- Why do I get a 404 error on my custom post type archive pagination?
- change div text and link for logged in users
- Font Awesome Icons as squares [closed]
- Editing stylehseet url in head section of WordPress
- How can we upload custom page files?
- Registered a REST Route but I’m Getting a 400 Bad Request
- Add custom data attribute to every core Gutenberg Blocks