The tag has no usage guidance.

learn more… | top users | synonyms

62
votes
2answers
38k 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 ...
12
votes
3answers
2k views

How to redirect to settings page once the plugin is activated?

I created the Plugin of my own. Everything seems OK but one thing I want to do in that plugin is redirect to the corresponding plugin settings page when the plugin is activate. For example: ...
10
votes
3answers
19k views

How To Activate Plugins via Code?

If possible, how can installed plugins (meaning the files have been placed in wp-content/plugins directory) be activated from other plugins?
6
votes
4answers
6k views

Import Wordpress XML File from Within Functions.php

I am developing a theme which has a different method of adding in content and so, the default install of Wordpress won't show any content because of this. I was wondering if it is possible to ...
6
votes
4answers
743 views

Prevent network activation of plugin

I have a plugin that currently doesn't support network activation. The best fix for this of course is to fix it :) which I plan to do. However I wonder if there is a temporary solution I can use to ...
5
votes
3answers
2k views

How to output message during plugin activation

I am developing a plugin, but during the activation phrase I am constantly facing bugs. However there is no easy way to display error messages, since echoing stuff would result in 'unexpacted output' ...
5
votes
1answer
235 views

How to run an activation function when plugin is network activated on multisite?

I'm trying to make my plugin multisite compatible. I'm using the register_activation_hook() function to register my my_activate() function to run when the plugin is activated. This works well on a ...
5
votes
2answers
2k views

Inserting Taxonomy Terms During a Plugin Activation?

I've been trying various ways of doing this. Basically, I've been trying to make it so that a plugin of mine populates the terms of a taxonomy only once during the plugin's activation. The term ...
4
votes
2answers
2k views

Show a confirm message before plug-in activation

I want to display a message when the user try to activate my plugin. This message will ask if him really wants to activate the plugin or, if him change his mind, cancel the activation. How can I ...
3
votes
1answer
398 views

Call activation hook multiple times

I have a plugin that does some initialization stuff using register_activation_hook called from its __construct(). I've since extended my plugin to add functionality to it. For the sake of ...
3
votes
3answers
679 views

Viewing output when the “The plugin generated x characters of unexpected output during activation” error is triggered

I'm working on a plugin and having some difficulties getting a new table created. I get the "The plugin generated x characters of unexpected output during activation" error. Is there a way of viewing ...
3
votes
1answer
985 views

Redirect after User Activation [closed]

I am using BuddyPress 2 registration and activation for three different sites with my own registration form. To know where the user has registered, I add the user meta key registered_from at ...
3
votes
1answer
293 views

Using wp_cron with custom time interval and the register activation hook

Scenario 1: fails Adding a cron task wp_schedule_event with a custom interval on plugin activation using register_activation_hook outside the class definition fails to work because the custom ...
3
votes
1answer
301 views

Pluggable function and activation check?

Plugin is defining pluggable wp_mail() function. My idea was to check if function is defined already and throw warning if other plugin beat me to it. However this warning causes issues on activation. ...
3
votes
1answer
111 views

Ask user permission when activating a plugin

Is there a specific Wordpress API way to ask the user's permission for something when activating a plugin? Due to the Wordpress plugin directory policy I have to ask the users consent for the ...
2
votes
5answers
6k views

Customizing wp-activate.php

Does anyone know how I can customise wp-activate.php? It wraps the content in <div id="content" class="widecolumn">, however in my theme the main wrapper is <div id="main"> Presumably, I ...
2
votes
3answers
2k views

Multisite: setting theme and options when a new blog is created

When a new blog is created in a WP Multisite instance I want to be able to set the default theme and configuration options create 2 menus (main and secondary) and associate them with the 2 slots ...
2
votes
2answers
857 views

The plugin generated x characters of unexpected output, $wpdb not defined

I've written a simple Wordpress plugin to create a new database table. The new table ought to be created when the plugin is activated. When I try to activate the plugin, I get the following error: ...
2
votes
1answer
4k views

How to manually activate user in dashboard only by admin

I'm looking for a function that allows admins (only) to activate new users. When a user registers he have to be approved by the admin before he gets access to log in. Does anyone know how I can do ...
2
votes
1answer
87 views

Can't add user to blog on registration (Multisite)

