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

In a WPMU setup the account information is sent to the wp_signup table before being passed to the wp_users table. an easy fix for this is: function your_disable_activation( $user, $user_email, $key, $meta=”” ) { // Activate the user $user_id = wpmu_activate_signup( $key ); wp_set_auth_cookie( $user_id, true, is_ssl() ); wp_redirect( /*redirect to */ site_url() ); exit; … Read more

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

50 is relatively not much, and you should create them on the plugin activation hook. For more then 100 (just pulled the number out of my ass 😉 do your own testing on some slow shared hosting) I would create a settings page and initialize the DB from there. The reason is that users do … Read more

Prevent a plugin from being automatically activated

You might want to add your own plugin to deactivate their plugin (silently). First open their main plugin file and see where the plugin hooks (or filters) in. Then unhook their plugin … and your’s as well. <?php /** Plugin Name: Deactivate other plugin */ add_action( ‘the_same_hook’, ‘removeOtherPlugin’, PHP_INT_MAX -1 ); function removeOtherPlugin() { remove_filter( current_filter(), … Read more

Add update services on theme activation

Themes don’t currently have activation/deactivation/installation/uninstallation hooks. Your best bet is to “fake” it somehow, perhaps with a function that only executes one time, based on a switch that gets toggled when the function executes. e.g.: <?php function wpse45817_theme_activation() { // globalize our switch global $wpse45817_theme_activation_switch; // Check to see if the switch is set if … Read more

File not found.