/** * On deactivation, flush the rewrite rules so XML sitemaps stop working. */ function _wpseo_deactivate() { require_once WPSEO_PATH . 'inc/wpseo-functions.php'; add_action('shutdown', 'flush_rewrite_rules'); wpseo_remove_capabilities(); // Force unschedule WPSEO_Utils::schedule_yoast_tracking(null, get_option('wpseo'), true); // Clear cache so the changes are obvious. WPSEO_Utils::clear_cache(); do_action('wpseo_deactivate'); }
/** * (Un-)schedule the yoast tracking cronjob if the tracking option has changed * * @deprecated 1.5.6.1 * @deprecated use WPSEO_Utils::schedule_yoast_tracking() * @see WPSEO_Utils::schedule_yoast_tracking() * * @param mixed $disregard Not needed - passed by add/update_option action call * Option name if option was added, old value if option was updated * @param array $value The (new/current) value of the wpseo option * @param bool $force_unschedule Whether to force an unschedule (i.e. on deactivate) */ public static function schedule_yoast_tracking($disregard, $value, $force_unschedule = false) { _deprecated_function(__METHOD__, 'WPSEO 1.5.6.1', 'WPSEO_Utils::schedule_yoast_tracking()'); WPSEO_Utils::schedule_yoast_tracking($disregard, $value, $force_unschedule); }