We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [deactivation]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
99
votes
2answers
52k views

Uninstall, Activate, Deactivate a plugin: typical features & how-to

I'm making a wordpress plugin. What are typical things I should include in the uninstall feature? For example, should I delete any tables I created in the install function? Do I clean up my option ...
6
votes
1answer
875 views

How to Modify/Change a Buddypress/Wordpress Account Activation Process

I'm developing a custom BuddyPress/WordPress Plugin. Here's how a user would normally register. A user registers as usual on registration page His/Her account is deactivated till he/she clicks on ...
5
votes
2answers
163 views

Must activation/deactivation functions in a class be static?

The description for register_uninstall_hook's $callback parameter states: Must be a static method or function.1 There is no such comment for register_activation_hook or register_deactivation_hook. ...
3
votes
2answers
13k views

Disable WooCommerce action

I'm customizing a WooCommerce theme and am going to be moving the title. There is an action in content-single-product.php called: do_action( 'woocommerce_single_product_summary' ); in the ...
2
votes
2answers
2k views

Deactivate plugin upon deactivation of another plugin

Wondering if its possible to deactivate a plugin in the deactivation code of another plugin? IE. i have a widget that i'm adding via its own plugin that won't function if the 'master' plugin isn't ...
2
votes
1answer
89 views

OOP: Display warning and deactivate the plugin if PHP version is less than 5.4

I want to show a notice to the user and deactivate my plugin, using OOP code style, if the user has a PHP version less than 5.4. The code works fine when I create my plugin using non-OOP. It shows an ...
1
vote
2answers
191 views

Do you clean up your self-written plugins' at deactivation?

After developing some plugins for myself, some of them is ready to be published. For all, I've written deactivation functions, which deletes the set options, the database, etc. after themselves. But I'...
1
vote
1answer
997 views

How to automate wordpress plugin activate and deactivate by php logic?

Is it possible to build logic to control the activation and deactivation of specific wordpress plugins , for example Activation/Deactivation triggered by time period? thanks for knowledge sharing.
1
vote
1answer
847 views

Can a plugin deactivate itself?

We have a situation where a couple of our longstanding plugins (Google Analytics is one) are currently offering the option to "Activate" them. This figures, because Google Analytics traffic stopped ...
1
vote
1answer
1k views

Displaying a message when plug-in is deactivated

I'm using the following code to deactivate my WordPress Plugin if the requirements are not met public function activate() { if (!$this->check_requirements()) { ...
1
vote
4answers
96 views

Deactivate Plugin on Theme Switch

I am developing a plugin, let's call it DahPlugin, that provides additional customizer options for a free theme I developed. Let's call this theme DahTheme (I don't want to shamelessly plug either one ...
1
vote
1answer
499 views

Plugin Deactivate Self on Activation Errors

Hi I'm wondering if someone can point me in the right direction here. I'm having trouble figuring out how deactivate_plugins() works. I've been using variations of the below for awhile now and it's ...
1
vote
1answer
4k views

Why my Plugin keeps deactivating automatically?

I have a plugin called 'virtual theme' which I downloaded from the plugin directory, and it works great but i noticed sometimes when there's a change it with other plugins it seems to stop working and ...
1
vote
1answer
772 views

disable active plugins for specific theme

I want to disable some plugins from a specific theme.I am using deactivate_plugins hook to deactivate. following is my code. add_action('wp_head','disable_plugins'); function disable_plugins(){ ...
1
vote
1answer
839 views

Show a confirmation message on plugin deactivation

When my plugin is deactivated, I want to get a confirmation from the user whether all plugin options/tables need to be deleted or left as it is. Based on the option selected, I want to proceed further....
1
vote
1answer
50 views

Turn on and off custom post type from admin?

Is it possible to "deactivate" a custom post type and then later if you feel like using it again you can simple "activate" it again?
1
vote
2answers
717 views

Remove Action from Plugin within extended class and no assigned variable

I have tried so many solutions for this but I can't figure it out. Here is a simplified version of the plugin code: class YITH_Vendors_Frontend_Premium extends YITH_Vendors_Frontend { public ...
1
vote
3answers
2k views

how to deactivate a plugin without using a WP function?

I wish to deactivate my plugin, but WITHOUT using update_option() or any other core WP function. What's the best way to go about this? Direct DB connection and modification?
0
votes
2answers
3k views

Reset Roles (or undo role changes on theme change)

I am creating a theme that deletes some user roles that are not necessary and creates others. (It deletes author and contributor and renames subscriber). Everything works, but on theme deactivation, ...
0
votes
1answer
36 views

Wordpress Plugin Activate / Deactive Failing

Below is my plugin.php file that would install into wp-content <?php // If this file is called directly, abort. namespace Booker; if ( ! defined( 'WPINC' ) ) { die; } /** ...
0
votes
1answer
68 views

WPMU If MU site has no administrator, deactivate site

So I been tinkering with this thought. Working w/ WooCommerce Subscriptions - if the user is a recurring paid member, they can create and manage their own subsite. However, say the recurring payments ...
0
votes
2answers
280 views

How to deactivate my plugin upon deactivation of NextGen

i'm writing this plugin and i need to deactivate it when NextGen is deactivated: <?php /* Plugin Name: Plugin Name Description: Description Version: 1.0 Author: Author Author URI: Author URI */ //...
0
votes
1answer
80 views

My plugin does not install correctly if a previous version is still installed

My plugin only installs correctly if the user first deactivates and then deletes a previously installed version. If they do not delete the previous version, the installation either does not complete ...
0
votes
0answers
15 views

Is there an option to execute javascript file only on plugin deactivation

I'm creating a custom plugin for WordPress and I'm trying to execute javascript file only on plugin deactivation. I'm using register_deactivation_hook() and wp_enqueue_script() to execute file only ...
0
votes
0answers
30 views

Unset plugins on front-end belonging to specific category

I have a function which unset plugins on the front-end. The only extra criteria, in_category ( 'my-cat-name' ), I am not able to achieve. Where and how to add the category so the plugins are only ...
0
votes
1answer
97 views

is_active_sidebar() problem

I'm trying to develop a wordpress theme with a hero slider, I use some 3rd party slider widget inserted to the hero widget area I've defined as sidebar-hero in my functions.php file. I'm using this ...
0
votes
1answer
560 views

Deactivate a plugin on wp version

I've creating a theme options page at the moment and was playing around with this function deactivate_plugins() I'm running wordpress 3.8.3 so running this code in my plugin should uninstall it. ...
0
votes
0answers
56 views

Different plugins activated online and offline

I develop / add to / etc. my site offline, then transfer the updated database (in toto) to the live site. Some of the plugins I need / use offline, I don't need online, and vice versa. Is there a way ...
0
votes
3answers
85 views

Is it possible to run javascript on plugin deactivated?

Is it possible to run javascript on plugin deactivated and if yes then, how should I achieve that. I have developing one plugin in which two new tables are created in wp database and on deactivation ...