Articles of activation

Plugin can't be activated

I’m developing a WordPress plugin, but the last changes caused the plugin to stop working. It tells me that I can’t activate the plugin because it caused a fatal error. On localhost all is working fine, but after sending to the server, on activation it displays the following: Can’t use function return value in write […]

Apparent errer when installing plugin

I have been working on my first plugin (call is myplugin). The path to the plugin code is wp-content/plugins/myplugin/myplugin.php. The myplugin.php file is essentially as follows: <?php defined( ‘ABSPATH’ ) OR exit; /* * Plugin Name: My Plugin */ function my_plugin_activation() { global $wpdb; // SQL code to insert custom database tables // using CREATE […]

Activation Account Email

I use a betnami hosted wordpress multisite, when a user sign up in the site he should receive an email with activation link, but it does not work! so how to make it work? and if it work how to customize the email that the user receive. Best Regards

Insert terms for custom taxonomy on plugin activation, or each page load (init hook)

Consider a plugin which adds a custom Taxonomy and then fills the taxonomy with a large term hierarchy (tens of hierarchical terms, may become hundreds in specific installations). I understand that register_taxonomy() does not store data in the database, therefore it must be used via the init hook so that the taxonomy is registered on […]

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 goto the WordPress admin menu, goto the Permalinks settings page and click Save Changes, then it all works. […]

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

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 effect before i enable it … these erroneous plugins include Private Only, WordPress Importer, WP Super Cache […]

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’)); } function install() { add_action(‘admin_menu’, array($this, ‘add_menu_item’)); } public function add_menu_item() { add_menu_page(…); } } $my_plugin = new My_Plugin(); Unfortunately, it doesn’t work. I notice that install is […]

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( __FILE__, ‘function_1’ ); register_activation_hook( __FILE__, ‘function_1’ ); Or call the two functions from within an activation function, as in: register_activation_hook( __FILE__, ‘my_activation_function’ ); function […]

Run function on plugin activation before plugin is loaded

I have two versions of the same plugin – one is a free version on and the other is a paid upgrade. Both versions use the same function names and so can’t be activated at the same time. When someone installs and activates the paid version before deactivating the free version currently a Fatal […]