From 035cdb91960e361b10935e3d31bfadd94372758a Mon Sep 17 00:00:00 2001 From: andrewshuba Date: Thu, 16 May 2019 12:44:02 +0300 Subject: [PATCH] - remove user role meta for custom roles --- uninstall.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/uninstall.php b/uninstall.php index f6bef013..1c3994d4 100644 --- a/uninstall.php +++ b/uninstall.php @@ -30,7 +30,7 @@ if ( ! empty( $delete_options ) ) { //remove uploads $upl_folder = UM()->files()->upload_basedir; UM()->files()->remove_dir( $upl_folder ); - + //remove core pages foreach ( UM()->config()->core_pages as $page_key => $page_value ) { $page_id = UM()->options()->get( UM()->options()->get_core_page_id( $page_key ) ); @@ -60,6 +60,14 @@ if ( ! empty( $delete_options ) ) { wp_delete_post( $um_post->ID, 1 ); } + //remove user role meta + $role_keys = get_option( 'um_roles' ); + if ( $role_keys ) { + foreach ( $role_keys as $role_key ) { + delete_option( 'um_role_' . $role_key . '_meta' ); + } + } + delete_option( 'um_first_activation_date' ); delete_option( 'um_role_subscriber_meta' ); delete_option( 'um_role_author_meta' );