PluginProbe
Audio Player Block – Play Audio Beautifully on Any Page / trunk
Audio Player Block – Play Audio Beautifully on Any Page vtrunk
1.6.2 1.6.1 1.6.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 All 37 releases
audio-player-block / uninstall.php

uninstall.php in Audio Player Block – Play Audio Beautifully on Any Page trunk, at uninstall.php

33 lines 936 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Audio Player Block – Advanced Block for Embedding Audio Files Uninstall
4 *
5 * This file is called when the plugin is deleted from the WordPress admin dashboard.
6 * It cleans up all the data stored by the plugin in the database.
7 */
8
9 // If uninstall not called from WordPress, exit.
10 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
11 exit;
12 }
13
14 // Only delete data if user has enabled this setting
15 if ( get_option( 'bpmp_delete_data_on_uninstall', false ) ) {
16 // Delete all audio_player_block custom posts
17 $audio_player_posts = get_posts( array(
18 'post_type' => 'audio_player_block',
19 'numberposts' => -1,
20 'post_status' => 'any',
21 'fields' => 'ids',
22 ) );
23
24 if ( ! empty( $audio_player_posts ) ) {
25 foreach ( $audio_player_posts as $post_id ) {
26 wp_delete_post( $post_id, true ); // Force delete (bypasses trash)
27 }
28 }
29
30 // Delete the uninstall option itself
31 delete_option( 'bpmp_delete_data_on_uninstall' );
32 }
33