From 3383c69e2d644cbb0b5d87a9dda5588194bee9a0 Mon Sep 17 00:00:00 2001 From: nikitasinelnikov Date: Fri, 7 Dec 2018 15:07:50 +0200 Subject: [PATCH] - code formatting; --- includes/admin/core/class-admin-settings.php | 74 ++++++++++---------- includes/core/class-profile.php | 8 +-- includes/core/class-user.php | 1 - 3 files changed, 42 insertions(+), 41 deletions(-) diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index 3e9a43a5..d4a11a63 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -123,44 +123,43 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { } - $appearances_profile_menu_fields = array( array( - 'id' => 'profile_menu', - 'type' => 'checkbox', - 'label' => __('Enable profile menu','ultimate-member'), + 'id' => 'profile_menu', + 'type' => 'checkbox', + 'label' => __('Enable profile menu','ultimate-member'), ) ); $tabs = UM()->profile()->tabs_primary(); - foreach( $tabs as $id => $tab ) { + foreach ( $tabs as $id => $tab ) { $appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array( array( - 'id' => 'profile_tab_' . $id, - 'type' => 'checkbox', - 'label' => sprintf(__('%s Tab','ultimate-member'), $tab ), - 'conditional' => array( 'profile_menu', '=', 1 ), + 'id' => 'profile_tab_' . $id, + 'type' => 'checkbox', + 'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab ), + 'conditional' => array( 'profile_menu', '=', 1 ), ), array( - 'id' => 'profile_tab_' . $id . '_privacy', - 'type' => 'select', - 'label' => sprintf( __( 'Who can see %s Tab?','ultimate-member' ), $tab ), - 'tooltip' => __( 'Select which users can view this tab.','ultimate-member' ), - 'options' => UM()->profile()->tabs_privacy(), - 'conditional' => array( 'profile_tab_' . $id, '=', 1 ), + 'id' => 'profile_tab_' . $id . '_privacy', + 'type' => 'select', + 'label' => sprintf( __( 'Who can see %s Tab?', 'ultimate-member' ), $tab ), + 'tooltip' => __( 'Select which users can view this tab.', 'ultimate-member' ), + 'options' => UM()->profile()->tabs_privacy(), + 'conditional' => array( 'profile_tab_' . $id, '=', 1 ), 'size' => 'small' ), array( - 'id' => 'profile_tab_' . $id . '_roles', - 'type' => 'select', + 'id' => 'profile_tab_' . $id . '_roles', + 'type' => 'select', 'multi' => true, - 'label' => __( 'Allowed roles','ultimate-member' ), - 'tooltip' => __( 'Select the the user roles allowed to view this tab.','ultimate-member' ), - 'options' => UM()->roles()->get_roles(), - 'placeholder' => __( 'Choose user roles...','ultimate-member' ), - 'conditional' => array( 'profile_tab_' . $id . '_privacy', '=', 4 ), + 'label' => __( 'Allowed roles','ultimate-member' ), + 'tooltip' => __( 'Select the the user roles allowed to view this tab.','ultimate-member' ), + 'options' => UM()->roles()->get_roles(), + 'placeholder' => __( 'Choose user roles...','ultimate-member' ), + 'conditional' => array( 'profile_tab_' . $id . '_privacy', '=', 4 ), 'size' => 'small' ) ) ); @@ -168,19 +167,19 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { $appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array( array( - 'id' => 'profile_menu_default_tab', - 'type' => 'select', - 'label' => __( 'Profile menu default tab','ultimate-member' ), - 'tooltip' => __( 'This will be the default tab on user profile page','ultimate-member' ), - 'options' => UM()->profile()->tabs_enabled(), - 'conditional' => array( 'profile_menu', '=', 1 ), + 'id' => 'profile_menu_default_tab', + 'type' => 'select', + 'label' => __( 'Profile menu default tab', 'ultimate-member' ), + 'tooltip' => __( 'This will be the default tab on user profile page', 'ultimate-member' ), + 'options' => UM()->profile()->tabs_enabled(), + 'conditional' => array( 'profile_menu', '=', 1 ), 'size' => 'small' ), array( - 'id' => 'profile_menu_icons', - 'type' => 'checkbox', - 'label' => __('Enable menu icons in desktop view','ultimate-member'), - 'conditional' => array( 'profile_menu', '=', 1 ), + 'id' => 'profile_menu_icons', + 'type' => 'checkbox', + 'label' => __( 'Enable menu icons in desktop view', 'ultimate-member' ), + 'conditional' => array( 'profile_menu', '=', 1 ), ) ) ); @@ -190,15 +189,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { $exclude_taxonomies = UM()->excluded_taxonomies(); foreach ( $all_taxonomies as $key => $taxonomy ) { - if( in_array( $key , $exclude_taxonomies ) ) - unset( $all_taxonomies[$key] ); + if( in_array( $key , $exclude_taxonomies ) ) { + unset( $all_taxonomies[ $key ] ); + } } $restricted_access_post_metabox_value = array(); if ( $restricted_access_post_metabox = UM()->options()->get( 'restricted_access_post_metabox' ) ) { foreach ( $restricted_access_post_metabox as $key => $value ) { - if ( $value ) + if ( $value ) { $restricted_access_post_metabox_value[] = $key; + } } } @@ -206,8 +207,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) { $restricted_access_taxonomy_metabox_value = array(); if ( $restricted_access_taxonomy_metabox = UM()->options()->get( 'restricted_access_taxonomy_metabox' ) ) { foreach ( $restricted_access_taxonomy_metabox as $key => $value ) { - if ( $value ) + if ( $value ) { $restricted_access_taxonomy_metabox_value[] = $key; + } } } diff --git a/includes/core/class-profile.php b/includes/core/class-profile.php index 4ce8f126..3fe9a93b 100644 --- a/includes/core/class-profile.php +++ b/includes/core/class-profile.php @@ -184,14 +184,14 @@ if ( ! class_exists( 'um\core\Profile' ) ) { */ function tabs_enabled() { $tabs = $this->tabs(); - foreach( $tabs as $id => $info ){ + foreach ( $tabs as $id => $info ) { if ( isset( $info['name'] ) ) { - if ( UM()->options()->get('profile_tab_'.$id) || isset( $info['_builtin'] ) ) { - $primary[$id] = $info['name']; + if ( UM()->options()->get( 'profile_tab_' . $id ) || isset( $info['_builtin'] ) ) { + $primary[ $id ] = $info['name']; } } } - return ( isset( $primary ) ) ? $primary : ''; + return isset( $primary ) ? $primary : ''; } diff --git a/includes/core/class-user.php b/includes/core/class-user.php index e7a51c87..7a8c6d98 100644 --- a/includes/core/class-user.php +++ b/includes/core/class-user.php @@ -360,7 +360,6 @@ if ( ! class_exists( 'um\core\User' ) ) { } else { - //$user_in_url = sanitize_title( $user_in_url ); $user_in_url = urlencode( $user_in_url ); }