Use the below code at the end of your functions.php file and save the file. Please change the plugin name in this line of code run_activate_plugin( 'akismet/akismet.php' );
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | function run_activate_plugin( $plugin ) { $current = get_option( 'active_plugins' ); $plugin = plugin_basename( trim( $plugin ) ); if ( !in_array( $plugin, $current ) ) { $current[] = $plugin; sort( $current ); do_action( 'activate_plugin', trim( $plugin ) ); update_option( 'active_plugins', $current ); do_action( 'activate_' . trim( $plugin ) ); do_action( 'activated_plugin', trim( $plugin) ); } return null; } run_activate_plugin( 'akismet/akismet.php' ); |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.