From 31de1e49ce4abdc63fc5f6ce8cf0dc1d38d6ab87 Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Mon, 4 Sep 2017 16:52:42 +0300 Subject: [PATCH] - changed checkboxes to dropdowns at top label metaboxes; --- .../admin/templates/form/login_customize.php | 16 ++++++-- .../templates/form/profile_customize.php | 40 ++++++++++++++----- includes/core/class-user.php | 2 +- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/includes/admin/templates/form/login_customize.php b/includes/admin/templates/form/login_customize.php index 75c3bee6..85a17556 100644 --- a/includes/admin/templates/form/login_customize.php +++ b/includes/admin/templates/form/login_customize.php @@ -72,17 +72,25 @@ ), array( 'id' => '_um_login_forgot_pass_link', - 'type' => 'checkbox', + 'type' => 'select', 'label' => __( 'Show Forgot Password Link?', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_login_forgot_pass_link', null, um_get_option('login_forgot_pass_link') ), - 'conditional' => array( '_um_login_use_custom_settings', '=', 1 ) + 'conditional' => array( '_um_login_use_custom_settings', '=', 1 ), + 'options' => array( + 0 => __( 'No', 'ultimate-member' ), + 1 => __( 'Yes', 'ultimate-member' ), + ), ), array( 'id' => '_um_login_show_rememberme', - 'type' => 'checkbox', + 'type' => 'select', 'label' => __( 'Show "Remember Me"?', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_login_show_rememberme', null, um_get_option('login_show_rememberme') ), - 'conditional' => array( '_um_login_use_custom_settings', '=', 1 ) + 'conditional' => array( '_um_login_use_custom_settings', '=', 1 ), + 'options' => array( + 0 => __( 'No', 'ultimate-member' ), + 1 => __( 'Yes', 'ultimate-member' ), + ), ), ) ) )->render_form(); ?> diff --git a/includes/admin/templates/form/profile_customize.php b/includes/admin/templates/form/profile_customize.php index f445a28f..b0246061 100644 --- a/includes/admin/templates/form/profile_customize.php +++ b/includes/admin/templates/form/profile_customize.php @@ -96,10 +96,14 @@ ), array( 'id' => '_um_profile_cover_enabled', - 'type' => 'checkbox', + 'type' => 'select', 'label' => __( 'Enable Cover Photos', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_profile_cover_enabled', null, 1 ), - 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ) + 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ), + 'options' => array( + 0 => __( 'No', 'ultimate-member' ), + 1 => __( 'Yes', 'ultimate-member' ), + ), ), array( 'id' => '_um_profile_cover_ratio', @@ -124,32 +128,48 @@ ), array( 'id' => '_um_profile_photo_required', - 'type' => 'checkbox', + 'type' => 'select', 'label' => __( 'Make Profile Photo Required', 'ultimate-member' ), 'tooltip' => __( 'Require user to update a profile photo when updating their profile', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_profile_photo_required' ), - 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ) + 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ), + 'options' => array( + 0 => __( 'No', 'ultimate-member' ), + 1 => __( 'Yes', 'ultimate-member' ), + ), ), array( 'id' => '_um_profile_show_name', - 'type' => 'checkbox', + 'type' => 'select', 'label' => __( 'Show display name in profile header?', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_profile_show_name', null, 1 ), - 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ) + 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ), + 'options' => array( + 0 => __( 'No', 'ultimate-member' ), + 1 => __( 'Yes', 'ultimate-member' ), + ), ), array( 'id' => '_um_profile_show_social_links', - 'type' => 'checkbox', + 'type' => 'select', 'label' => __( 'Show social links in profile header?', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_profile_show_social_links', null, UM()->um_get_option( 'profile_show_social_links' ) ), - 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ) + 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ), + 'options' => array( + 0 => __( 'No', 'ultimate-member' ), + 1 => __( 'Yes', 'ultimate-member' ), + ), ), array( 'id' => '_um_profile_show_bio', - 'type' => 'checkbox', + 'type' => 'select', 'label' => __( 'Show user description in profile header?', 'ultimate-member' ), 'value' => UM()->query()->get_meta_value( '_um_profile_show_bio', null, 1 ), - 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ) + 'conditional' => array( '_um_profile_use_custom_settings', '=', 1 ), + 'options' => array( + 0 => __( 'No', 'ultimate-member' ), + 1 => __( 'Yes', 'ultimate-member' ), + ), ), ) diff --git a/includes/core/class-user.php b/includes/core/class-user.php index 92a8d54d..53f973d3 100644 --- a/includes/core/class-user.php +++ b/includes/core/class-user.php @@ -606,7 +606,7 @@ if ( ! class_exists( 'User' ) ) { function set_last_login() { update_user_meta( $this->id, '_um_last_login', current_time( 'timestamp' ) ); } - + /*** *** @Set user's account status