I am running SQL commands and when there is an error I want to deactivate my plugin. Do I do that with wp_die or is there some other preferred method?
I am running SQL commands and when there is an error I want to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
My understanding is that plugin activation/deactivation is controlled by the wp_options table in the DB.
You might consider a second MySQL call that deactivates the specific plugin. You can get all active plugins using this:
You can update the list with something like this:
Obviously, you’d want to modify this to target the specific plugin.
I saw this method used here, in which the author is describing how to deactivate ALL plugins via a MySQL query. Hope this helps.