Access _POST data in plugin
-
I am writing a plugin that has a form, receives and writes data to a custom database table and sends an email.
In my form I use<input type="hidden" name="action" value="peoples_choice_vote">
and my function is called like thisif ( is_this_user_logged_in() ) { add_action('admin_post_peoples_choice_vote', 'handle_peoples_choice_vote'); } else { add_action('admin_post_nopriv_peoples_choice_vote', 'handle_peoples_choice_vote'); }
This code works fine in functions.php when I move it to the plugin and activate it fails, and when I submit the form I get a white screen at admin-post.php, no data is written and the email is not sent.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Access _POST data in plugin’ is closed to new replies.