Files
2026-11-16 12:24:05 -05:00

32 lines
676 B
PHP

<?php
/**
* Cleans up 404 Enhancer options and transients on uninstall.
*
* @package 404_Enhancer
*/
if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
exit;
}
$fe_options = array(
'fe_custom_message',
'fe_featured_image_id',
'fe_enabled_post_types',
'fe_featured_post_ids',
'fe_suggestions_per_page',
);
foreach ( $fe_options as $fe_option ) {
delete_option( $fe_option );
}
global $wpdb;
$wpdb->query( // phpcs:ignore WordPress.DB.DirectDatabaseQuery
$wpdb->prepare(
"DELETE FROM {$wpdb->options} WHERE option_name LIKE %s OR option_name LIKE %s",
$wpdb->esc_like( '_transient_fe_gitea_' ) . '%',
$wpdb->esc_like( '_transient_timeout_fe_gitea_' ) . '%'
)
);