PluginProbe
Custom Permalinks / trunk
Custom Permalinks vtrunk
trunk 0.1 0.1.1 0.2 0.2.1 0.2.2 0.3 0.3.1 0.4 0.4.1 0.5 0.5.1 0.5.2 0.5.3 0.6 0.6.1 0.7 0.7.1 0.7.10 0.7.11 0.7.12 0.7.13 0.7.14 0.7.15 0.7.16 All 104 releases
custom-permalinks / uninstall.php

uninstall.php in Custom Permalinks trunk, at uninstall.php

37 lines 970 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * CustomPermalinks Uninstall
4 *
5 * Deletes Option and Post Permalinks on uninstalling the Plugin.
6 *
7 * @package CustomPermalinks
8 * @since 1.2.18
9 */
10
11 if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
12 exit;
13 }
14
15 delete_post_meta_by_key( 'custom_permalink' );
16 delete_option( 'custom_permalink_table' );
17 delete_option( 'custom_permalinks_post_types_settings' );
18
19 $wp_role = get_role( 'administrator' );
20 if ( ! empty( $wp_role ) ) {
21 $wp_role->remove_cap( 'cp_view_post_permalinks' );
22 $wp_role->remove_cap( 'cp_view_category_permalinks' );
23 $wp_role->remove_cap( 'custom_permalinks_post_settings' );
24 }
25
26 $wp_role = get_role( 'custom_permalinks_manager' );
27 if ( ! empty( $wp_role ) ) {
28 $wp_role->remove_cap( 'cp_view_post_permalinks' );
29 $wp_role->remove_cap( 'cp_view_category_permalinks' );
30 $wp_role->remove_cap( 'custom_permalinks_post_settings' );
31
32 remove_role( 'custom_permalinks_manager' );
33 }
34
35 // Clear any cached data that has been removed.
36 wp_cache_flush();
37