diff --git a/includes/core/class-rewrite.php b/includes/core/class-rewrite.php index 998e5de8..547b1279 100644 --- a/includes/core/class-rewrite.php +++ b/includes/core/class-rewrite.php @@ -230,10 +230,15 @@ if ( ! class_exists( 'Rewrite' ) ) { $query = UM()->permalinks()->get_query_array(); $url = um_user_profile_url(); + if ( empty( $url ) ) { + //if empty profile slug - generate it and re-get profile URL + UM()->user()->generate_profile_slug( um_user( 'ID' ) ); + $url = um_user_profile_url(); + } if ( $query ) { foreach ( $query as $key => $val ) { - $url = add_query_arg( $key, $val, $url ); + $url = add_query_arg( $key, $val, $url ); } } diff --git a/includes/um-short-functions.php b/includes/um-short-functions.php index 370b4224..e01cdf5b 100644 --- a/includes/um-short-functions.php +++ b/includes/um-short-functions.php @@ -860,15 +860,15 @@ function um_get_core_page( $slug, $updated = false ) { function um_is_core_page( $page ) { global $post; - if (isset( $post->ID ) && isset( UM()->config()->permalinks[$page] ) && $post->ID == UM()->config()->permalinks[$page]) + if ( isset( $post->ID ) && isset( UM()->config()->permalinks[ $page ] ) && $post->ID == UM()->config()->permalinks[ $page ] ) return true; - if (isset( $post->ID ) && get_post_meta( $post->ID, '_um_wpml_' . $page, true ) == 1) + if ( isset( $post->ID ) && get_post_meta( $post->ID, '_um_wpml_' . $page, true ) == 1 ) return true; if ( UM()->external_integrations()->is_wpml_active() ) { global $sitepress; - if ( UM()->config()->permalinks[$page] == wpml_object_id_filter( $post->ID, 'page', true, $sitepress->get_default_language() ) ) { + if ( UM()->config()->permalinks[ $page ] == wpml_object_id_filter( $post->ID, 'page', true, $sitepress->get_default_language() ) ) { return true; } }