I'm trying to add a users to a specific blog with a role chosen by the user at registration. I'm able to add the desired role to meta with this: add_filter( 'add_signup_meta', 'add_register_meta' ...
2
votes
5answers
9k views

Does wordpress create activity, update logs?

Does wordpress create any dated logs of activity? ie core updates, plugin download dates etc?
2
votes
0answers
58 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 ...
1
vote
2answers
2k views

How to check if a theme is active?

I'd like to be able to check if the twentytwelve theme is active. I know if I was checking for an active plugin I'd do something like: $active_plugins = apply_filters( 'active_plugins', get_option( ...
1
vote
3answers
3k views

Problem creating a table with dbDelta

I'm working on a plugin that was creating a table successfully. However, I decided to test it in a fresh install of Wordpress (on my local server) and now the table is not being created in my ...
1
vote
1answer
734 views

Override pluggable functions in a plugin?

WordPress has a file called pluggable.php which contains a list of functions you can override in your plugin. The problem I am facing (I am overriding wp_authenticate) is for each blog in my network ...
1
vote
1answer
2k views

Auto add content such as pages upon plugin activation?

I'm creating my first plugin and it requires some pages with content to functionally work properly. I was wondering if it is possible to show a message like "Click here to automatically add the ...
1
vote
1answer
3k views

How to include plugin without activation?

I need to include plugin in my WordPress theme without plugin activation. I have these lines: include_once dirname( __FILE__ ) . '/math/class-constrained-array-rounding.php'; include( ...
1
vote
2answers
50 views

Comments deactivated

I can't write comments to new articles (no add comment link available). I use Wordpress 3.4. I checked the discussion properties and they are set to allow guests to comment articles none of the ...
1
vote
1answer
344 views

is_plugin_active() not properly returning true

I have a plugin activated and working, and I installed and activated another plugin I wrote to communicate with it. However when I run is_plugin_active() I get false returned - does anyone have any ...
1
vote
3answers
159 views

How to activate plugins for my WordPress sites from a remote server

I have been thinking of managing a set of wordpress sites from a remote server.I would like to get information on plugins that has been installed on my wordpress sites.I would also like to install ...
1
vote
1answer
206 views

Unexpected Output: register_activation_hook with namespace

I encounter a weird error while using the register_activation_hook and namespace. The plugin generated 236 characters of unexpected output during activation. If you notice “headers already sent” ...
1
vote
2answers
29 views

Activated plugin is stored as an object, rather than as a path

This seems like a very unusual behavior: Usually, when activating a plugin, a path to the plugin's main file (or bootstrap) is stored in the database under options.active_plugins. However, something ...
1
vote
1answer
4k views

Customize user account activation message

During the process of a user creating a new account, once they click on the link in the activation email, they receive the message on the login page: Your account is now active! Username: ** ...
1
vote
2answers
3k views

Automatically install wordpress plugin at theme activation

I'm looking into using http://tgmpluginactivation.com/ to activate required plugins for my custom theme during the theme activation step. From what I can tell, this class only Activates plugins ...
1
vote
1answer
242 views

register_activation_hook with include file [closed]

I'm yanking my hair out with the following code, please help. I have 3 files. File1.php: Class File1 { public function file1_register() { //register some short codes; } public ...
1
vote
1answer
172 views

Force plugin to fail activation

I'm writing a plugin that will be using custom fields added by a theme. Because of this, it would be ideal if my plugin not be able to activate should these fields not exist. How do I go about ...
1
vote
1answer
27 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
2answers
2k views

Activate a plugin through PHPMyAdmin or FTP?

I've just disabled a plugin on my site and it's now giving me the dreaded white screen of death. I know the site will be fine if I reactivate the plugin. Is there a way to manually activate a plugin ...
1
vote
1answer
40 views

Own plugin corrups plugin-activation

I am currently working on a simple plugin. Activating my plugin works fine. However, I can't activate any other plugin as long as mine is active. Also, the edit links won't work. Any help with this ...
1
vote
1answer
268 views

Remote plugin activation hook

I am remote activating plugins using update_option('active_plugins,'some_plugins'); It works fine except one thing: if some plugins have to create some tables using ...
1
vote
2answers
733 views

How do you disable account activation in WPMU and then log the user in right away?

Is there a way to disable account activation for WPMU then log the user in and redirect them to another page? I am running on WPMU with BuddyPress.
1
vote
0answers
42 views

Display message on homepage when new user account is activated

When a new user registers on Wordpress an activation link is sent out to their email address. When the user clicks on this link they are directed to my homepage and their account is activated. At ...
1
vote
1answer
388 views

Register theme customizer settings when theme activates [duplicate]

I've been following this great tutorial (http://wp.tutsplus.com/tutorials/theme-development/digging-into-the-theme-customizer-overview/) and now I have set the Theme customizer. As far as I ...
1
vote
1answer
104 views

How do i place same widgets multiple time by default on theme activation?

I am creating a portfolio theme and want to place some widgets on sidebar by default on theme activation. I did it but the problem is that, I want to place Text widget two times at the same sidebar ...
1
vote
0answers
106 views

Plugin Activation Problem [closed]

I am trying to activate a plugin on my install of WordPress 3.4.2. It works okay. It says Plugin activated, but below the plugin is not activated. It does the same for all plugins, including Hello ...
0
votes
4answers
622 views

Is it possible to stop a theme activation when a certain plugin is not activated

So I am planning a theme that will depend on a plugin (for instance Timber or Themosis). So of course a theme will break if it can't use it's depending plugin's. So I would like a way to stop the ...
0
votes
2answers
45 views

I have no images in an activated wp theme

With this line everything works fine - (as a Non-Wordpress index.php): <link href="style.css" rel="stylesheet" type="text/css"/> When I activate the file as a wp theme and replace above ...
0
votes
1answer
350 views

Add Link Category on Activation?

Is it possible to add a link category on plugin activation? What I mean is the Links section, as you know by default it has the Blogroll link category. I want to add a new link category when my ...
0
votes
1answer
27 views

A question about register_activation hook

Looking at wp codex it says: The register_activation_hook function registers a plugin function to be run when the plugin is activated. I am finding this to be not entirely correct, for example i can ...
0
votes
1answer
699 views

Run function on plugin activation before plugin is loaded

I have two versions of the same plugin - one is a free version on WordPress.org and the other is a paid upgrade. Both versions use the same function names and so can't be activated at the same time. ...