PluginProbe
GutSlider – All in One Slider and Carousel Blocks for Gutenberg / 3.0.0
GutSlider – All in One Slider and Carousel Blocks for Gutenberg v3.0.0
3.1.0 3.0.0 2.13.2 2.13.1 2.13.0 trunk 1.0.0 2.1.0 2.10.0 2.10.1 2.11.0 2.11.1 2.11.2 2.11.3 2.11.4 2.12.0 2.2.1 2.2.2 2.3.0 2.4.0 2.5.1 2.5.3 2.5.4 2.5.5 2.6.1 All 56 releases
slider-blocks / uninstall.php

uninstall.php in GutSlider – All in One Slider and Carousel Blocks for Gutenberg 3.0.0, at uninstall.php

54 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Uninstall script for GutSliderBlocks.
4 *
5 * Generated stylesheets are always removed. Stored options are only
6 * removed when "Delete data on uninstall" is enabled in the settings.
7 *
8 * @package GutSliderBlocks
9 */
10
11 // If uninstall not called from WordPress, then exit.
12 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
13 exit;
14 }
15
16 $gutslider_settings = get_option( 'gutslider_settings', array() );
17 $gutslider_remove_data = is_array( $gutslider_settings ) && ! empty( $gutslider_settings['remove_data'] );
18
19 // Load the main plugin file to access the cleanup method.
20 require_once plugin_dir_path( __FILE__ ) . 'slider-blocks.php';
21
22 // Remove generated stylesheets.
23 GutSlider\Plugin::cleanup();
24
25 if ( ! $gutslider_remove_data ) {
26 return;
27 }
28
29 // Remove the plugin's own options.
30 $gutslider_options = array(
31 'gutslider_settings',
32 'gutslider_blocks',
33 'gutslider_blocks_version',
34 'gutsliderblocks_do_activation_redirect',
35 );
36
37 $gutslider_blocks_file = plugin_dir_path( __FILE__ ) . 'includes/Api/blocks.php';
38
39 if ( file_exists( $gutslider_blocks_file ) ) {
40 $gutslider_block_list = include $gutslider_blocks_file;
41
42 if ( is_array( $gutslider_block_list ) ) {
43 foreach ( $gutslider_block_list as $gutslider_block ) {
44 if ( isset( $gutslider_block['name'] ) ) {
45 $gutslider_options[] = 'gut_' . str_replace( '-', '_', $gutslider_block['name'] );
46 }
47 }
48 }
49 }
50
51 foreach ( array_unique( $gutslider_options ) as $gutslider_option ) {
52 delete_option( $gutslider_option );
53 }
54