From 41a9bd4be4a3018d91dd93829f838198a6d9d029 Mon Sep 17 00:00:00 2001 From: nikitasinelnikov Date: Mon, 10 Jun 2019 15:31:37 +0300 Subject: [PATCH] - fixed loop in profile tabs init; - fixed order by display name; --- includes/class-config.php | 4 ++++ includes/core/class-external-integrations.php | 7 ------- includes/core/um-filters-members.php | 19 ++----------------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/includes/class-config.php b/includes/class-config.php index 4e54eef5..3b2be7e9 100644 --- a/includes/class-config.php +++ b/includes/class-config.php @@ -1,8 +1,10 @@ '2.0' ); + add_filter( 'um_get_tabs_from_config', '__return_true' ); + $tabs = UM()->profile()->tabs_primary(); foreach ( $tabs as $id => $tab ) { $this->settings_defaults['profile_tab_' . $id] = 1; diff --git a/includes/core/class-external-integrations.php b/includes/core/class-external-integrations.php index 77483fcc..1cca0896 100644 --- a/includes/core/class-external-integrations.php +++ b/includes/core/class-external-integrations.php @@ -286,13 +286,6 @@ if ( ! class_exists( 'um\core\External_Integrations' ) ) { if ( function_exists( 'icl_get_current_language' ) && icl_get_current_language() != icl_get_default_language() ) { $url = $this->get_url_for_language( UM()->config()->permalinks[ $slug ], icl_get_current_language() ); - /*if ( get_post_meta( get_the_ID(), '_um_wpml_account', true ) == 1 ) { - $url = get_permalink( get_the_ID() ); - } - if ( get_post_meta( get_the_ID(), '_um_wpml_user', true ) == 1 ) { - $url = $this->get_url_for_language( UM()->config()->permalinks[ $slug ], icl_get_current_language() ); - }*/ - if ( $updated ) { $url = add_query_arg( 'updated', esc_attr( $updated ), $url ); } diff --git a/includes/core/um-filters-members.php b/includes/core/um-filters-members.php index ac2f58ec..9f0f2717 100644 --- a/includes/core/um-filters-members.php +++ b/includes/core/um-filters-members.php @@ -378,7 +378,7 @@ function um_prepare_user_query_args( $query_args, $args ) { } elseif ( 'display_name' == $sortby ) { - /*$display_name = UM()->options()->get( 'display_name' ); + $display_name = UM()->options()->get( 'display_name' ); if ( $display_name == 'username' ) { $query_args['orderby'] = 'user_login'; $order = 'ASC'; @@ -397,22 +397,7 @@ function um_prepare_user_query_args( $query_args, $args ) { $query_args['orderby'] = 'full_name, display_name'; $order = 'ASC'; - }*/ - - $query_args['meta_query'][] = array( - 'relation' => 'OR', - 'full_name' => array( - 'key' => 'full_name', - 'compare' => 'EXISTS' - ), - array( - 'key' => 'full_name', - 'compare' => 'NOT EXISTS' - ) - ); - - $query_args['orderby'] = 'full_name, display_name'; - $order = 'ASC'; + } } elseif ( in_array( $sortby, array( 'last_name', 'first_name' ) ) ) {