Plugin De/Activation Not Firing On MultiSite install
I discovered that I was attempting to use register_activation_hook too late in the loading cycle.Moving it outside my class init function to the global scope made it behave as expected.
I discovered that I was attempting to use register_activation_hook too late in the loading cycle.Moving it outside my class init function to the global scope made it behave as expected.
The value of $menu_id is not initialized if the menu already exists. So, if on theme activation, $menu_exists is true, $menu_id will never be set to a value and this line should produce a PHP warning: $locations[$menulocation] = $menu_id; You could try adding it like this: if ( $menu_exists ) { $menu_id = $menu_exists->term_id; } … Read more
WordPress plugin tables become corrupt
Custom WP deactivate an email activation link sent to user’s email.
Problems with installing and deleting plugins
Different plugins activated online and offline
Use this code register_activation_hook(__FILE__, ‘rating_install’); register_deactivation_hook(__FILE__, ‘rating_uninstall’); function rating_install(){ global $wpdb; $table_name = $wpdb->prefix.”rating”; $create = “CRETA TABLE “.$table_name.” ( ” . “id INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY, ” . “url TINYTEXT NOT NULL, ” . “descripcion TINYTEXT NOT NULL ) “; $wpdb->query($create); } function rating_uninstall(){ global $wpdb; $table_name = $wpdb->prefix.”rating”; $drop … Read more
You should be able to do something like this: register_activation_hook(__FILE__, ‘my_plugin_activate’); add_action(‘admin_init’, ‘my_plugin_redirect’); function my_plugin_activate() { add_option(‘my_plugin_do_activation_redirect’, true); } function my_plugin_redirect() { if (get_option(‘my_plugin_do_activation_redirect’, false)) { delete_option(‘my_plugin_do_activation_redirect’); wp_redirect(MY_PLUGIN_SETTINGS_URL); } }
All of this can be done using WP_User_Query: $users = new WP_User_Query(array( meta_query( array( ‘key’ => ‘login_status’, ‘value’ => ‘0’ ), array( ‘key’ => ‘active_code’, ‘value’ => ‘3f7431e226893f16cbe44424850d00ad’ ) ) )); This will return a list of users that meet your requirements. Then you can get the ids like so: $user_ids = wp_list_pluck( $users->get_results(), ‘ID’ … Read more
Resend user activation mail