The tag has no wiki summary.

learn more… | top users | synonyms

39
votes
2answers
22k 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 ...
8
votes
3answers
9k 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
3k 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 ...
5
votes
2answers
325 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: ...
5
votes
3answers
305 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
1answer
864 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
1answer
1k 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' ...
3
votes
2answers
813 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
178 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
485 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
490 views

Redirect after User Activation

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
130 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 ...
2
votes
3answers
3k 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
1k 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
1answer
2k 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
2answers
484 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
3answers
3k views

Does wordpress create activity, update logs?

Does wordpress create any dated logs of activity? ie core updates, plugin download dates etc?
2
votes
1answer
293 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. ...
1
vote
3answers
2k 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
307 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
2answers
49 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
235 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
2answers
17 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
2answers
1k 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
700 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
99 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
154 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
30 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
156 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
1answer
87 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
88 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
2answers
416 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( ...
0
votes
2answers
41 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
323 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
73 views

How can I create blog specific database table in multisite?

I am creating a plugin, that supposed to work on WP multisite yesterday. I've installed WP multisite on my server. While testing I found out that register_activation_hook created 1 table on the main ...
0
votes
1answer
84 views

why i cannot see some plugins while they are enabled on network admin page?

i am using WPMU 3.3.1, i have some plugins enabled but why i cannot see them in some wordpress panel, it is confusing, but these plugins may take effect to these blogs, it is really strange to take ...
0
votes
1answer
180 views

How to add custom menu item on plugin activation?

When my plugin is activated, I would like to add a new menu item. Here is my code: class My_Plugin { function __construct() { register_activation_hook(__FILE__, array($this, 'install')); } ...
0
votes
1answer
265 views

Default Plugin Settings Not Writing to Database

I have my plugin setup as such: Main plugin file mouldings.php <?php /* Plugin Name: Moulding Profiles Plugin URI: Description: Creates a 'Moulding Profiles' and 'Idea Gallery' custom post ...
0
votes
1answer
94 views

Add update services on theme activation

I want add update services when I activate my theme, how to do this ? with an hook like enable_update_services_configuration ? Thanks in advance
0
votes
1answer
502 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 ...
0
votes
2answers
186 views

Only allow plugin to be activated on root site of multisite

I'm developing the wordpress file monitor plus plugin. Its purpose is to scan for altered files and it works fine for a single installation of WP. But when you look at multi-site it's not something ...
0
votes
1answer
30 views

register_activation_hook for multiple functions

I have created a plugin where I want to call two different functions on activation. Is there a best way to do this? Should I use register_activation_hook twice? As in: register_activation_hook( ...
0
votes
4answers
59 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
1answer
48 views

Activate / Deactivate plugin

I'm working on my first plugin and am trying to use register_activation_hook() and register_deactivation_hook() ... I know I'm not doing this right: ...
0
votes
1answer
111 views

wpmu_signup_user_notification filter not working

I'm trying to customise the activation email in WordPress. I'm using WordPress 3.8 Multisite (subdomain). I added the following code (from ...
0
votes
1answer
528 views

register_activation_hook in oop approach

I tried to develop a plugin in OOP approach. I tried to load all the function needed inside the constructor class e.g action hooks. The problem is this hook "register_activation_hook". It wont load ...
0
votes
1answer
74 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
1answer
137 views

Is there existing plugins to “Click-to-Launch” embedded Flash / SWF content?

I'm aware that there is existing FlashBlock plugins that users can install on their browsers, but I would like a Wordpress approach to be able to: Replace SWF content by a thumbnail / screenshot of ...
0
votes
2answers
523 views

rewrite_rules() not applying rules on plugin activation only after permalinks menu is clicked

thanks to Roman for pointing me in the right direction my plugin is almost ready. The only problem i am now facing is that i cannot get the rewrite_rules applying on activation they only work after i ...
0
votes
1answer
17 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” ...