PDF-Viever-Elementor/uninstall.php
2025-05-03 04:32:37 +05:00

18 lines
793 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// Если WordPress не вызывает этот файл напрямую, выходим
if (!defined('WP_UNINSTALL_PLUGIN')) {
exit;
}
// Здесь мы удаляем все данные плагина из базы данных
// В нашем случае, нам нужно удалить настройки виджета, если они были сохранены
// Удаляем опции плагина, если они есть
delete_option('pdf_viewer_elementor_settings');
// Удаляем мета-данные постов, связанные с нашим виджетом
global $wpdb;
$wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE meta_key LIKE '_elementor_data' AND meta_value LIKE '%pdf_viewer%'");
// Очищаем кэш
wp_cache_flush();