- fixed loop in profile tabs init;

- fixed order by display name;
This commit is contained in:
nikitasinelnikov
2019-06-10 15:31:37 +03:00
parent 572f47033f
commit 41a9bd4be4
3 changed files with 6 additions and 24 deletions
+4
View File
@@ -1,8 +1,10 @@
<?php
namespace um;
if ( ! defined( 'ABSPATH' ) ) exit;
if ( ! class_exists( 'um\Config' ) ) {
@@ -539,6 +541,8 @@ if ( ! class_exists( 'um\Config' ) ) {
'rest_api_version' => '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;
@@ -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 );
}
+2 -17
View File
@@ -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' ) ) ) {