diff --git a/includes/core/class-member-directory.php b/includes/core/class-member-directory.php index b6c50a2a..d3caa5bc 100644 --- a/includes/core/class-member-directory.php +++ b/includes/core/class-member-directory.php @@ -1935,7 +1935,7 @@ if ( ! class_exists( 'um\core\Member_Directory' ) ) { break; case 'role': - $value = explode( '||', $value ); + $value = is_array( $value ) ? $value : explode( '||', $value ); $value = array_map( 'strtolower', $value ); if ( ! empty( $this->query_args['role__in'] ) ) { diff --git a/includes/core/um-actions-account.php b/includes/core/um-actions-account.php index 3db952b4..f006bdc7 100644 --- a/includes/core/um-actions-account.php +++ b/includes/core/um-actions-account.php @@ -496,36 +496,54 @@ function um_after_account_privacy( $args ) {
- get_results( "SELECT ID FROM $wpdb->posts WHERE post_author = $user_id AND post_type = 'user_request' AND post_name = 'export_personal_data' AND post_status = 'request-completed' ORDER BY ID DESC LIMIT 1", ARRAY_A ); - if ( $completed ) { + get_row( + "SELECT ID + FROM $wpdb->posts + WHERE post_author = $user_id AND + post_type = 'user_request' AND + post_name = 'export_personal_data' AND + post_status = 'request-completed' + ORDER BY ID DESC + LIMIT 1", + ARRAY_A ); - echo '

' . esc_html__( 'You could download your previous data:', 'ultimate-member' ) . '

'; - echo '' . esc_html__( 'download personal data', 'ultimate-member' ) . ''; - echo '

' . esc_html__( 'You could send a new request for an export of personal your data.', 'ultimate-member' ) . '

'; + if ( ! empty( $completed ) ) { - } + echo '

' . esc_html__( 'You could download your previous data:', 'ultimate-member' ) . '

'; + echo '' . esc_html__( 'download personal data', 'ultimate-member' ) . ''; + echo '

' . esc_html__( 'You could send a new request for an export of personal your data.', 'ultimate-member' ) . '

'; - $pending = $wpdb->get_results( "SELECT ID, post_status FROM $wpdb->posts WHERE post_author = $user_id AND post_type = 'user_request' AND post_name = 'export_personal_data' AND post_status != 'request-completed' ORDER BY ID DESC LIMIT 1", ARRAY_A ); + } - if ( ! empty( $pending ) && isset( $pending[0] ) && $pending[0]['post_status'] == 'request-pending' ) { - echo '

' . esc_html__( 'A confirmation email has been sent to your email. Click the link within the email to confirm your export request.', 'ultimate-member' ) . '

'; - } elseif ( ! empty( $pending ) && isset( $pending[0] ) && $pending[0]['post_status'] == 'request-confirmed' ) { - echo '

' . esc_html__( 'The administrator has not yet approved downloading the data. Please expect an email with a link to your data.', 'ultimate-member' ) . '

'; - } else { ?> - -
- -
- -
-
+ $pending = $wpdb->get_row( + "SELECT ID, post_status + FROM $wpdb->posts + WHERE post_author = $user_id AND + post_type = 'user_request' AND + post_name = 'export_personal_data' AND + post_status != 'request-completed' + ORDER BY ID DESC + LIMIT 1", + ARRAY_A ); + + if ( ! empty( $pending ) && $pending['post_status'] == 'request-pending' ) { + echo '

' . esc_html__( 'A confirmation email has been sent to your email. Click the link within the email to confirm your export request.', 'ultimate-member' ) . '

'; + } elseif ( ! empty( $pending ) && $pending['post_status'] == 'request-confirmed' ) { + echo '

' . esc_html__( 'The administrator has not yet approved downloading the data. Please expect an email with a link to your data.', 'ultimate-member' ) . '

'; + } else { ?> + +
+ +
+
- - - +
+
+ + +
@@ -540,34 +558,53 @@ function um_after_account_privacy( $args ) {
- get_results( "SELECT ID FROM $wpdb->posts WHERE post_author = $user_id AND post_type = 'user_request' AND post_name = 'remove_personal_data' AND post_status = 'request-completed' ORDER BY ID DESC LIMIT 1", ARRAY_A ); - if ( $completed ) { - echo '

' . esc_html__( 'Your personal data has been deleted.', 'ultimate-member' ) . '

'; - echo '

' . esc_html__( 'You could send a new request for deleting your personal data.', 'ultimate-member' ) . '

'; + get_row( + "SELECT ID + FROM $wpdb->posts + WHERE post_author = $user_id AND + post_type = 'user_request' AND + post_name = 'remove_personal_data' AND + post_status = 'request-completed' + ORDER BY ID DESC + LIMIT 1", + ARRAY_A ); - } + if ( ! empty( $completed ) ) { - $pending = $wpdb->get_results( "SELECT ID, post_status FROM $wpdb->posts WHERE post_author = $user_id AND post_type = 'user_request' AND post_name = 'remove_personal_data' AND post_status != 'request-completed' ORDER BY ID DESC LIMIT 1", ARRAY_A ); + echo '

' . esc_html__( 'Your personal data has been deleted.', 'ultimate-member' ) . '

'; + echo '

' . esc_html__( 'You could send a new request for deleting your personal data.', 'ultimate-member' ) . '

'; - if ( ! empty( $pending ) && $pending[0]['post_status'] == 'request-pending' ) { - echo '

' . esc_html__( 'A confirmation email has been sent to your email. Click the link within the email to confirm your export request.', 'ultimate-member' ) . '

'; - } elseif ( ! empty( $pending ) && $pending[0]['post_status'] == 'request-confirmed' ) { - echo '

' . esc_html__( 'The administrator has not yet approved deleting your data. Please expect an email with a link to your data.', 'ultimate-member' ) . '

'; - } else { ?> - - - - - + } + + $pending = $wpdb->get_row( + "SELECT ID, post_status + FROM $wpdb->posts + WHERE post_author = $user_id AND + post_type = 'user_request' AND + post_name = 'remove_personal_data' AND + post_status != 'request-completed' + ORDER BY ID DESC + LIMIT 1", + ARRAY_A ); + + if ( ! empty( $pending ) && $pending['post_status'] == 'request-pending' ) { + echo '

' . esc_html__( 'A confirmation email has been sent to your email. Click the link within the email to confirm your export request.', 'ultimate-member' ) . '

'; + } elseif ( ! empty( $pending ) && $pending['post_status'] == 'request-confirmed' ) { + echo '

' . esc_html__( 'The administrator has not yet approved deleting your data. Please expect an email with a link to your data.', 'ultimate-member' ) . '

'; + } else { ?> + + + + + diff --git a/includes/core/um-actions-profile.php b/includes/core/um-actions-profile.php index 51ec0a61..5cc98b5b 100644 --- a/includes/core/um-actions-profile.php +++ b/includes/core/um-actions-profile.php @@ -606,7 +606,7 @@ function um_profile_dynamic_meta_desc() { - +