_wpseo_deactivate()
On deactivation, flush the rewrite rules so XML sitemaps stop working.
Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.
Хуки из функции
Возвращает
null. Ничего (null).
Использование
_wpseo_deactivate();
Код _wpseo_deactivate() wpseo deactivate Yoast 27.7
function _wpseo_deactivate() {
require_once WPSEO_PATH . 'inc/wpseo-functions.php';
add_action( 'shutdown', [ 'WPSEO_Utils', 'clear_rewrites' ] );
// Register capabilities, to make sure they are cleaned up.
do_action( 'wpseo_register_roles' );
do_action( 'wpseo_register_capabilities' );
// Clean up capabilities.
WPSEO_Role_Manager_Factory::get()->remove();
WPSEO_Capability_Manager_Factory::get()->remove();
// Clear cache so the changes are obvious.
WPSEO_Utils::clear_cache();
do_action( 'wpseo_deactivate' );
}