'; // Update options. update_option( 'wpseo_titles', $display_options ); } } /** * Hook into activated_plugin action. * * @param string $plugin Plugin path to main plugin file with plugin data. */ function vs_activated_plugin( $plugin ) { // Check if PVC constant is defined, use it to get PVC path anc compare to activated plugin. if ( 'post-views-counter/post-views-counter.php' === $plugin ) { vs_plugin_set_options( 'post-views-counter' ); } // Check if WPSEO constant is defined, use it to get WPSEO path anc compare to activated plugin. if ( 'wordpress-seo/wp-seo.php' === $plugin ) { vs_plugin_set_options( 'wp-seo' ); } } add_action( 'activated_plugin', 'vs_activated_plugin' ); /** * Hook into after_switch_theme action. */ function vs_activated_theme() { vs_plugin_set_options( 'post-views-counter' ); vs_plugin_set_options( 'wp-seo' ); } add_action( 'after_switch_theme', 'vs_activated_theme' );