- remove user role meta for custom roles

This commit is contained in:
andrewshuba
2019-05-16 12:44:02 +03:00
parent 8d8030f70e
commit 035cdb9196
+9 -1
View File
@@ -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' );