From the documentation: https://developer.wordpress.org/reference/hooks/init/
add_action( 'init', 'process_post' );
function process_post() {
if( isset( $_POST['unique_hidden_field'] ) ) {
// process $_POST data here
}
}
In your example, perhaps having two different add_action
is causing problems and burying your function where it’s not firing during init
I’m going to test a similar solution and see what happens, I will update if I learn more.
Related Posts:
- Refresh page after form action
- Using get_terms for custom taxonomy in functions.php
- How to properly refresh page after form action?
- Using get_terms for custom taxonomy in functions.php
- Postback redirect through add_action is not triggered
- How to change form action of wp-login page with a function
- Sending Messages Back to the Template After Processing?
- remove_action on after_setup_theme not working from child theme
- Remove Actions/Filters added via Anonymous Functions
- Trying to use add_action and do_action with parameters
- How to use the do_action () with parameter
- Perform an action when post is updated/published
- Do WordPress’ cron’s clean up expired transients?
- add_action in a function, is it possible?
- contactform7 remove tags with “wpcf7_autop false” from functions.php
- How to count number of functions attached to an action hook?
- Add action hook conditionally – only when home.php in use
- Add new user : make the fields First Name and Last name required
- How can I tell if I’m on a login page? [duplicate]
- Change meta tags programatically
- Convert hyphen to underscore in permalinks
- Fatal error: Call to undefined function add_action() – an untouched problem
- How to hook into the quick edit action?
- Reuse variable in hook callback
- Automatically Add Specified Value to Attachment Metadata upon Upload
- Can’t Update function.php after writing short code
- How to update feed only 2-3 times a week (for Feedburner email)?
- WordPress registration and contact form 7 [closed]
- Passing arguments to my function with do_action and add_action is not working
- WordPress upload_mimes not working for front-end uploads of 3D files
- Ajax not working properly
- How do I add Bootstrap and LESS to my migrated WordPress site?
- Having a Function Inside of the Loop
- Which action does wp_update_user triggers?
- How can I get my Script to work on the Login page?
- Trigger a custom function when option are saved in admin area
- Wait a result before enqueue
- Redirect to another page if the user is logged in when pressing again the login button on menu bar
- Multiple Loops Meta Data
- Which functions/classes are available during SHORTINIT?
- Function added using `add_action()` not being called
- Difference b/w Simple function call & do_action call
- jQuery does not work
- Override the WordPress core function wp_referer_field
- Set Taxonomy based on post status
- Is There Any Built In WP Functionality For Combining Form Fields To Return Specific Data
- Two functions with different arguments and add_actions, but identical code
- add_action template_redirect not working for home page
- AMP – Change rel=”canonical” from functions.php [closed]
- wp_nonce_field is breaking form for reasons unknown
- Scripts not loading when using the wp_enqueue_scripts action
- current_user_can comma list vs OR (||) list
- Add back in child theme what the parent theme removed with remove_action
- login_headertitle is deprecated since version 5.2.0
- Contact Form 7 If Condition
- 400 Bad Request – JavaScript App calling Custom wp-json endpoint
- Changing where my author box is printed
- Insert Content Before div#main from the functions.php File
- Use add_action within template
- Problem in using Customizer
- Problem with custom function when I go back with the browser
- Replace admin header logo with an image
- New checkbox in custom widget isn’t saving data
- dynamic enquiry form [closed]
- template_redirect action only firing if logged in
- How to use wp_enqueue_script properly?
- This code is supposed to only allow user to be authenticated if accountVerified is equal to 1, but it still allows user to be authenticated otherwise
- Issue passing action class to nested function. Admin Columns
- Does hook have an effect on increasing the page load?
- What is the earliest Hook a Script can use?
- How do I trigger WP CLI DB export using a PHP function?
- If has action not working as expected
- post value to function with Ajax and jQuery
- Is_Page doesnt detect my page
- How do you insert code into the sidebar?
- How Do I Unhook This Parent Theme Function?
- Problems adding a new field to product in cart
- How to show only specific category post by user role without plugin and restrict all other cats
- use add_action in a shortcode (gravity form – WordPress)
- wp_footer hook causing text to show on bottom of page
- Button click counter for login user
- WordPress Ajaxifying not working properly
- Which method is more correct for removing WooCommerce Extensions menu item?
- True parameter but jquery register in header and not in the footer with wp_register_script
- Fatal error: Call to undefined function add_action() – an untouched problem
- previous_post_link inside of a function?
- custom COOKIE on custom page
- Settings in functions.php used by a plugin
- Init hook for header send
- Gravity Forms After Submission – GFFormsModel::update_lead_field_value?
- Do something when user creates post (that’s pending)
- Will my WordPress site become vulnerable after adding this functions which allows more HTML tags for subscribers?
- add variable to actions/functions across different files (woocommerce)
- Help finishing script to export WP user data when form submitted
- Directing to functions.php the correct way
- WordPress Custom wp mail template return full template
- Can’t find function which is called in a wordpress theme
- delete_term is not working properly with add_action()
- Setcookie not setting cookies anywhere except admin
- How to get variable from other function inside class function using add_action for Ajax call