Problems with a plugin I am developing, and the 'Are you sure you want to do this?' message.
Not my first plugin, and it is following the general guidelines for development. The plugins' function is to perform a database query on a button press on the plugin settings screen. That all functions properly.
The function for the button press (in a form) displays the form/button on the Settings page. The form's action is to itself, so the plugin settings page is displayed on the button press/form submit (after performing the desired function for the button/submit).
I have noticed the following
- The plugin cannot be deactivated on the plugin screen - the screen is
redrawn, but no deactivation message and the plugin is still active.
Plugin deactivation code is standard and per Codex; nothing fancy,
- The 'Are you sure..' error message is displayed on a post
save/publish attempt. Post is not saved.
- This error message is in the wp-admin error log:
"PHP Warning: array_merge(): Argument #2 is not an array in /[specific file location redacted]/wp-includes/load.php on line 664'
There is no nonce checking in the form on the settings page (used to be, but removed that during testing to no avail) (And yes, I know the risk; it's not there while I debug things, and Post values from the form are already sanitized elsewhere.)
There is no
check_admin_referer()code in my plugin
I have verified the plugin causing the error by removing the plugin folder
- It is not a permissions error.
It is not a memory error (the plugin increases the memory_limit to 256M)
Have asked the googles; nothing helpful there.
What should I be looking for in my plugin code (too long to reproduce here)? Where should the form for the button be displayed optimially (or is that even related to the error)?