Stuck! My plugin breaks the admin interface!
-
Hi all,
My first post as I can’t find a solution via search, so please be gentle ??
I’ve written a very simple plugin to take some postdata from a manually created form in a WP page, validate it and send it off to me in an email. A trivial task in PHP but the plugin I’ve written for it doesn’t get on well with wordpress.
The crux of it is that when my plugin is active/installed, logging into the admin interface does not work (it simply redirects back to the login form with out error/warning) and the save/auto save for pages breaks with the error “Notice: Undefined variable: _POST in /home/foo/bar-wp/www/wp-admin/admin-ajax.php on line 67”
The process of ellimination has allowed me to track it down to a function which is intended to process the form’s POSTDATA. I’ve added an action as per:
add_action(‘init’,’mypluginname_process’);
And the part of the function causing the trouble is:
if( ( isset($_POST[‘mypluginname-process-form’]) ) &&
( isset($_POST[‘mypluginname-key’]) ) ) { ….// do stuff.
I’ve identified that all my problems dissapear if I comment this and the code it contains out, but return as soon as they’re reinstated.
Have I missed somethng in the way WP processes postdata? Any help appreciated.
- The topic ‘Stuck! My plugin breaks the admin interface!’ is closed to new replies.