' . $data['description'] . '
';
+ }
$html .= '';
@@ -233,8 +235,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
}
- if ( ! empty( $data['description'] ) )
+ if ( ! empty( $data['description'] ) ) {
$html .= '' . $data['description'] . '
';
+ }
$html .= '';
@@ -255,8 +258,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
}
- if ( ! empty( $data['description'] ) )
+ if ( ! empty( $data['description'] ) ) {
$html .= '' . $data['description'] . '
';
+ }
$html .= '';
@@ -276,15 +280,14 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
}
- if ( ! empty( $data['description'] ) )
+ if ( ! empty( $data['description'] ) ) {
$html .= '' . $data['description'] . '
';
+ }
$html .= '';
-
}
}
}
-
} else {
$html .= $this->render_hidden( $data );
}
@@ -927,10 +930,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
*
* @return bool|string
*/
- function render_checkbox( $field_data ) {
+ public function render_checkbox( $field_data ) {
- if ( empty( $field_data['id'] ) )
+ if ( empty( $field_data['id'] ) ) {
return false;
+ }
$id = ( ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] : '' ) . '_' . $field_data['id'];
$id_attr = ' id="' . esc_attr( $id ) . '" ';
@@ -941,7 +945,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$class_attr = ' class="um-forms-field ' . esc_attr( $class ) . '" ';
$data = array(
- 'field_id' => $field_data['id']
+ 'field_id' => $field_data['id'],
);
if ( ! empty( $field_data['data'] ) ) {
@@ -959,20 +963,22 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
$value = $this->get_field_value( $field_data );
- $html = "' . $field_data['upgrade_description'] . '
@@ -1020,7 +1031,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
return $html;
}
-
/**
* @param $field_data
*
@@ -1083,6 +1093,79 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
return $html;
}
+ /**
+ * @param $field_data
+ *
+ * @since 2.8.3
+ *
+ * @return bool|string
+ */
+ public function render_page_select( $field_data ) {
+ if ( empty( $field_data['id'] ) ) {
+ return false;
+ }
+
+ $multiple = ! empty( $field_data['multi'] ) ? 'multiple' : '';
+
+ $id = ( ! empty( $this->form_data['prefix_id'] ) ? sanitize_title( $this->form_data['prefix_id'] ) : '' ) . '_' . $field_data['id'];
+ $id_attr = ' id="' . esc_attr( $id ) . '" ';
+
+ $class = ! empty( $field_data['class'] ) ? $field_data['class'] . ' ' : ' ';
+ $class .= ! empty( $field_data['size'] ) ? 'um-' . $field_data['size'] . '-field' : 'um-long-field';
+ $class_attr = ' class="um-forms-field um-pages-select2 ' . esc_attr( $class ) . '" ';
+
+ $data = array(
+ 'field_id' => $field_data['id'],
+ );
+
+ if ( ! empty( $field_data['placeholder'] ) ) {
+ $data['placeholder'] = $field_data['placeholder'];
+ }
+
+ $data_attr = '';
+ foreach ( $data as $key => $value ) {
+ $data_attr .= ' data-' . $key . '="' . esc_attr( $value ) . '" ';
+ }
+
+ $name = $field_data['id'];
+ $name = ! empty( $this->form_data['prefix_id'] ) ? $this->form_data['prefix_id'] . '[' . $name . ']' : $name;
+ $hidden_name_attr = ' name="' . $name . '" ';
+ $name = $name . ( ! empty( $field_data['multi'] ) ? '[]' : '' );
+ $name_attr = ' name="' . $name . '" ';
+
+ $value = $this->get_field_value( $field_data );
+
+ $options = '
' . esc_html( $data['placeholder'] ) . ' ';
+ if ( ! empty( $field_data['options'] ) ) {
+ foreach ( $field_data['options'] as $key => $option ) {
+ if ( ! empty( $field_data['multi'] ) ) {
+
+ if ( ! is_array( $value ) || empty( $value ) ) {
+ $value = array();
+ }
+
+ $options .= '
' . esc_html( $option ) . ' ';
+ } else {
+ $options .= '
' . esc_html( $option ) . ' ';
+ }
+ }
+ }
+
+ $hidden = '';
+ if ( ! empty( $multiple ) ) {
+ $hidden = "
";
+ }
+
+ $button = '';
+ $slug = str_replace( 'core_', '', $field_data['id'] );
+ if ( ! um_get_predefined_page_id( $slug ) || 'publish' !== get_post_status( um_get_predefined_page_id( $slug ) ) ) {
+ $button = '
' . esc_html__( 'Create Default', 'ultimate-member' ) . ' ';
+ }
+
+ $html = "$hidden
$options $button";
+
+ return $html;
+ }
/**
* @param $field_data
@@ -1739,7 +1822,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
return $html;
}
-
/**
* Get field value
*
@@ -1770,5 +1852,24 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) {
return $value;
}
+
+ public function render_external_link( $data ) {
+ $defaults = array(
+ 'url' => '',
+ 'html' => '',
+ );
+ $data = wp_parse_args( $data, $defaults );
+ if ( empty( $data['url'] ) || empty( $data['html'] ) ) {
+ return '';
+ }
+ ob_start();
+ ?>
+
+
+
+
+ admin_settings()->settings_structure[ $current_tab ];
+
+ // Remove not option hidden fields.
+ if ( ! empty( $settings_struct['fields'] ) ) {
+ foreach ( $settings_struct['fields'] as $field_key => $field_options ) {
+ if ( isset( $field_options['is_option'] ) && false === $field_options['is_option'] ) {
+ unset( $settings_struct['fields'][ $field_key ] );
+ }
+ }
+ }
+
+ if ( empty( $settings_struct['fields'] ) && empty( $settings_struct['sections'] ) && empty( $settings_struct['form_sections'] ) ) {
+ wp_safe_redirect( add_query_arg( array( 'page' => 'um_options' ), admin_url( 'admin.php' ) ) );
+ exit;
+ }
+
+ if ( ! empty( $settings_struct['sections'] ) ) {
+ if ( empty( $settings_struct['sections'][ $current_subtab ] ) ) {
+ $args = array( 'page' => 'um_options' );
+ if ( ! empty( $current_tab ) ) {
+ $args['tab'] = $current_tab;
+ }
+ wp_safe_redirect( add_query_arg( $args, admin_url( 'admin.php' ) ) );
+ exit;
+ }
+ }
+ }
/**
* Change the admin footer text on UM admin pages
@@ -143,8 +179,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
/**
* Setup admin menu
*/
- function primary_admin_menu() {
- $this->pagehook = add_menu_page( __( 'Ultimate Member', 'ultimate-member' ), __( 'Ultimate Member', 'ultimate-member' ), 'manage_options', $this->slug, array( &$this, 'admin_page' ), 'dashicons-admin-users', '42.78578');
+ public function primary_admin_menu() {
+ $this->pagehook = add_menu_page( __( 'Ultimate Member', 'ultimate-member' ), __( 'Ultimate Member', 'ultimate-member' ), 'manage_options', $this->slug, array( &$this, 'admin_page' ), 'dashicons-admin-users', '42.78578' );
add_action( 'load-' . $this->pagehook, array( &$this, 'on_load_page' ) );
@@ -155,7 +191,9 @@ if ( ! class_exists( 'um\admin\core\Admin_Menu' ) ) {
/**
* Secondary admin menu (after settings)
*/
- function secondary_menu_items() {
+ public function secondary_menu_items() {
+ add_submenu_page( $this->slug, __( 'Settings', 'ultimate-member' ), __( 'Settings', 'ultimate-member' ), 'manage_options', 'um_options', array( UM()->admin_settings(), 'settings_page' ) );
+
add_submenu_page( $this->slug, __( 'Forms', 'ultimate-member' ), __( 'Forms', 'ultimate-member' ), 'manage_options', 'edit.php?post_type=um_form', '' );
add_submenu_page( $this->slug, __( 'User Roles', 'ultimate-member' ), __( 'User Roles', 'ultimate-member' ), 'manage_options', 'um_roles', array( &$this, 'um_roles_pages' ) );
diff --git a/includes/admin/core/class-admin-metabox.php b/includes/admin/core/class-admin-metabox.php
index 96546ada..9327ff6d 100644
--- a/includes/admin/core/class-admin-metabox.php
+++ b/includes/admin/core/class-admin-metabox.php
@@ -1021,7 +1021,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
public function add_metabox_form() {
add_meta_box( 'submitdiv', __( 'Publish', 'ultimate-member' ), array( $this, 'custom_submitdiv' ), 'um_form', 'side', 'high' );
- if ( defined( 'UM_LEGACY_BUILDER_OFF' ) && UM_LEGACY_BUILDER_OFF ) {
+ if ( defined( 'UM_DEV_MODE' ) && UM_DEV_MODE && UM()->options()->get( 'enable_new_form_builder' ) ) {
// Do new metabox.
} else {
add_meta_box( 'um-admin-form-mode', __( 'Select Form Type', 'ultimate-member' ), array( &$this, 'load_metabox_form' ), 'um_form', 'normal', 'default' );
@@ -1494,7 +1494,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Metabox' ) ) {
break;
case '_validate':
- if ( array_key_exists( 'mode', $form_data ) && 'login' === $form_data['mode'] && in_array( $field_args['metakey'], array( 'username', 'user_login', 'user_email' ), true ) ) {
+ if ( array_key_exists( 'mode', $form_data ) && 'login' === $form_data['mode'] && array_key_exists( 'metakey', $field_args ) && in_array( $field_args['metakey'], array( 'username', 'user_login', 'user_email' ), true ) ) {
return;
}
?>
diff --git a/includes/admin/core/class-admin-notices.php b/includes/admin/core/class-admin-notices.php
index dde627d1..8ea72173 100644
--- a/includes/admin/core/class-admin-notices.php
+++ b/includes/admin/core/class-admin-notices.php
@@ -31,8 +31,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
add_action( 'wp_ajax_um_dismiss_notice', array( &$this, 'dismiss_notice' ) );
add_action( 'admin_init', array( &$this, 'force_dismiss_notice' ) );
-
- add_action( 'current_screen', array( &$this, 'create_list_for_screen' ) );
}
/**
@@ -51,8 +49,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
$this->extensions_page();
- $this->template_version();
-
$this->child_theme_required();
// Removed for now to avoid the bad reviews.
@@ -82,13 +78,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
do_action( 'um_admin_create_notices' );
}
- public function create_list_for_screen() {
- if ( UM()->admin()->screen()->is_own_screen() ) {
- $this->secure_settings();
- }
- }
-
-
/**
* @return array
*/
@@ -587,9 +576,8 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
}
}
-
- function check_wrong_licenses() {
- $invalid_license = 0;
+ public function check_wrong_licenses() {
+ $invalid_license = 0;
$arr_inactive_license_keys = array();
if ( empty( UM()->admin_settings()->settings_structure['licenses']['fields'] ) ) {
@@ -599,10 +587,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
foreach ( UM()->admin_settings()->settings_structure['licenses']['fields'] as $field_data ) {
$license = get_option( "{$field_data['id']}_edd_answer" );
- if ( ( is_object( $license ) && 'valid' == $license->license ) || 'valid' == $license )
+ if ( ( is_object( $license ) && isset( $license->license ) && 'valid' === $license->license ) || 'valid' === $license ) {
continue;
+ }
- if ( ( is_object( $license ) && 'inactive' == $license->license ) || 'inactive' == $license ) {
+ if ( ( is_object( $license ) && isset( $license->license ) && 'inactive' === $license->license ) || 'inactive' === $license ) {
$arr_inactive_license_keys[] = $license->item_name;
}
@@ -614,7 +603,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
'license_key',
array(
'class' => 'error',
- // translators: %1$s is a inactive license number; %2$s is a plugin name; %3$s is a store link.
+ // translators: %1$s is an inactive license number; %2$s is a plugin name; %3$s is a store link.
'message' => '
' . sprintf( __( 'There are %1$s inactive %2$s license keys for this site. This site is not authorized to get plugin updates. You can active this site on www.ultimatemember.com .', 'ultimate-member' ), count( $arr_inactive_license_keys ), UM_PLUGIN_NAME, UM()->store_url ) . '
',
),
3
@@ -622,12 +611,20 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
}
if ( $invalid_license ) {
+ $licenses_page_url = add_query_arg(
+ array(
+ 'page' => 'um_options',
+ 'tab' => 'licenses',
+ ),
+ admin_url( 'admin.php' )
+ );
+
$this->add_notice(
'license_key',
array(
'class' => 'error',
- // translators: %1$s is a invalid license; %2$s is a plugin name; %3$s is a license link.
- 'message' => '
' . sprintf( __( 'You have %1$s invalid or expired license keys for %2$s. Please go to the Licenses page to correct this issue.', 'ultimate-member' ), $invalid_license, UM_PLUGIN_NAME, add_query_arg( array( 'page' => 'um_options', 'tab' => 'licenses' ), admin_url( 'admin.php' ) ) ) . '
',
+ // translators: %1$s is an invalid license; %2$s is a plugin name; %3$s is a license link.
+ 'message' => '
' . sprintf( __( 'You have %1$s invalid or expired license keys for %2$s. Please go to the Licenses page to correct this issue.', 'ultimate-member' ), $invalid_license, UM_PLUGIN_NAME, $licenses_page_url ) . '
',
),
3
);
@@ -775,36 +772,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
), 2 );
}
- /**
- * Check Templates Versions notice
- */
- public function template_version() {
- if ( true === (bool) get_option( 'um_override_templates_outdated' ) ) {
- $link = admin_url( 'admin.php?page=um_options&tab=override_templates' );
- ob_start();
- ?>
-
-
- override templates status page and update templates.', 'ultimate-member' ), $link ), UM()->get_allowed_html( 'admin_notice' ) );
- ?>
-
-
- admin()->notices()->add_notice(
- 'um_override_templates_notice',
- array(
- 'class' => 'error',
- 'message' => $message,
- 'dismissible' => false,
- ),
- 10
- );
- }
- }
-
/**
* Check if there isn't installed child-theme. Child theme is required for safely saved customizations.
*/
@@ -820,7 +787,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
child-theme for Ultimate Member customization, which hasn\'t dependencies with the official themes repo, so your custom files cannot be rewritten after a theme upgrade. Otherwise, the customization files may be deleted after every theme upgrade.', 'ultimate-member' ), 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ), UM()->get_allowed_html( 'admin_notice' ) );
+ echo wp_kses( sprintf( __( 'We recommend using a child-theme for Ultimate Member customization. Unlike official theme repositories, child themes don\'t have dependencies that could lead to your custom files being overwritten during a theme upgrade. Without a child theme, your customization files may be deleted after every theme update.', 'ultimate-member' ), 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ), UM()->get_allowed_html( 'admin_notice' ) );
?>
@@ -838,39 +805,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Notices' ) ) {
}
}
- /**
- * First time installed Secure settings.
- */
- public function secure_settings() {
- ob_start();
- ?>
-
-
-
-
-
-
-
-
- add_notice(
- 'secure_settings',
- array(
- 'class' => 'warning',
- 'message' => $message,
- 'dismissible' => true,
- ),
- 1
- );
- }
-
public function common_secure() {
if ( UM()->options()->get( 'lock_register_forms' ) ) {
ob_start();
?>
- Settings > Secure > Lock All Register Forms.', 'ultimate-member' ); ?>
+ Settings > Advanced > Security > Lock All Register Forms.', 'ultimate-member' ); ?>
- Settings > Secure > Display Login form notice to reset passwords.', 'ultimate-member' ); ?>
+ Settings > Advanced > Security > Display Login form notice to reset passwords.', 'ultimate-member' ); ?>
- Settings > Secure > Enable ban for administrative capabilities.', 'ultimate-member' ); ?>
+ Settings > Advanced > Security > Enable ban for administrative capabilities.', 'ultimate-member' ); ?>
admin()->check_ajax_nonce();
@@ -260,37 +249,136 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
),
);
- $core_pages = UM()->config()->core_pages;
-
- foreach ( $core_pages as $page_s => $page ) {
- $have_pages = UM()->query()->wp_pages();
- $page_id = UM()->options()->get_core_page_id( $page_s );
+// $core_pages = UM()->config()->core_pages;
+//
+// foreach ( $core_pages as $page_s => $page ) {
+// $have_pages = UM()->query()->wp_pages();
+// $page_id = UM()->options()->get_core_page_id( $page_s );
+//
+// $page_title = ! empty( $page['title'] ) ? $page['title'] : '';
+//
+// if ( 'reached_maximum_limit' === $have_pages ) {
+// $general_pages_fields[] = array(
+// 'id' => $page_id,
+// 'type' => 'text',
+// // translators: %s: Page title
+// 'label' => sprintf( __( '%s page', 'ultimate-member' ), $page_title ),
+// 'placeholder' => __( 'Add page ID', 'ultimate-member' ),
+// 'compiler' => true,
+// 'size' => 'small',
+// );
+// } else {
+// $general_pages_fields[] = array(
+// 'id' => $page_id,
+// 'type' => 'select',
+// // translators: %s: Page title
+// 'label' => sprintf( __( '%s page', 'ultimate-member' ), $page_title ),
+// 'options' => UM()->query()->wp_pages(),
+// 'placeholder' => __( 'Choose a page...', 'ultimate-member' ),
+// 'compiler' => true,
+// 'size' => 'small',
+// );
+// }
+//
+// $settings_map[ $page_id ] = array(
+// 'sanitize' => 'absint',
+// );
+// }
+ foreach ( UM()->config()->get( 'predefined_pages' ) as $slug => $page ) {
+ $page_id = UM()->options()->get_predefined_page_option_key( $slug );
$page_title = ! empty( $page['title'] ) ? $page['title'] : '';
- if ( 'reached_maximum_limit' === $have_pages ) {
- $general_pages_fields[] = array(
- 'id' => $page_id,
- 'type' => 'text',
- // translators: %s: Page title
- 'label' => sprintf( __( '%s page', 'ultimate-member' ), $page_title ),
- 'placeholder' => __( 'Add page ID', 'ultimate-member' ),
- 'compiler' => true,
- 'size' => 'small',
- );
+ $options = array();
+ $page_value = '';
+
+ $pre_result = apply_filters( 'um_admin_settings_pages_list_value', false, $page_id );
+ if ( false === $pre_result ) {
+ if ( ! empty( $opt_value = UM()->options()->get( $page_id ) ) ) {
+ if ( 'publish' === get_post_status( $opt_value ) ) {
+ $title = get_the_title( $opt_value );
+ $title = ( mb_strlen( $title ) > 50 ) ? mb_substr( $title, 0, 49 ) . '...' : $title;
+ $title = sprintf( __( '%s (ID: %s)', 'ultimate-member' ), $title, $opt_value );
+
+ $options = array( $opt_value => $title );
+ $page_value = $opt_value;
+ }
+ }
} else {
- $general_pages_fields[] = array(
- 'id' => $page_id,
- 'type' => 'select',
- // translators: %s: Page title
- 'label' => sprintf( __( '%s page', 'ultimate-member' ), $page_title ),
- 'options' => UM()->query()->wp_pages(),
- 'placeholder' => __( 'Choose a page...', 'ultimate-member' ),
- 'compiler' => true,
- 'size' => 'small',
- );
+ // `page_value` variable that we transfer from 3rd-party hook for getting filtered option value also
+ $page_value = $pre_result['page_value'];
+ unset( $pre_result['page_value'] );
+
+ $options = $pre_result;
}
+ $page_setting_description = '';
+ if ( ! empty( $page_value ) ) {
+ $content = get_the_content( null, false, $page_value );
+ switch ( $slug ) {
+ case 'account':
+ if ( $page_value === um_get_predefined_page_id( 'user' ) ) {
+ $page_setting_description = __( '
Warning: Account page and User page must be separate pages.', 'ultimate-member' );
+ } elseif ( ! has_shortcode( $content, 'ultimatemember_account' ) ) {
+ $page_setting_description = __( '
Warning: Account page must contain shortcode
[ultimatemember_account].', 'ultimate-member' );
+ } elseif ( function_exists( 'wc_get_page_id' ) && wc_get_page_id( 'myaccount' ) === um_get_predefined_page_id( 'account' ) ) {
+ $page_setting_description = __( '
Warning: Account page and WooCommerce "My account" page should be separate pages.', 'ultimate-member' );
+ }
+ break;
+ case 'login':
+ if ( $page_value === um_get_predefined_page_id( 'logout' ) ) {
+ $page_setting_description = __( '
Warning: Login page and Logout page must be separate pages.', 'ultimate-member' );
+ } elseif ( ! has_shortcode( $content, 'ultimatemember' ) ) {
+ $page_setting_description = __( '
Warning: Login page must contain a login form shortcode. You can get existing shortcode or create a new one
here .', 'ultimate-member' );
+ }
+ break;
+ case 'logout':
+ if ( $page_value === (int) get_option( 'page_on_front' ) ) {
+ $page_setting_description = __( '
Warning: Home page and Logout page must be separate pages.', 'ultimate-member' );
+ } elseif ( $page_value === um_get_predefined_page_id( 'login' ) ) {
+ $page_setting_description = __( '
Warning: Login page and Logout page must be separate pages.', 'ultimate-member' );
+ }
+ break;
+ case 'password-reset':
+ if ( ! has_shortcode( $content, 'ultimatemember_password' ) ) {
+ $page_setting_description = __( '
Warning: Password Reset page must contain shortcode
[ultimatemember_password].', 'ultimate-member' );
+ }
+ break;
+ case 'register':
+ if ( ! has_shortcode( $content, 'ultimatemember' ) ) {
+ $page_setting_description = __( '
Warning: Register page must contain a registration form shortcode. You can get existing shortcode or create a new one
here .', 'ultimate-member' );
+ }
+ break;
+ case 'user':
+ if ( $page_value === um_get_predefined_page_id( 'account' ) ) {
+ $description = __( '
Warning: Account page and User page must be separate pages.', 'ultimate-member' );
+ } elseif ( ! has_shortcode( $content, 'ultimatemember' ) ) {
+ $page_setting_description = __( '
Warning: User page must contain a profile form shortcode. You can get existing shortcode or create a new one
here .', 'ultimate-member' );
+ }
+ break;
+ case 'members':
+ if ( ! has_shortcode( $content, 'ultimatemember' ) ) {
+ $page_setting_description = __( '
Warning: Members page must contain a profile form shortcode. You can get existing shortcode or create a new one
here .', 'ultimate-member' );
+ }
+ break;
+ default:
+ $page_setting_description = apply_filters( 'um_pages_settings_description', $page_setting_description, $content, $slug );
+ break;
+ }
+ }
+
+ $general_pages_fields[] = array(
+ 'id' => $page_id,
+ 'type' => 'page_select',
+ // translators: %s: Page title
+ 'label' => sprintf( __( '%s page', 'ultimate-member' ), $page_title ),
+ 'options' => $options,
+ 'value' => $page_value,
+ 'placeholder' => __( 'Choose a page...', 'ultimate-member' ),
+ 'size' => 'small',
+ 'description' => $page_setting_description,
+ );
+
$settings_map[ $page_id ] = array(
'sanitize' => 'absint',
);
@@ -298,9 +386,10 @@ 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' => __( 'Profile menu', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable profile menu', 'ultimate-member' ),
),
);
@@ -326,12 +415,14 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
if ( isset( $tab['default_privacy'] ) ) {
$fields = array(
array(
- 'id' => 'profile_tab_' . $id,
- 'type' => 'checkbox',
+ 'id' => 'profile_tab_' . $id,
+ 'type' => 'checkbox',
// translators: %s: Tab title
- 'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab['name'] ),
- 'conditional' => array( 'profile_menu', '=', 1 ),
- 'data' => array( 'fill_profile_menu_default_tab' => $id ),
+ 'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab['name'] ),
+ // translators: %s: Tab title
+ 'checkbox_label' => sprintf( __( 'Enable %s Tab', 'ultimate-member' ), $tab['name'] ),
+ 'conditional' => array( 'profile_menu', '=', 1 ),
+ 'data' => array( 'fill_profile_menu_default_tab' => $id ),
),
);
@@ -342,19 +433,20 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$fields = array(
array(
- 'id' => 'profile_tab_' . $id,
- 'type' => 'checkbox',
+ 'id' => 'profile_tab_' . $id,
+ 'type' => 'checkbox',
// translators: %s: Tab title
- 'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab['name'] ),
- 'conditional' => array( 'profile_menu', '=', 1 ),
- 'data' => array( 'fill_profile_menu_default_tab' => $id ),
+ 'label' => sprintf( __( '%s Tab', 'ultimate-member' ), $tab['name'] ),
+ 'checkbox_label' => sprintf( __( 'Enable %s Tab', 'ultimate-member' ), $tab['name'] ),
+ 'conditional' => array( 'profile_menu', '=', 1 ),
+ 'data' => array( 'fill_profile_menu_default_tab' => $id ),
),
array(
'id' => 'profile_tab_' . $id . '_privacy',
'type' => 'select',
// translators: %s: Tab title
'label' => sprintf( __( 'Who can see %s Tab?', 'ultimate-member' ), $tab['name'] ),
- 'tooltip' => __( 'Select which users can view this tab.', 'ultimate-member' ),
+ 'description' => __( 'Select which users can view this tab.', 'ultimate-member' ),
'options' => UM()->profile()->tabs_privacy(),
'conditional' => array( 'profile_tab_' . $id, '=', 1 ),
'size' => 'small',
@@ -364,7 +456,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'type' => 'select',
'multi' => true,
'label' => __( 'Allowed roles', 'ultimate-member' ),
- 'tooltip' => __( 'Select the the user roles allowed to view this tab.', 'ultimate-member' ),
+ 'description' => __( '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', '=', array( '4', '5' ) ),
@@ -395,7 +487,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'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' ),
+ 'description' => __( 'This will be the default tab on user profile page.', 'ultimate-member' ),
'options' => $tabs_options,
'conditional' => array( implode( '|', $tabs_condition ), '~', 1 ),
'size' => 'small',
@@ -409,11 +501,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$appearances_profile_menu_fields,
array(
array(
- 'id' => 'profile_menu_icons',
- 'type' => 'checkbox',
- 'label' => __( 'Enable menu icons in desktop view', 'ultimate-member' ),
- 'description' => __( '"Desktop view" means the profile block\'s width lower than 800px', 'ultimate-member' ),
- 'conditional' => array( 'profile_menu', '=', 1 ),
+ 'id' => 'profile_menu_icons',
+ 'type' => 'checkbox',
+ 'label' => __( 'Menu icons in desktop view', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable menu icons in desktop view', 'ultimate-member' ),
+ 'description' => __( '"Desktop view" means the profile block\'s width lower than 800px.', 'ultimate-member' ),
+ 'conditional' => array( 'profile_menu', '=', 1 ),
),
)
);
@@ -431,7 +524,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$duplicates = array();
$taxonomies_options = array();
$exclude_taxonomies = UM()->excluded_taxonomies();
- $all_taxonomies = get_taxonomies( array( 'public' => true, 'show_ui' => true ), 'objects' );
+ $all_taxonomies = get_taxonomies(
+ array(
+ 'public' => true,
+ 'show_ui' => true,
+ ),
+ 'objects'
+ );
foreach ( $all_taxonomies as $key => $taxonomy ) {
if ( in_array( $key, $exclude_taxonomies, true ) ) {
continue;
@@ -457,7 +556,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
}
}
-
$restricted_access_taxonomy_metabox_value = array();
$restricted_access_taxonomy_metabox = UM()->options()->get( 'restricted_access_taxonomy_metabox' );
if ( ! empty( $restricted_access_taxonomy_metabox ) && is_array( $restricted_access_taxonomy_metabox ) ) {
@@ -470,62 +568,65 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$access_fields = array(
array(
- 'id' => 'accessible',
- 'type' => 'select',
- 'label' => __( 'Global Site Access', 'ultimate-member' ),
- 'tooltip' => __( 'Globally control the access of your site, you can have separate restrict options per post/page by editing the desired item.', 'ultimate-member' ),
- 'options' => array(
+ 'id' => 'accessible',
+ 'type' => 'select',
+ 'label' => __( 'Global Site Access', 'ultimate-member' ),
+ 'description' => __( 'Globally control the access of your site, you can have separate restrict options per post/page by editing the desired item.', 'ultimate-member' ),
+ 'options' => array(
0 => __( 'Site accessible to Everyone', 'ultimate-member' ),
2 => __( 'Site accessible to Logged In Users', 'ultimate-member' ),
),
- 'size' => 'medium',
+ 'size' => 'medium',
),
array(
- 'id' => 'access_redirect',
+ 'id' => 'a$access_fieldsccess_redirect',
'type' => 'text',
'label' => __( 'Custom Redirect URL', 'ultimate-member' ),
- 'tooltip' => __( 'A logged out user will be redirected to this url If he is not permitted to access the site', 'ultimate-member' ),
+ 'description' => __( 'A logged out user will be redirected to this url If he is not permitted to access the site.', 'ultimate-member' ),
'conditional' => array( 'accessible', '=', 2 ),
),
array(
'id' => 'access_exclude_uris',
'type' => 'multi_text',
'label' => __( 'Exclude the following URLs', 'ultimate-member' ),
- 'tooltip' => __( 'Here you can exclude URLs beside the redirect URI to be accessible to everyone', 'ultimate-member' ),
+ 'description' => __( 'Here you can exclude URLs beside the redirect URI to be accessible to everyone.', 'ultimate-member' ),
'add_text' => __( 'Add New URL', 'ultimate-member' ),
'conditional' => array( 'accessible', '=', 2 ),
'show_default_number' => 0,
),
array(
- 'id' => 'home_page_accessible',
- 'type' => 'checkbox',
- 'label' => __( 'Allow Homepage to be accessible', 'ultimate-member' ),
- 'conditional' => array( 'accessible', '=', 2 ),
+ 'id' => 'home_page_accessible',
+ 'type' => 'checkbox',
+ 'label' => __( 'Allow Homepage to be accessible', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Accessible Homepage', 'ultimate-member' ),
+ 'conditional' => array( 'accessible', '=', 2 ),
),
array(
- 'id' => 'category_page_accessible',
- 'type' => 'checkbox',
- 'label' => __( 'Allow Category pages to be accessible', 'ultimate-member' ),
- 'conditional' => array( 'accessible', '=', 2 ),
+ 'id' => 'category_page_accessible',
+ 'type' => 'checkbox',
+ 'label' => __( 'Allow Category pages to be accessible', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Accessible Category pages', 'ultimate-member' ),
+ 'conditional' => array( 'accessible', '=', 2 ),
),
array(
- 'id' => 'restricted_post_title_replace',
- 'type' => 'checkbox',
- 'label' => __( 'Replace the restricted Post Title', 'ultimate-member' ),
- 'tooltip' => __( 'Allow to replace the restricted post title to users that do not have permission to view the content', 'ultimate-member' ),
+ 'id' => 'restricted_post_title_replace',
+ 'type' => 'checkbox',
+ 'label' => __( 'Restricted Post Title', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Replace the restricted Post Title', 'ultimate-member' ),
+ 'description' => __( 'Allow to replace the restricted post title to users that do not have permission to view the content.', 'ultimate-member' ),
),
array(
'id' => 'restricted_access_post_title',
'type' => 'text',
'label' => __( 'Restricted Access Post Title', 'ultimate-member' ),
- 'tooltip' => __( 'This is the post title shown to users that do not have permission to view the content', 'ultimate-member' ),
+ 'description' => __( 'If enabled, the text entered below will replace the title of the post/page/CPT for users who do not have permission to view the restricted content. Please see this doc for more information on this.', 'ultimate-member' ),
'conditional' => array( 'restricted_post_title_replace', '=', 1 ),
),
array(
- 'id' => 'restricted_access_message',
- 'type' => 'wp_editor',
- 'label' => __( 'Restricted Access Message', 'ultimate-member' ),
- 'tooltip' => __( 'This is the message shown to users that do not have permission to view the content', 'ultimate-member' ),
+ 'id' => 'restricted_access_message',
+ 'type' => 'wp_editor',
+ 'label' => __( 'Restricted Access Message', 'ultimate-member' ),
+ 'description' => __( 'This is the message shown to users that do not have permission to view the content.', 'ultimate-member' ),
),
);
@@ -565,15 +666,17 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$access_fields,
array(
array(
- 'id' => 'restricted_blocks',
- 'type' => 'checkbox',
- 'label' => __( 'Enable the "Content Restriction" settings for the Gutenberg Blocks', 'ultimate-member' ),
+ 'id' => 'restricted_blocks',
+ 'type' => 'checkbox',
+ 'label' => __( 'Restricted Gutenberg Blocks', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable the "Content Restriction" settings for the Gutenberg Blocks', 'ultimate-member' ),
+ 'description' => __( 'If enabled then allows to set the blocks restriction settings in wp-admin.', 'ultimate-member' ),
),
array(
'id' => 'restricted_block_message',
'type' => 'textarea',
'label' => __( 'Restricted Access Block Message', 'ultimate-member' ),
- 'tooltip' => __( 'This is the message shown to users that do not have permission to view the block\'s content', 'ultimate-member' ),
+ 'description' => __( 'This is the message shown to users that do not have permission to view the block\'s content.', 'ultimate-member' ),
'conditional' => array( 'restricted_blocks', '=', 1 ),
),
)
@@ -601,24 +704,24 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'value' => '',
),
array(
- 'id' => 'restricted_access_post_metabox',
- 'type' => 'multi_checkbox',
- 'label' => __( 'Enable the "Content Restriction" settings for post types', 'ultimate-member' ),
- 'tooltip' => __( 'Check post types for which you plan to use the "Content Restriction" settings', 'ultimate-member' ),
- 'options' => $post_types_options,
- 'columns' => 3,
- 'value' => $restricted_access_post_metabox_value,
- 'default' => UM()->options()->get_default( 'restricted_access_post_metabox' ),
+ 'id' => 'restricted_access_post_metabox',
+ 'type' => 'multi_checkbox',
+ 'label' => __( 'Enable the "Content Restriction" settings for post types', 'ultimate-member' ),
+ 'description' => __( 'Check post types for which you plan to use the "Content Restriction" settings.', 'ultimate-member' ),
+ 'options' => $post_types_options,
+ 'columns' => 3,
+ 'value' => $restricted_access_post_metabox_value,
+ 'default' => UM()->options()->get_default( 'restricted_access_post_metabox' ),
),
array(
- 'id' => 'restricted_access_taxonomy_metabox',
- 'type' => 'multi_checkbox',
- 'label' => __( 'Enable the "Content Restriction" settings for taxonomies', 'ultimate-member' ),
- 'tooltip' => __( 'Check taxonomies for which you plan to use the "Content Restriction" settings', 'ultimate-member' ),
- 'options' => $taxonomies_options,
- 'columns' => 3,
- 'value' => $restricted_access_taxonomy_metabox_value,
- 'default' => UM()->options()->get_default( 'restricted_access_taxonomy_metabox' ),
+ 'id' => 'restricted_access_taxonomy_metabox',
+ 'type' => 'multi_checkbox',
+ 'label' => __( 'Enable the "Content Restriction" settings for taxonomies', 'ultimate-member' ),
+ 'description' => __( 'Check taxonomies for which you plan to use the "Content Restriction" settings.', 'ultimate-member' ),
+ 'options' => $taxonomies_options,
+ 'columns' => 3,
+ 'value' => $restricted_access_taxonomy_metabox_value,
+ 'default' => UM()->options()->get_default( 'restricted_access_taxonomy_metabox' ),
),
)
);
@@ -639,10 +742,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$latest_truncate = get_option( 'um_member_directory_truncated', false );
$same_page_update = array(
- 'id' => 'member_directory_own_table',
- 'type' => 'same_page_update',
- 'label' => __( 'Enable custom table for usermeta', 'ultimate-member' ),
- 'tooltip' => __( 'Check this box if you would like to enable the use of a custom table for user metadata. Improved performance for member directory searches.', 'ultimate-member' ),
+ 'id' => 'member_directory_own_table',
+ 'type' => 'same_page_update',
+ 'label' => __( 'Custom usermeta table', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable custom table for usermeta', 'ultimate-member' ),
+ 'description' => __( 'Check this box if you would like to enable the use of a custom table for user metadata. Improved performance for member directory searches.', 'ultimate-member' ),
);
if ( empty( $latest_update ) || ( ! empty( $latest_truncate ) && $latest_truncate > $latest_update ) ) {
@@ -961,115 +1065,12 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
)
);
- $account_fields = array(
- array(
- 'id' => 'account_tab_password',
- 'type' => 'checkbox',
- 'label' => __( 'Password Account Tab', 'ultimate-member' ),
- 'tooltip' => __( 'Enable/disable the Password account tab in account page', 'ultimate-member' ),
- ),
- array(
- 'id' => 'account_tab_privacy',
- 'type' => 'checkbox',
- 'label' => __( 'Privacy Account Tab', 'ultimate-member' ),
- 'tooltip' => __( 'Enable/disable the Privacy account tab in account page', 'ultimate-member' ),
- ),
- );
-
if ( false !== UM()->account()->is_notifications_tab_visible() ) {
- $account_fields[] = array(
- 'id' => 'account_tab_notifications',
- 'type' => 'checkbox',
- 'label' => __( 'Notifications Account Tab', 'ultimate-member' ),
- 'tooltip' => __( 'Enable/disable the Notifications account tab in account page', 'ultimate-member' ),
- );
-
$settings_map['account_tab_notifications'] = array(
'sanitize' => 'bool',
);
}
- $account_fields = array_merge(
- $account_fields,
- array(
- array(
- 'id' => 'account_tab_delete',
- 'type' => 'checkbox',
- 'label' => __( 'Delete Account Tab', 'ultimate-member' ),
- 'tooltip' => __( 'Enable/disable the Delete account tab in account page', 'ultimate-member' ),
- ),
- array(
- 'id' => 'delete_account_text',
- 'type' => 'textarea', // bug with wp 4.4? should be editor
- 'label' => __( 'Account Deletion Custom Text', 'ultimate-member' ),
- 'tooltip' => __( 'This is custom text that will be displayed to users before they delete their accounts from your site when password is required.', 'ultimate-member' ),
- 'args' => array(
- 'textarea_rows' => 6,
- ),
- ),
- array(
- 'id' => 'delete_account_no_pass_required_text',
- 'type' => 'textarea',
- 'label' => __( 'Account Deletion without password Custom Text', 'ultimate-member' ),
- 'tooltip' => __( 'This is custom text that will be displayed to users before they delete their accounts from your site when password isn\'t required.', 'ultimate-member' ),
- 'args' => array(
- 'textarea_rows' => 6,
- ),
- ),
- array(
- 'id' => 'account_name',
- 'type' => 'checkbox',
- 'label' => __( 'Add a First & Last Name fields', 'ultimate-member' ),
- 'tooltip' => __( 'Whether to enable these fields on the user account page by default or hide them.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'account_name_disable',
- 'type' => 'checkbox',
- 'label' => __( 'Disable First & Last Name fields', 'ultimate-member' ),
- 'tooltip' => __( 'Whether to allow users changing their first and last name in account page.', 'ultimate-member' ),
- 'conditional' => array( 'account_name', '=', '1' ),
- ),
- array(
- 'id' => 'account_name_require',
- 'type' => 'checkbox',
- 'label' => __( 'Require First & Last Name', 'ultimate-member' ),
- 'tooltip' => __( 'Require first and last name?', 'ultimate-member' ),
- 'conditional' => array( 'account_name', '=', '1' ),
- ),
- array(
- 'id' => 'account_email',
- 'type' => 'checkbox',
- 'label' => __( 'Allow users to change e-mail', 'ultimate-member' ),
- 'tooltip' => __( 'Whether to allow users changing their email in account page.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'account_general_password',
- 'type' => 'checkbox',
- 'label' => __( 'Password is required?', 'ultimate-member' ),
- 'tooltip' => __( 'Password is required to save account data.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'account_hide_in_directory',
- 'type' => 'checkbox',
- 'label' => __( 'Allow users to hide their profiles from directory', 'ultimate-member' ),
- 'tooltip' => __( 'Whether to allow users changing their profile visibility from member directory in account page.', 'ultimate-member' ),
- 'conditional' => array( 'account_tab_privacy', '=', '1' ),
- ),
- array(
- 'id' => 'account_hide_in_directory_default',
- 'type' => 'select',
- 'label' => __( 'Hide profiles from directory by default', 'ultimate-member' ),
- 'tooltip' => __( 'Set default value for the "Hide my profile from directory" option', 'ultimate-member' ),
- 'options' => array(
- 'No' => __( 'No', 'ultimate-member' ),
- 'Yes' => __( 'Yes', 'ultimate-member' ),
- ),
- 'size' => 'small',
- 'conditional' => array( 'account_hide_in_directory', '=', '1' ),
- ),
- )
- );
-
$this->settings_map = apply_filters( 'um_settings_map', $settings_map );
/**
@@ -1099,211 +1100,417 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'title' => __( 'General', 'ultimate-member' ),
'sections' => array(
'' => array(
- 'title' => __( 'Pages', 'ultimate-member' ),
- 'fields' => $general_pages_fields,
+ 'title' => __( 'Pages', 'ultimate-member' ),
+ 'description' => sprintf( __( 'This section enables you to assign a page to one of the core elements necessary for the plugin\'s proper function. The plugin automatically creates and configures the required pages upon installation.
You only need to use this tab if you accidentally deleted pages that were automatically created during the initial plugin activation.
Learn more about manually creating pages .', 'ultimate-member' ), 'https://docs.ultimatemember.com/article/1903-creating-plugin-core-pages-manually' ),
+ 'fields' => $general_pages_fields,
),
'users' => array(
- 'title' => __( 'Users', 'ultimate-member' ),
- 'fields' => array(
- array(
- 'id' => 'permalink_base',
- 'type' => 'select',
- 'size' => 'small',
- 'label' => __( 'Profile Permalink Base', 'ultimate-member' ),
- // translators: %s: Profile page URL
- 'tooltip' => sprintf( __( 'Here you can control the permalink structure of the user profile URL globally e.g. %s
username /', 'ultimate-member' ), trailingslashit( um_get_core_page( 'user' ) ) ),
- 'options' => UM()->config()->permalink_base_options,
- 'placeholder' => __( 'Select...', 'ultimate-member' ),
- ),
- array(
- 'id' => 'permalink_base_custom_meta',
- 'type' => 'text',
- 'label' => __( 'Profile Permalink Base Custom Meta Key', 'ultimate-member' ),
- 'tooltip' => __( 'Specify the custom field meta key that you want to use as profile permalink base. Meta value should be unique.', 'ultimate-member' ),
- 'conditional' => array( 'permalink_base', '=', 'custom_meta' ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'display_name',
- 'type' => 'select',
- 'size' => 'medium',
- 'label' => __( 'User Display Name', 'ultimate-member' ),
- 'tooltip' => __( 'This is the name that will be displayed for users on the front end of your site. Default setting uses first/last name as display name if it exists', 'ultimate-member' ),
- 'options' => UM()->config()->display_name_options,
- 'placeholder' => __( 'Select...', 'ultimate-member' ),
- ),
- array(
- 'id' => 'display_name_field',
- 'type' => 'text',
- 'label' => __( 'Display Name Custom Field(s)', 'ultimate-member' ),
- 'tooltip' => __( 'Specify the custom field meta key or custom fields seperated by comma that you want to use to display users name on the frontend of your site', 'ultimate-member' ),
- 'conditional' => array( 'display_name', '=', 'field' ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'author_redirect',
- 'type' => 'checkbox',
- 'label' => __( 'Automatically redirect author page to their profile?', 'ultimate-member' ),
- 'tooltip' => __( 'If enabled, author pages will automatically redirect to the user\'s profile page', 'ultimate-member' ),
- ),
- array(
- 'id' => 'members_page',
- 'type' => 'checkbox',
- 'label' => __( 'Enable Members Directory', 'ultimate-member' ),
- 'tooltip' => __( 'Control whether to enable or disable member directories on this site', 'ultimate-member' ),
- ),
- array(
- 'id' => 'use_gravatars',
- 'type' => 'checkbox',
- 'label' => __( 'Use Gravatars?', 'ultimate-member' ),
- 'tooltip' => __( 'Do you want to use gravatars instead of the default plugin profile photo (If the user did not upload a custom profile photo / avatar)', 'ultimate-member' ),
- ),
- array(
- 'id' => 'use_um_gravatar_default_builtin_image',
- 'type' => 'select',
- 'label' => __( 'Use Gravatar builtin image', 'ultimate-member' ),
- 'tooltip' => __( 'Gravatar has a number of built in options which you can also use as defaults', 'ultimate-member' ),
- 'options' => array(
- 'default' => __( 'Default', 'ultimate-member' ),
- '404' => __( '404 ( File Not Found response )', 'ultimate-member' ),
- 'mm' => __( 'Mystery Man', 'ultimate-member' ),
- 'identicon' => __( 'Identicon', 'ultimate-member' ),
- 'monsterid' => __( 'Monsterid', 'ultimate-member' ),
- 'wavatar' => __( 'Wavatar', 'ultimate-member' ),
- 'retro' => __( 'Retro', 'ultimate-member' ),
- 'blank' => __( 'Blank ( a transparent PNG image )', 'ultimate-member' ),
- ),
- 'conditional' => array( 'use_gravatars', '=', 1 ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'use_um_gravatar_default_image',
- 'type' => 'checkbox',
- 'label' => __( 'Use Default plugin avatar as Gravatar\'s Default avatar', 'ultimate-member' ),
- 'tooltip' => __( 'Do you want to use the plugin default avatar instead of the gravatar default photo (If the user did not upload a custom profile photo / avatar)', 'ultimate-member' ),
- 'conditional' => array( 'use_um_gravatar_default_builtin_image', '=', 'default' ),
- ),
- array(
- 'id' => 'toggle_password',
- 'type' => 'checkbox',
- 'label' => __( 'Show/hide password button', 'ultimate-member' ),
- 'tooltip' => __( 'Enable visibility for show/hide password button for the password field-type.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'require_strongpass',
- 'type' => 'checkbox',
- 'label' => __( 'Require a strong password?', 'ultimate-member' ),
- 'tooltip' => __( 'Enable or disable a strong password rules common for all Ultimate Member forms.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'password_min_chars',
- 'type' => 'number',
- 'label' => __( 'Password minimum length', 'ultimate-member' ),
- 'tooltip' => __( 'If you want to enable a minimum number of characters to be in password. User password field in the UM forms has own settings for that. Leave empty to use default value 8', 'ultimate-member' ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'password_max_chars',
- 'type' => 'number',
- 'label' => __( 'Password maximum length', 'ultimate-member' ),
- 'tooltip' => __( 'If you want to enable a maximum number of characters to be in password. User password field in the UM forms has own settings for that. Leave empty to use default value 30', 'ultimate-member' ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'profile_noindex',
- 'type' => 'select',
- 'size' => 'small',
- 'label' => __( 'Avoid indexing profile by search engines', 'ultimate-member' ),
- 'tooltip' => __( 'Hides the profile page for robots. This setting can be overridden by individual role settings.', 'ultimate-member' ),
- 'options' => array(
- '0' => __( 'No', 'ultimate-member' ),
- '1' => __( 'Yes', 'ultimate-member' ),
+ 'title' => __( 'Users', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'users' => array(
+ 'title' => __( 'Users', 'ultimate-member' ),
+ 'description' => __( 'General users settings.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'register_role',
+ 'type' => 'select',
+ 'label' => __( 'Registration Default Role', 'ultimate-member' ),
+ 'description' => __( 'This will be the role assigned to users registering through Ultimate Member registration forms. By default, this setting will follow the core WordPress setting "New User Default Role" unless you specify a different role.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'register_role' ),
+ 'options' => UM()->roles()->get_roles( __( 'Default', 'ultimate-member' ) ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'permalink_base',
+ 'type' => 'select',
+ 'size' => 'small',
+ 'label' => __( 'Profile Permalink Base', 'ultimate-member' ),
+ // translators: %s: Profile page URL
+ 'description' => sprintf( __( 'Here you can control the permalink structure of the user profile URL globally e.g. %s
username /.', 'ultimate-member' ), trailingslashit( um_get_core_page( 'user' ) ) ),
+ 'options' => UM()->config()->permalink_base_options,
+ 'placeholder' => __( 'Select...', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'permalink_base_custom_meta',
+ 'type' => 'text',
+ 'label' => __( 'Profile Permalink Base Custom Meta Key', 'ultimate-member' ),
+ 'description' => __( 'Specify the custom field meta key that you want to use as profile permalink base. Meta value should be unique.', 'ultimate-member' ),
+ 'conditional' => array( 'permalink_base', '=', 'custom_meta' ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'display_name',
+ 'type' => 'select',
+ 'size' => 'medium',
+ 'label' => __( 'User Display Name', 'ultimate-member' ),
+ 'description' => __( 'This is the name that will be displayed for users on the front end of your site. Default setting uses first/last name as display name if it exists.', 'ultimate-member' ),
+ 'options' => UM()->config()->display_name_options,
+ 'placeholder' => __( 'Select...', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'display_name_field',
+ 'type' => 'text',
+ 'label' => __( 'Display Name Custom Field(s)', 'ultimate-member' ),
+ 'description' => __( 'Specify the custom field meta key or custom fields seperated by comma that you want to use to display users name on the frontend of your site.', 'ultimate-member' ),
+ 'conditional' => array( 'display_name', '=', 'field' ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'author_redirect',
+ 'type' => 'checkbox',
+ 'label' => __( 'Hide author pages', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable author page redirect to user profile', 'ultimate-member' ),
+ 'description' => __( 'If enabled, author pages will automatically redirect to the user\'s profile page.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'members_page',
+ 'type' => 'checkbox',
+ 'label' => __( 'Members Directory', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable Members Directory', 'ultimate-member' ),
+ 'description' => __( 'Control whether to enable or disable member directories on this site.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'use_gravatars',
+ 'type' => 'checkbox',
+ 'label' => __( 'Use Gravatar', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable Gravatar', 'ultimate-member' ),
+ 'description' => __( 'Do you want to use Gravatar instead of the default plugin profile photo (If the user did not upload a custom profile photo/avatar)?', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'use_um_gravatar_default_builtin_image',
+ 'type' => 'select',
+ 'label' => __( 'Use Gravatar builtin image', 'ultimate-member' ),
+ 'description' => __( 'Gravatar has a number of built in options which you can also use as defaults.', 'ultimate-member' ),
+ 'options' => array(
+ 'default' => __( 'Default', 'ultimate-member' ),
+ '404' => __( '404 ( File Not Found response )', 'ultimate-member' ),
+ 'mm' => __( 'Mystery Man', 'ultimate-member' ),
+ 'identicon' => __( 'Identicon', 'ultimate-member' ),
+ 'monsterid' => __( 'Monsterid', 'ultimate-member' ),
+ 'wavatar' => __( 'Wavatar', 'ultimate-member' ),
+ 'retro' => __( 'Retro', 'ultimate-member' ),
+ 'blank' => __( 'Blank ( a transparent PNG image )', 'ultimate-member' ),
+ ),
+ 'conditional' => array( 'use_gravatars', '=', 1 ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'use_um_gravatar_default_image',
+ 'type' => 'checkbox',
+ 'label' => __( 'Replace Gravatar\'s Default avatar', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Set Default plugin avatar as Gravatar\'s Default avatar', 'ultimate-member' ),
+ 'description' => __( 'Do you want to use the plugin default avatar instead of the gravatar default photo (If the user did not upload a custom profile photo/avatar).', 'ultimate-member' ),
+ 'conditional' => array( 'use_um_gravatar_default_builtin_image', '=', 'default' ),
+ ),
+ array(
+ 'id' => 'delete_comments',
+ 'type' => 'checkbox',
+ 'label' => __( 'Delete user comments', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable deleting user comments after deleting a user', 'ultimate-member' ),
+ 'description' => __( 'Do you want to automatically delete a user\'s comments when they delete their account or are removed from the admin dashboard?', 'ultimate-member' ),
+ ),
),
),
- array(
- 'id' => 'activation_link_expiry_time',
- 'type' => 'number',
- 'label' => __( 'Activation link lifetime', 'ultimate-member' ),
- 'tooltip' => __( 'How long does an activation link live in seconds? Leave empty for endless links.', 'ultimate-member' ),
- 'size' => 'small',
+ 'password' => array(
+ 'title' => __( 'Password', 'ultimate-member' ),
+ 'description' => __( 'Password & Security settings.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'toggle_password',
+ 'type' => 'checkbox',
+ 'label' => __( 'Toggle Password Visibility', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable password show/hide icon on password field', 'ultimate-member' ),
+ 'description' => __( 'Enable users to view their inputted password before submitting the form.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'require_strongpass',
+ 'type' => 'checkbox',
+ 'label' => __( 'Require Strong Passwords', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable strong passwords', 'ultimate-member' ),
+ 'description' => __( 'Enable this option to apply strong password rules to all password fields (user registration, password reset and password change).', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'password_min_chars',
+ 'type' => 'number',
+ 'label' => __( 'Password minimum length', 'ultimate-member' ),
+ 'description' => __( 'Enter the minimum number of characters a user must use for their password. The default minimum characters is 8.', 'ultimate-member' ),
+ 'size' => 'small',
+ 'conditional' => array( 'require_strongpass', '=', '1' ),
+ ),
+ array(
+ 'id' => 'password_max_chars',
+ 'type' => 'number',
+ 'label' => __( 'Password maximum length', 'ultimate-member' ),
+ 'description' => __( 'Enter the maximum number of characters a user can use for their password. The default maximum characters is 30.', 'ultimate-member' ),
+ 'size' => 'small',
+ 'conditional' => array( 'require_strongpass', '=', '1' ),
+ ),
+ array(
+ 'id' => 'activation_link_expiry_time',
+ 'type' => 'number',
+ 'label' => __( 'Email activation link expiration (days)', 'ultimate-member' ),
+ 'description' => __( 'For user registrations requiring email confirmation via a link, how long should the activation link remain active before expiring? If this field is left blank, the activation link will not expire.', 'ultimate-member' ),
+ 'size' => 'small',
+ ),
+ ),
),
- array(
- 'id' => 'delete_comments',
- 'type' => 'checkbox',
- 'label' => __( 'Deleting user comments after deleting a user', 'ultimate-member' ),
- 'tooltip' => __( 'Do you want to delete a user\'s comments when that user deletes themself or is removed from the admin dashboard from the site?', 'ultimate-member' ),
+ 'seo' => array(
+ 'title' => __( 'SEO', 'ultimate-member' ),
+ 'description' => __( 'SEO settings for the user profiles.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'profile_noindex',
+ 'type' => 'select',
+ 'size' => 'small',
+ 'label' => __( 'Avoid indexing profile by search engines', 'ultimate-member' ),
+ 'description' => __( 'Hides the profile page for robots. This setting can be overridden by individual role settings.', 'ultimate-member' ),
+ 'options' => array(
+ '0' => __( 'No', 'ultimate-member' ),
+ '1' => __( 'Yes', 'ultimate-member' ),
+ ),
+ ),
+ array(
+ 'id' => 'profile_title',
+ 'type' => 'text',
+ 'label' => __( 'User Profile Title', 'ultimate-member' ),
+ 'description' => __( 'This is the title that is displayed on a specific user profile.', 'ultimate-member' ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'profile_desc',
+ 'type' => 'textarea',
+ 'label' => __( 'User Profile Dynamic Meta Description', 'ultimate-member' ),
+ 'description' => __( 'This will be used in the meta description that is available for search-engines.', 'ultimate-member' ),
+ 'args' => array(
+ 'textarea_rows' => 6,
+ ),
+ ),
+ ),
),
),
),
'account' => array(
- 'title' => __( 'Account', 'ultimate-member' ),
- 'fields' => $account_fields,
+ 'title' => __( 'Account', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'account_tab' => array(
+ 'title' => __( 'Main account tab', 'ultimate-member' ),
+ 'description' => __( 'Allows you to control the fields on the main tab of Account page.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'account_name',
+ 'type' => 'checkbox',
+ 'label' => __( 'Display First & Last name fields', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable to display First & Last name fields', 'ultimate-member' ),
+ 'description' => __( 'If enabled, the First & Last name fields will be shown on the account page.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'account_name_disable',
+ 'type' => 'checkbox',
+ 'label' => __( 'Disable First & Last name field editing', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable to prevent First & Last name editing by users', 'ultimate-member' ),
+ 'description' => __( 'If enabled, this feature will prevent users from changing their first and last names on the account page.', 'ultimate-member' ),
+ 'conditional' => array( 'account_name', '=', '1' ),
+ ),
+ array(
+ 'id' => 'account_name_require',
+ 'type' => 'checkbox',
+ 'label' => __( 'Require First & Last Name', 'ultimate-member' ),
+ 'checkbox_label' => __( 'First and last name fields are required', 'ultimate-member' ),
+ 'description' => __( 'If enabled, users will not be allowed to remove their first or last names when updating their account information.', 'ultimate-member' ),
+ 'conditional' => array( 'account_name', '=', '1' ),
+ ),
+ array(
+ 'id' => 'account_email',
+ 'type' => 'checkbox',
+ 'label' => __( 'Allow users to change email', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable changing email via the account page', 'ultimate-member' ),
+ 'description' => __( 'If disabled, users will not be allowed to change their email address on the account page.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'account_general_password',
+ 'type' => 'checkbox',
+ 'label' => __( 'Require password to update account', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable required password', 'ultimate-member' ),
+ 'description' => __( 'If enabled, users will need to enter their password when updating their information via the account page.', 'ultimate-member' ),
+ ),
+ ),
+ ),
+ 'password_tab' => array(
+ 'title' => __( 'Change password tab', 'ultimate-member' ),
+ 'description' => __( 'Enables you to toggle the change password tab on the account page.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'account_tab_password',
+ 'type' => 'checkbox',
+ 'label' => __( 'Password Account Tab', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Display password change account tab', 'ultimate-member' ),
+ 'description' => __( 'Enable or disable the "Password" tab on the account page.', 'ultimate-member' ),
+ ),
+ ),
+ ),
+ 'privacy_tab' => array(
+ 'title' => __( 'Privacy tab', 'ultimate-member' ),
+ 'description' => __( 'Enables you to toggle the privacy tab on the account page. Disable this tab to prevent users from altering their privacy settings.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'account_tab_privacy',
+ 'type' => 'checkbox',
+ 'label' => __( 'Privacy Account Tab', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Display privacy account tab', 'ultimate-member' ),
+ 'description' => __( 'Enable or disable the "Privacy" tab on the account page.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'account_hide_in_directory',
+ 'type' => 'checkbox',
+ 'label' => __( 'Allow users to hide their profiles from directory', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable users ability to alter their profile visibility in member directories', 'ultimate-member' ),
+ 'description' => __( 'If enabled, this will allow users to change their profile visibility in the member directory from the account page.', 'ultimate-member' ),
+ 'conditional' => array( 'account_tab_privacy', '=', '1' ),
+ ),
+ array(
+ 'id' => 'account_hide_in_directory_default',
+ 'type' => 'select',
+ 'label' => __( 'Hide profiles from directory by default', 'ultimate-member' ),
+ 'description' => __( 'Set the default value for the "Hide my profile from directory" option.', 'ultimate-member' ),
+ 'options' => array(
+ 'No' => __( 'No', 'ultimate-member' ),
+ 'Yes' => __( 'Yes', 'ultimate-member' ),
+ ),
+ 'size' => 'small',
+ 'conditional' => array( 'account_hide_in_directory', '=', '1' ),
+ ),
+ ),
+ ),
+ 'notifications_tab' => array(
+ 'title' => __( 'Notifications tab', 'ultimate-member' ),
+ 'description' => __( 'Enables you to toggle the notifications tab on the account page. Disable this tab to prevent users from altering their notifications settings.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'account_tab_notifications',
+ 'type' => 'checkbox',
+ 'label' => __( 'Notifications Account Tab', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Display notifications account tab', 'ultimate-member' ),
+ 'description' => __( 'Enable or disable the "Notifications" tab on the account page.', 'ultimate-member' ),
+ ),
+ ),
+ ),
+ 'delete_tab' => array(
+ 'title' => __( 'Delete tab', 'ultimate-member' ),
+ 'description' => __( 'Enables you to enable or disable the "Delete Account" tab on the account page. Disable this tab if you wish to prevent users from being able to delete their own accounts.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'account_tab_delete',
+ 'type' => 'checkbox',
+ 'label' => __( 'Delete Account Tab', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Display delete account tab', 'ultimate-member' ),
+ 'description' => __( 'Enable/disable the Delete account tab in account page.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'delete_account_text',
+ 'type' => 'textarea', // bug with wp 4.4? should be editor
+ 'label' => __( 'Account Deletion Text', 'ultimate-member' ),
+ 'description' => __( 'This is the custom text that will be displayed to users before they delete their account from your website when their password is required to confirm account deletion.', 'ultimate-member' ),
+ 'args' => array(
+ 'textarea_rows' => 6,
+ ),
+ 'conditional' => array( 'account_tab_delete', '=', '1' ),
+ ),
+ array(
+ 'id' => 'delete_account_no_pass_required_text',
+ 'type' => 'textarea',
+ 'label' => __( 'Account Deletion Text', 'ultimate-member' ),
+ 'description' => __( 'This is the custom text that will be displayed to users before they delete their account from your website when no password is required to confirm account deletion.', 'ultimate-member' ),
+ 'args' => array(
+ 'textarea_rows' => 6,
+ ),
+ 'conditional' => array( 'account_tab_delete', '=', '0' ),
+ ),
+ ),
+ ),
+ ),
),
'uploads' => array(
- 'title' => __( 'Uploads', 'ultimate-member' ),
- 'fields' => array(
- array(
- 'id' => 'profile_photo_max_size',
- 'type' => 'text',
- 'size' => 'small',
- 'label' => __( 'Profile Photo Maximum File Size (bytes)', 'ultimate-member' ),
- 'tooltip' => __( 'Sets a maximum size for the uploaded photo', 'ultimate-member' ),
+ 'title' => __( 'Uploads', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'uploads' => array(
+ 'title' => __( 'Uploads', 'ultimate-member' ),
+ 'description' => __( 'This page allows you to manage user upload options, enabling you to optimize photos for your site.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'image_orientation_by_exif',
+ 'type' => 'checkbox',
+ 'label' => __( 'Change image orientation', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable getting image orientation from EXIF data', 'ultimate-member' ),
+ 'description' => __( 'Rotate image to and use orientation by the camera EXIF data.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'image_compression',
+ 'type' => 'text',
+ 'size' => 'small',
+ 'label' => __( 'Image Quality', 'ultimate-member' ),
+ 'description' => __( 'Quality is used to determine quality of image uploads, and ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file). The default range is 60.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'image_max_width',
+ 'type' => 'text',
+ 'size' => 'small',
+ 'label' => __( 'Image Upload Maximum Width (px)', 'ultimate-member' ),
+ 'description' => __( 'Any image upload above this width will be resized to this limit automatically.', 'ultimate-member' ),
+ ),
+ ),
),
- array(
- 'id' => 'cover_photo_max_size',
- 'type' => 'text',
- 'size' => 'small',
- 'label' => __( 'Cover Photo Maximum File Size (bytes)', 'ultimate-member' ),
- 'tooltip' => __( 'Sets a maximum size for the uploaded cover', 'ultimate-member' ),
+ 'profile_photo' => array(
+ 'title' => __( 'Profile photo', 'ultimate-member' ),
+ 'description' => __( 'Allows you to control the profile photos sizes, thumbnails, etc.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'profile_photo_max_size',
+ 'type' => 'text',
+ 'size' => 'small',
+ 'label' => __( 'Profile Photo Maximum File Size (bytes)', 'ultimate-member' ),
+ 'description' => __( 'Sets a maximum size for the uploaded photo.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'photo_thumb_sizes',
+ 'type' => 'multi_text',
+ 'size' => 'small',
+ 'label' => __( 'Profile Photo Thumbnail Sizes (px)', 'ultimate-member' ),
+ 'description' => __( 'Here you can define which thumbnail sizes will be created for each profile photo upload.', 'ultimate-member' ),
+ 'validate' => 'numeric',
+ 'add_text' => __( 'Add New Size', 'ultimate-member' ),
+ 'show_default_number' => 1,
+ ),
+ ),
),
- array(
- 'id' => 'photo_thumb_sizes',
- 'type' => 'multi_text',
- 'size' => 'small',
- 'label' => __( 'Profile Photo Thumbnail Sizes (px)', 'ultimate-member' ),
- 'tooltip' => __( 'Here you can define which thumbnail sizes will be created for each profile photo upload.', 'ultimate-member' ),
- 'validate' => 'numeric',
- 'add_text' => __( 'Add New Size', 'ultimate-member' ),
- 'show_default_number' => 1,
- ),
- array(
- 'id' => 'cover_thumb_sizes',
- 'type' => 'multi_text',
- 'size' => 'small',
- 'label' => __( 'Cover Photo Thumbnail Sizes (px)', 'ultimate-member' ),
- 'tooltip' => __( 'Here you can define which thumbnail sizes will be created for each cover photo upload.', 'ultimate-member' ),
- 'validate' => 'numeric',
- 'add_text' => __( 'Add New Size', 'ultimate-member' ),
- 'show_default_number' => 1,
- ),
- array(
- 'id' => 'image_orientation_by_exif',
- 'type' => 'checkbox',
- 'label' => __( 'Change image orientation', 'ultimate-member' ),
- 'tooltip' => __( 'Rotate image to and use orientation by the camera EXIF data.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'image_compression',
- 'type' => 'text',
- 'size' => 'small',
- 'label' => __( 'Image Quality', 'ultimate-member' ),
- 'tooltip' => __( 'Quality is used to determine quality of image uploads, and ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file). The default range is 60.', 'ultimate-member' ),
- ),
-
- array(
- 'id' => 'image_max_width',
- 'type' => 'text',
- 'size' => 'small',
- 'label' => __( 'Image Upload Maximum Width (px)', 'ultimate-member' ),
- 'tooltip' => __( 'Any image upload above this width will be resized to this limit automatically.', 'ultimate-member' ),
- ),
-
- array(
- 'id' => 'cover_min_width',
- 'type' => 'text',
- 'size' => 'small',
- 'label' => __( 'Cover Photo Minimum Width (px)', 'ultimate-member' ),
- 'tooltip' => __( 'This will be the minimum width for cover photo uploads', 'ultimate-member' ),
+ 'cover_photo' => array(
+ 'title' => __( 'Cover photo', 'ultimate-member' ),
+ 'description' => __( 'Allows you to control the cover photos sizes, thumbnails, etc.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'cover_photo_max_size',
+ 'type' => 'text',
+ 'size' => 'small',
+ 'label' => __( 'Cover Photo Maximum File Size (bytes)', 'ultimate-member' ),
+ 'description' => __( 'Sets a maximum size for the uploaded cover.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'cover_min_width',
+ 'type' => 'text',
+ 'size' => 'small',
+ 'label' => __( 'Cover Photo Minimum Width (px)', 'ultimate-member' ),
+ 'description' => __( 'This will be the minimum width for cover photo uploads.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'cover_thumb_sizes',
+ 'type' => 'multi_text',
+ 'size' => 'small',
+ 'label' => __( 'Cover Photo Thumbnail Sizes (px)', 'ultimate-member' ),
+ 'description' => __( 'Here you can define which thumbnail sizes will be created for each cover photo upload.', 'ultimate-member' ),
+ 'validate' => 'numeric',
+ 'add_text' => __( 'Add New Size', 'ultimate-member' ),
+ 'show_default_number' => 1,
+ ),
+ ),
),
),
),
@@ -1313,86 +1520,103 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'title' => __( 'Access', 'ultimate-member' ),
'sections' => array(
'' => array(
- 'title' => __( 'Restriction Content', 'ultimate-member' ),
- 'fields' => $access_fields,
+ 'title' => __( 'Restriction Content', 'ultimate-member' ),
+ 'description' => __( 'Provides settings for controlling access to your site.', 'ultimate-member' ),
+ 'fields' => $access_fields,
),
'other' => array(
- 'title' => __( 'Other', 'ultimate-member' ),
- 'fields' => array(
- array(
- 'id' => 'enable_reset_password_limit',
- 'type' => 'checkbox',
- 'label' => __( 'Enable the Reset Password Limit?', 'ultimate-member' ),
+ 'title' => __( 'Other', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'rp' => array(
+ 'title' => __( 'Reset Password', 'ultimate-member' ),
+ 'description' => __( 'Allows to manage reset password settings.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'enable_reset_password_limit',
+ 'type' => 'checkbox',
+ 'label' => __( 'Password reset limit', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable the Reset Password Limit?', 'ultimate-member' ),
+ 'description' => __( 'If enabled, this sets a limit on the number of password resets a user can do.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'reset_password_limit_number',
+ 'type' => 'text',
+ 'label' => __( 'Enter password reset limit', 'ultimate-member' ),
+ 'description' => __( 'Set the maximum reset password limit. If reached the maximum limit, user will be locked from using this.', 'ultimate-member' ),
+ 'validate' => 'numeric',
+ 'conditional' => array( 'enable_reset_password_limit', '=', 1 ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'change_password_request_limit',
+ 'type' => 'checkbox',
+ 'label' => __( 'Change Password request limit', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable limit for changing password', 'ultimate-member' ),
+ 'description' => __( 'This option adds rate limit when submitting the change password form in the Account page. Users are only allowed to submit 1 request per 30 minutes to prevent from any brute-force attacks or password guessing with the form.', 'ultimate-member' ),
+ ),
+ ),
),
- array(
- 'id' => 'reset_password_limit_number',
- 'type' => 'text',
- 'label' => __( 'Reset Password Limit', 'ultimate-member' ),
- 'tooltip' => __( 'Set the maximum reset password limit. If reached the maximum limit, user will be locked from using this.', 'ultimate-member' ),
- 'validate' => 'numeric',
- 'conditional' => array( 'enable_reset_password_limit', '=', 1 ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'change_password_request_limit',
- 'type' => 'checkbox',
- 'label' => __( 'Change Password request limit', 'ultimate-member' ),
- 'tooltip' => __( 'This option adds rate limit when submitting the change password form in the Account page. Users are only allowed to submit 1 request per 30 minutes to prevent from any brute-force attacks or password guessing with the form.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'blocked_emails',
- 'type' => 'textarea',
- 'label' => __( 'Blocked Email Addresses (Enter one email per line)', 'ultimate-member' ),
- 'tooltip' => __( 'This will block the specified e-mail addresses from being able to sign up or sign in to your site. To block an entire domain, use something like *@domain.com', 'ultimate-member' ),
- ),
- array(
- 'id' => 'blocked_words',
- 'type' => 'textarea',
- 'label' => __( 'Blacklist Words (Enter one word per line)', 'ultimate-member' ),
- 'tooltip' => __( 'This option lets you specify blacklist of words to prevent anyone from signing up with such a word as their username', 'ultimate-member' ),
- ),
- array(
- 'id' => 'allowed_choice_callbacks',
- 'type' => 'textarea',
- 'label' => __( 'Allowed Choice Callbacks (Enter one PHP function per line)', 'ultimate-member' ),
- 'tooltip' => __( 'This option lets you specify the choice callback functions to prevent anyone from using 3rd-party functions that may put your site at risk.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'allow_url_redirect_confirm',
- 'type' => 'checkbox',
- 'label' => __( 'Allow external link redirect confirm', 'ultimate-member' ),
- 'tooltip' => __( 'Using JS.confirm alert when you go to an external link.', 'ultimate-member' ),
+ 'blocked' => array(
+ 'title' => __( 'Blocked data when sign up', 'ultimate-member' ),
+ 'description' => __( 'Allows to manage blocked data of signed up user.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'blocked_emails',
+ 'type' => 'textarea',
+ 'label' => __( 'Blocked Email Addresses (Enter one email per line)', 'ultimate-member' ),
+ 'description' => __( 'This will block the specified email addresses from being able to sign up or sign in to your site. To block an entire domain, use something like `*@domain.com`.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'blocked_words',
+ 'type' => 'textarea',
+ 'label' => __( 'Blacklist Words (Enter one word per line)', 'ultimate-member' ),
+ 'description' => __( 'This option lets you specify blacklist of words to prevent anyone from signing up with such a word as their username.', 'ultimate-member' ),
+ ),
+ ),
),
),
),
),
),
'email' => array(
- 'title' => __( 'Email', 'ultimate-member' ),
- 'fields' => array(
- array(
- 'id' => 'admin_email',
- 'type' => 'text',
- 'label' => __( 'Admin E-mail Address', 'ultimate-member' ),
- 'tooltip' => __( 'e.g. admin@companyname.com', 'ultimate-member' ),
+ 'title' => __( 'Emails', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'email_sender' => array(
+ 'title' => __( 'Email sender options', 'ultimate-member' ),
+ 'description' => __( 'How the sender appears in outgoing Ultimate Member emails.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'admin_email',
+ 'type' => 'text',
+ 'label' => __( 'Admin Email Address', 'ultimate-member' ),
+ 'description' => __( 'e.g. admin@companyname.com.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'mail_from',
+ 'type' => 'text',
+ 'label' => __( 'Mail appears from', 'ultimate-member' ),
+ 'description' => __( 'e.g. Site Name.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'mail_from_addr',
+ 'type' => 'text',
+ 'label' => __( 'Mail appears from address', 'ultimate-member' ),
+ 'description' => __( 'e.g. admin@companyname.com.', 'ultimate-member' ),
+ ),
+ ),
),
- array(
- 'id' => 'mail_from',
- 'type' => 'text',
- 'label' => __( 'Mail appears from', 'ultimate-member' ),
- 'tooltip' => __( 'e.g. Site Name', 'ultimate-member' ),
- ),
- array(
- 'id' => 'mail_from_addr',
- 'type' => 'text',
- 'label' => __( 'Mail appears from address', 'ultimate-member' ),
- 'tooltip' => __( 'e.g. admin@companyname.com', 'ultimate-member' ),
- ),
- array(
- 'id' => 'email_html',
- 'type' => 'checkbox',
- 'label' => __( 'Use HTML for E-mails?', 'ultimate-member' ),
- 'tooltip' => __( 'If you plan use e-mails with HTML, please make sure that this option is enabled. Otherwise, HTML will be displayed as plain text.', 'ultimate-member' ),
+ 'email_template' => array(
+ 'title' => __( 'Email template', 'ultimate-member' ),
+ 'description' => __( 'Section to customize email templates settings.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'email_html',
+ 'type' => 'checkbox',
+ 'label' => __( 'Content type', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable HTML for Emails', 'ultimate-member' ),
+ 'description' => __( 'If you plan use emails with HTML, please make sure that this option is enabled. Otherwise, HTML will be displayed as plain text.', 'ultimate-member' ),
+ ),
+ ),
),
),
),
@@ -1400,395 +1624,456 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'title' => __( 'Appearance', 'ultimate-member' ),
'sections' => array(
'' => array(
- 'title' => __( 'Profile', 'ultimate-member' ),
- 'fields' => array(
- array(
- 'id' => 'profile_template',
- 'type' => 'select',
- 'label' => __( 'Profile Default Template', 'ultimate-member' ),
- 'tooltip' => __( 'This will be the default template to output profile', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_template' ),
- 'options' => UM()->shortcodes()->get_templates( 'profile' ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'profile_max_width',
- 'type' => 'text',
- 'label' => __( 'Profile Maximum Width', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_max_width' ),
- 'tooltip' => __( 'The maximum width this shortcode can take from the page width', 'ultimate-member' ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'profile_area_max_width',
- 'type' => 'text',
- 'label' => __( 'Profile Area Maximum Width', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_area_max_width' ),
- 'tooltip' => __( 'The maximum width of the profile area inside profile (below profile header)', 'ultimate-member' ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'profile_icons',
- 'type' => 'select',
- 'label' => __( 'Profile Field Icons', 'ultimate-member' ),
- 'tooltip' => __( 'This is applicable for edit mode only', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_icons' ),
- 'options' => array(
- 'field' => __( 'Show inside text field', 'ultimate-member' ),
- 'label' => __( 'Show with label', 'ultimate-member' ),
- 'off' => __( 'Turn off', 'ultimate-member' ),
- ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'profile_primary_btn_word',
- 'type' => 'text',
- 'label' => __( 'Profile Primary Button Text', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_primary_btn_word' ),
- 'tooltip' => __( 'The text that is used for updating profile button', 'ultimate-member' ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'profile_secondary_btn',
- 'type' => 'checkbox',
- 'label' => __( 'Profile Secondary Button', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_secondary_btn' ),
- 'tooltip' => __( 'Switch on/off the secondary button display in the form', 'ultimate-member' ),
- ),
- array(
- 'id' => 'profile_secondary_btn_word',
- 'type' => 'text',
- 'label' => __( 'Profile Secondary Button Text', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_secondary_btn_word' ),
- 'tooltip' => __( 'The text that is used for cancelling update profile button', 'ultimate-member' ),
- 'conditional' => array( 'profile_secondary_btn', '=', 1 ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'default_avatar',
- 'type' => 'media',
- 'label' => __( 'Default Profile Photo', 'ultimate-member' ),
- 'tooltip' => __( 'You can change the default profile picture globally here. Please make sure that the photo is 300x300px.', 'ultimate-member' ),
- 'upload_frame_title' => __( 'Select Default Profile Photo', 'ultimate-member' ),
- 'default' => array(
- 'url' => UM_URL . 'assets/img/default_avatar.jpg',
+ 'title' => __( 'Profile', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'template' => array(
+ 'title' => __( 'Template', 'ultimate-member' ),
+ 'description' => sprintf( __( 'This section allows you to customize the user profile template and size.
Learn more about custom profile template creation .', 'ultimate-member' ), 'https://docs.ultimatemember.com/article/120-adding-your-custom-profile-templates' ),
+ 'fields' => array(
+ array(
+ 'id' => 'profile_template',
+ 'type' => 'select',
+ 'label' => __( 'Profile Default Template', 'ultimate-member' ),
+ 'description' => __( 'This will be the default template to output profile.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_template' ),
+ 'options' => UM()->shortcodes()->get_templates( 'profile' ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'profile_max_width',
+ 'type' => 'text',
+ 'label' => __( 'Profile Maximum Width', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_max_width' ),
+ 'description' => __( 'The maximum width this shortcode can take from the page width.', 'ultimate-member' ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'profile_area_max_width',
+ 'type' => 'text',
+ 'label' => __( 'Profile Area Maximum Width', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_area_max_width' ),
+ 'description' => __( 'The maximum width of the profile area inside profile (below profile header).', 'ultimate-member' ),
+ 'size' => 'small',
+ ),
),
),
- array(
- 'id' => 'default_cover',
- 'type' => 'media',
- 'url' => true,
- 'preview' => false,
- 'label' => __( 'Default Cover Photo', 'ultimate-member' ),
- 'tooltip' => __( 'You can change the default cover photo globally here. Please make sure that the default cover is large enough and respects the ratio you are using for cover photos.', 'ultimate-member' ),
- 'upload_frame_title' => __( 'Select Default Cover Photo', 'ultimate-member' ),
- ),
- array(
- 'id' => 'disable_profile_photo_upload',
- 'type' => 'checkbox',
- 'label' => __( 'Disable Profile Photo Upload', 'ultimate-member' ),
- 'tooltip' => __( 'Switch on/off the profile photo uploader', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'disable_profile_photo_upload' ),
- ),
- array(
- 'id' => 'profile_photosize',
- 'type' => 'select',
- 'label' => __( 'Profile Photo Size', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_photosize' ),
- 'options' => UM()->files()->get_profile_photo_size( 'photo_thumb_sizes' ),
- 'tooltip' => __( 'The global default of profile photo size. This can be overridden by individual form settings', 'ultimate-member' ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'profile_cover_enabled',
- 'type' => 'checkbox',
- 'label' => __( 'Profile Cover Photos', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_cover_enabled' ),
- 'tooltip' => __( 'Switch on/off the profile cover photos', 'ultimate-member' ),
- ),
- array(
- 'id' => 'profile_coversize',
- 'type' => 'select',
- 'label' => __( 'Profile Cover Size', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_coversize' ),
- 'options' => UM()->files()->get_profile_photo_size( 'cover_thumb_sizes' ),
- 'tooltip' => __( 'The global default width of cover photo size. This can be overridden by individual form settings', 'ultimate-member' ),
- 'conditional' => array( 'profile_cover_enabled', '=', 1 ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'profile_cover_ratio',
- 'type' => 'select',
- 'label' => __( 'Profile Cover Ratio', 'ultimate-member' ),
- 'tooltip' => __( 'Choose global ratio for cover photos of profiles', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_cover_ratio' ),
- 'options' => array(
- '1.6:1' => '1.6:1',
- '2.7:1' => '2.7:1',
- '2.2:1' => '2.2:1',
- '3.2:1' => '3.2:1',
+ 'profile_photo' => array(
+ 'title' => __( 'Profile photo', 'ultimate-member' ),
+ 'description' => __( 'This section allows you to customize the profile photo component on the user profile.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'default_avatar',
+ 'type' => 'media',
+ 'label' => __( 'Default Profile Photo', 'ultimate-member' ),
+ 'description' => __( 'You can change the default profile picture globally here. Please make sure that the photo is 300x300px.', 'ultimate-member' ),
+ 'upload_frame_title' => __( 'Select Default Profile Photo', 'ultimate-member' ),
+ 'default' => array(
+ 'url' => UM_URL . 'assets/img/default_avatar.jpg',
+ ),
+ ),
+ array(
+ 'id' => 'disable_profile_photo_upload',
+ 'type' => 'checkbox',
+ 'label' => __( 'Profile Photo Upload', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Disable Profile Photo Upload', 'ultimate-member' ),
+ 'description' => __( 'Switch on/off the profile photo uploader.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'disable_profile_photo_upload' ),
+ ),
+ array(
+ 'id' => 'profile_photosize',
+ 'type' => 'select',
+ 'label' => __( 'Profile Photo Size', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_photosize' ),
+ 'options' => UM()->files()->get_profile_photo_size( 'photo_thumb_sizes' ),
+ 'description' => __( 'The global default of profile photo size. This can be overridden by individual form settings.', 'ultimate-member' ),
+ 'size' => 'small',
+ ),
),
- 'conditional' => array( 'profile_cover_enabled', '=', 1 ),
- 'size' => 'small',
),
- array(
- 'id' => 'profile_show_metaicon',
- 'type' => 'checkbox',
- 'label' => __( 'Profile Header Meta Text Icon', 'ultimate-member' ),
- 'default' => 0,
- 'tooltip' => __( 'Display field icons for related user meta fields in header or not', 'ultimate-member' ),
- ),
- array(
- 'id' => 'profile_show_name',
- 'type' => 'checkbox',
- 'label' => __( 'Show display name in profile header', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_show_name' ),
- 'tooltip' => __( 'Switch on/off the user name on profile header', 'ultimate-member' ),
- ),
- array(
- 'id' => 'profile_show_social_links',
- 'type' => 'checkbox',
- 'label' => __( 'Show social links in profile header', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_show_social_links' ),
- 'tooltip' => __( 'Switch on/off the social links on profile header', 'ultimate-member' ),
- ),
- array(
- 'id' => 'profile_show_bio',
- 'type' => 'checkbox',
- 'label' => __( 'Show user description in header', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_show_bio' ),
- 'tooltip' => __( 'Switch on/off the user description on profile header', 'ultimate-member' ),
- ),
- array(
- 'id' => 'profile_show_html_bio',
- 'type' => 'checkbox',
- 'label' => __( 'Enable HTML support for user description', 'ultimate-member' ),
- 'tooltip' => __( 'Switch on/off to enable/disable support for html tags on user description.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'profile_bio_maxchars',
- 'type' => 'text',
- 'label' => __( 'User description maximum chars', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_bio_maxchars' ),
- 'tooltip' => __( 'Maximum number of characters to allow in user description field in header.', 'ultimate-member' ),
- 'conditional' => array( 'profile_show_bio', '=', 1 ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'profile_header_menu',
- 'type' => 'select',
- 'label' => __( 'Profile Header Menu Position', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_header_menu' ),
- 'tooltip' => __( 'For incompatible themes, please make the menu open from left instead of bottom by default.', 'ultimate-member' ),
- 'options' => array(
- 'bc' => __( 'Bottom of Icon', 'ultimate-member' ),
- 'lc' => __( 'Left of Icon (right for RTL)', 'ultimate-member' ),
+ 'cover_photo' => array(
+ 'title' => __( 'Cover photo', 'ultimate-member' ),
+ 'description' => __( 'This section allows you to customize the profile photo component on the user profile.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'default_cover',
+ 'type' => 'media',
+ 'url' => true,
+ 'preview' => false,
+ 'label' => __( 'Default Cover Photo', 'ultimate-member' ),
+ 'description' => __( 'You can change the default cover photo globally here. Please make sure that the default cover is large enough and respects the ratio you are using for cover photos.', 'ultimate-member' ),
+ 'upload_frame_title' => __( 'Select Default Cover Photo', 'ultimate-member' ),
+ ),
+
+ array(
+ 'id' => 'profile_cover_enabled',
+ 'type' => 'checkbox',
+ 'label' => __( 'Profile Cover Photos', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable Cover Photos', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_cover_enabled' ),
+ 'description' => __( 'Switch on/off the profile cover photos.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'profile_coversize',
+ 'type' => 'select',
+ 'label' => __( 'Profile Cover Size', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_coversize' ),
+ 'options' => UM()->files()->get_profile_photo_size( 'cover_thumb_sizes' ),
+ 'description' => __( 'The global default width of cover photo size. This can be overridden by individual form settings.', 'ultimate-member' ),
+ 'conditional' => array( 'profile_cover_enabled', '=', 1 ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'profile_cover_ratio',
+ 'type' => 'select',
+ 'label' => __( 'Profile Cover Ratio', 'ultimate-member' ),
+ 'description' => __( 'Choose global ratio for cover photos of profiles.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_cover_ratio' ),
+ 'options' => array(
+ '1.6:1' => '1.6:1',
+ '2.7:1' => '2.7:1',
+ '2.2:1' => '2.2:1',
+ '3.2:1' => '3.2:1',
+ ),
+ 'conditional' => array( 'profile_cover_enabled', '=', 1 ),
+ 'size' => 'small',
+ ),
),
- 'size' => 'small',
),
- array(
- 'id' => 'profile_empty_text',
- 'type' => 'checkbox',
- 'label' => __( 'Show a custom message if profile is empty', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_empty_text' ),
- 'tooltip' => __( 'Switch on/off the custom message that appears when the profile is empty', 'ultimate-member' ),
+ 'header' => array(
+ 'title' => __( 'Header', 'ultimate-member' ),
+ 'description' => __( 'This section allows you to customize the user profile header component.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'profile_show_metaicon',
+ 'type' => 'checkbox',
+ 'label' => __( 'Profile Header Meta Text Icon', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show icons in Profile Header Meta', 'ultimate-member' ),
+ 'default' => 0,
+ 'description' => __( 'Display field icons for related user meta fields in header or not.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'profile_show_name',
+ 'type' => 'checkbox',
+ 'label' => __( 'Display name in profile header', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show display name in profile header', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_show_name' ),
+ 'description' => __( 'Switch on/off the user name on profile header.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'profile_show_social_links',
+ 'type' => 'checkbox',
+ 'label' => __( 'Social links in profile header', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show social links in profile header', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_show_social_links' ),
+ 'description' => __( 'Switch on/off the social links on profile header.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'profile_show_bio',
+ 'type' => 'checkbox',
+ 'label' => __( 'User description in profile header', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show user description in profile header', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_show_bio' ),
+ 'description' => __( 'Switch on/off the user description on profile header.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'profile_bio_maxchars',
+ 'type' => 'text',
+ 'label' => __( 'User description maximum chars', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_bio_maxchars' ),
+ 'description' => __( 'Maximum number of characters to allow in user description field in header.', 'ultimate-member' ),
+ 'conditional' => array( 'profile_show_bio', '=', 1 ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'profile_show_html_bio',
+ 'type' => 'checkbox',
+ 'label' => __( 'HTML support for user description', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable HTML support for user description', 'ultimate-member' ),
+ 'description' => __( 'Switch on/off to enable/disable support for HTML tags on user description.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'profile_header_menu',
+ 'type' => 'select',
+ 'label' => __( 'Profile Header Menu Position', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_header_menu' ),
+ 'description' => __( 'For incompatible themes, please make the menu open from left instead of bottom by default.', 'ultimate-member' ),
+ 'options' => array(
+ 'bc' => __( 'Bottom of Icon', 'ultimate-member' ),
+ 'lc' => __( 'Left of Icon (right for RTL)', 'ultimate-member' ),
+ ),
+ 'size' => 'small',
+ ),
+ ),
),
- array(
- 'id' => 'profile_empty_text_emo',
- 'type' => 'checkbox',
- 'label' => __( 'Show the emoticon', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'profile_empty_text_emo' ),
- 'tooltip' => __( 'Switch on/off the emoticon (sad face) that appears above the message', 'ultimate-member' ),
- 'conditional' => array( 'profile_empty_text', '=', 1 ),
+ 'fields' => array(
+ 'title' => __( 'Buttons & Fields', 'ultimate-member' ),
+ 'description' => __( 'This section allows you to customize the user profile buttons and fields layout.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'profile_primary_btn_word',
+ 'type' => 'text',
+ 'label' => __( 'Profile Primary Button Text', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_primary_btn_word' ),
+ 'description' => __( 'The text that is used for updating profile button.', 'ultimate-member' ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'profile_secondary_btn',
+ 'type' => 'checkbox',
+ 'label' => __( 'Profile Secondary Button', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show Profile Secondary Button', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_secondary_btn' ),
+ 'description' => __( 'Switch on/off the secondary button display in the form.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'profile_secondary_btn_word',
+ 'type' => 'text',
+ 'label' => __( 'Profile Secondary Button Text', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_secondary_btn_word' ),
+ 'description' => __( 'The text that is used for cancelling update profile button.', 'ultimate-member' ),
+ 'conditional' => array( 'profile_secondary_btn', '=', 1 ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'profile_icons',
+ 'type' => 'select',
+ 'label' => __( 'Profile Field Icons', 'ultimate-member' ),
+ 'description' => __( 'This is applicable for edit mode only.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_icons' ),
+ 'options' => array(
+ 'field' => __( 'Show inside text field', 'ultimate-member' ),
+ 'label' => __( 'Show with label', 'ultimate-member' ),
+ 'off' => __( 'Turn off', 'ultimate-member' ),
+ ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'profile_empty_text',
+ 'type' => 'checkbox',
+ 'label' => __( 'Custom message on empty profile', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show a custom message if profile is empty', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_empty_text' ),
+ 'description' => __( 'Switch on/off the custom message that appears when the profile is empty.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'profile_empty_text_emo',
+ 'type' => 'checkbox',
+ 'label' => __( 'Custom message emoticon', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show the emoticon', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'profile_empty_text_emo' ),
+ 'description' => __( 'Switch on/off the emoticon (sad face) that appears above the message.', 'ultimate-member' ),
+ 'conditional' => array( 'profile_empty_text', '=', 1 ),
+ ),
+ ),
),
),
),
'profile_menu' => array(
- 'title' => __( 'Profile Menu', 'ultimate-member' ),
- 'fields' => $appearances_profile_menu_fields,
+ 'title' => __( 'Profile Menu', 'ultimate-member' ),
+ 'description' => __( 'This section allows you to customize the user profiles menus on your site.', 'ultimate-member' ),
+ 'fields' => $appearances_profile_menu_fields,
),
'registration_form' => array(
- 'title' => __( 'Registration Form', 'ultimate-member' ),
- 'fields' => array(
- array(
- 'id' => 'register_template',
- 'type' => 'select',
- 'label' => __( 'Registration Default Template', 'ultimate-member' ),
- 'tooltip' => __( 'This will be the default template to output registration', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'register_template' ),
- 'options' => UM()->shortcodes()->get_templates( 'register' ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'register_max_width',
- 'type' => 'text',
- 'label' => __( 'Registration Maximum Width', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'register_max_width' ),
- 'tooltip' => __( 'The maximum width this shortcode can take from the page width', 'ultimate-member' ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'register_align',
- 'type' => 'select',
- 'label' => __( 'Registration Shortcode Alignment', 'ultimate-member' ),
- 'tooltip' => __( 'The shortcode is centered by default unless you specify otherwise here', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'register_align' ),
- 'options' => array(
- 'center' => __( 'Centered', 'ultimate-member' ),
- 'left' => __( 'Left aligned', 'ultimate-member' ),
- 'right' => __( 'Right aligned', 'ultimate-member' ),
+ 'title' => __( 'Registration Form', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'template' => array(
+ 'title' => __( 'Template', 'ultimate-member' ),
+ 'description' => __( 'This section allows you to customize the user registration template and size.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'register_template',
+ 'type' => 'select',
+ 'label' => __( 'Registration Default Template', 'ultimate-member' ),
+ 'description' => __( 'This will be the default template to output registration.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'register_template' ),
+ 'options' => UM()->shortcodes()->get_templates( 'register' ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'register_max_width',
+ 'type' => 'text',
+ 'label' => __( 'Registration Maximum Width', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'register_max_width' ),
+ 'description' => __( 'The maximum width this shortcode can take from the page width.', 'ultimate-member' ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'register_align',
+ 'type' => 'select',
+ 'label' => __( 'Registration Shortcode Alignment', 'ultimate-member' ),
+ 'description' => __( 'The shortcode is centered by default unless you specify otherwise here.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'register_align' ),
+ 'options' => array(
+ 'center' => __( 'Centered', 'ultimate-member' ),
+ 'left' => __( 'Left aligned', 'ultimate-member' ),
+ 'right' => __( 'Right aligned', 'ultimate-member' ),
+ ),
+ 'size' => 'small',
+ ),
),
- 'size' => 'small',
),
- array(
- 'id' => 'register_icons',
- 'type' => 'select',
- 'label' => __( 'Registration Field Icons', 'ultimate-member' ),
- 'tooltip' => __( 'This controls the display of field icons in the registration form', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'register_icons' ),
- 'options' => array(
- 'field' => __( 'Show inside text field', 'ultimate-member' ),
- 'label' => __( 'Show with label', 'ultimate-member' ),
- 'off' => __( 'Turn off', 'ultimate-member' ),
+ 'fields' => array(
+ 'title' => __( 'Buttons & Fields', 'ultimate-member' ),
+ 'description' => __( 'This section allows you to customize the user registration buttons and fields layout.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'register_primary_btn_word',
+ 'type' => 'text',
+ 'label' => __( 'Registration Primary Button Text', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'register_primary_btn_word' ),
+ 'description' => __( 'The text that is used for primary button text.', 'ultimate-member' ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'register_secondary_btn',
+ 'type' => 'checkbox',
+ 'label' => __( 'Registration Secondary Button', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show Registration Secondary Button', 'ultimate-member' ),
+ 'default' => 1,
+ 'description' => __( 'Switch on/off the secondary button display in the form.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'register_secondary_btn_word',
+ 'type' => 'text',
+ 'label' => __( 'Registration Secondary Button Text', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'register_secondary_btn_word' ),
+ 'description' => __( 'The text that is used for the secondary button text.', 'ultimate-member' ),
+ 'conditional' => array( 'register_secondary_btn', '=', 1 ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'register_secondary_btn_url',
+ 'type' => 'text',
+ 'label' => __( 'Registration Secondary Button URL', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'register_secondary_btn_url' ),
+ 'description' => __( 'You can replace default link for this button by entering custom URL.', 'ultimate-member' ),
+ 'conditional' => array( 'register_secondary_btn', '=', 1 ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'register_icons',
+ 'type' => 'select',
+ 'label' => __( 'Registration Field Icons', 'ultimate-member' ),
+ 'description' => __( 'This controls the display of field icons in the registration form.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'register_icons' ),
+ 'options' => array(
+ 'field' => __( 'Show inside text field', 'ultimate-member' ),
+ 'label' => __( 'Show with label', 'ultimate-member' ),
+ 'off' => __( 'Turn off', 'ultimate-member' ),
+ ),
+ 'size' => 'small',
+ ),
),
- 'size' => 'small',
- ),
- array(
- 'id' => 'register_primary_btn_word',
- 'type' => 'text',
- 'label' => __( 'Registration Primary Button Text', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'register_primary_btn_word' ),
- 'tooltip' => __( 'The text that is used for primary button text', 'ultimate-member' ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'register_secondary_btn',
- 'type' => 'checkbox',
- 'label' => __( 'Registration Secondary Button', 'ultimate-member' ),
- 'default' => 1,
- 'tooltip' => __( 'Switch on/off the secondary button display in the form', 'ultimate-member' ),
- ),
- array(
- 'id' => 'register_secondary_btn_word',
- 'type' => 'text',
- 'label' => __( 'Registration Secondary Button Text', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'register_secondary_btn_word' ),
- 'tooltip' => __( 'The text that is used for the secondary button text', 'ultimate-member' ),
- 'conditional' => array( 'register_secondary_btn', '=', 1 ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'register_secondary_btn_url',
- 'type' => 'text',
- 'label' => __( 'Registration Secondary Button URL', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'register_secondary_btn_url' ),
- 'tooltip' => __( 'You can replace default link for this button by entering custom URL', 'ultimate-member' ),
- 'conditional' => array( 'register_secondary_btn', '=', 1 ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'register_role',
- 'type' => 'select',
- 'label' => __( 'Registration Default Role', 'ultimate-member' ),
- 'tooltip' => __( 'This will be the default role assigned to users registering thru registration form', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'register_role' ),
- 'options' => UM()->roles()->get_roles( __( 'Default', 'ultimate-member' ) ),
- 'size' => 'small',
),
),
),
'login_form' => array(
- 'title' => __( 'Login Form', 'ultimate-member' ),
- 'fields' => array(
- array(
- 'id' => 'login_template',
- 'type' => 'select',
- 'label' => __( 'Login Default Template', 'ultimate-member' ),
- 'tooltip' => __( 'This will be the default template to output login', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'login_template' ),
- 'options' => UM()->shortcodes()->get_templates( 'login' ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'login_max_width',
- 'type' => 'text',
- 'label' => __( 'Login Maximum Width', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'login_max_width' ),
- 'tooltip' => __( 'The maximum width this shortcode can take from the page width', 'ultimate-member' ),
- 'size' => 'small',
- ),
- array(
- 'id' => 'login_align',
- 'type' => 'select',
- 'label' => __( 'Login Shortcode Alignment', 'ultimate-member' ),
- 'tooltip' => __( 'The shortcode is centered by default unless you specify otherwise here', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'login_align' ),
- 'options' => array(
- 'center' => __( 'Centered', 'ultimate-member' ),
- 'left' => __( 'Left aligned', 'ultimate-member' ),
- 'right' => __( 'Right aligned', 'ultimate-member' ),
+ 'title' => __( 'Login Form', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'template' => array(
+ 'title' => __( 'Template', 'ultimate-member' ),
+ 'description' => __( 'This section allows you to customize the user login template and size.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'login_template',
+ 'type' => 'select',
+ 'label' => __( 'Login Default Template', 'ultimate-member' ),
+ 'description' => __( 'This will be the default template to output login.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'login_template' ),
+ 'options' => UM()->shortcodes()->get_templates( 'login' ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'login_max_width',
+ 'type' => 'text',
+ 'label' => __( 'Login Maximum Width', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'login_max_width' ),
+ 'description' => __( 'The maximum width this shortcode can take from the page width.', 'ultimate-member' ),
+ 'size' => 'small',
+ ),
+ array(
+ 'id' => 'login_align',
+ 'type' => 'select',
+ 'label' => __( 'Login Shortcode Alignment', 'ultimate-member' ),
+ 'description' => __( 'The shortcode is centered by default unless you specify otherwise here.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'login_align' ),
+ 'options' => array(
+ 'center' => __( 'Centered', 'ultimate-member' ),
+ 'left' => __( 'Left aligned', 'ultimate-member' ),
+ 'right' => __( 'Right aligned', 'ultimate-member' ),
+ ),
+ 'size' => 'small',
+ ),
),
- 'size' => 'small',
),
- array(
- 'id' => 'login_icons',
- 'type' => 'select',
- 'label' => __( 'Login Field Icons', 'ultimate-member' ),
- 'tooltip' => __( 'This controls the display of field icons in the login form', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'login_icons' ),
- 'options' => array(
- 'field' => __( 'Show inside text field', 'ultimate-member' ),
- 'label' => __( 'Show with label', 'ultimate-member' ),
- 'off' => __( 'Turn off', 'ultimate-member' ),
+ 'fields' => array(
+ 'title' => __( 'Buttons & Fields', 'ultimate-member' ),
+ 'description' => __( 'This section allows you to customize the user login buttons and fields layout.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'login_primary_btn_word',
+ 'type' => 'text',
+ 'label' => __( 'Login Primary Button Text', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'login_primary_btn_word' ),
+ 'description' => __( 'The text that is used for primary button text.', 'ultimate-member' ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'login_secondary_btn',
+ 'type' => 'checkbox',
+ 'label' => __( 'Login Secondary Button', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show Login Secondary Button', 'ultimate-member' ),
+ 'default' => 1,
+ 'description' => __( 'Switch on/off the secondary button display in the form.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'login_secondary_btn_word',
+ 'type' => 'text',
+ 'label' => __( 'Login Secondary Button Text', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'login_secondary_btn_word' ),
+ 'description' => __( 'The text that is used for the secondary button text.', 'ultimate-member' ),
+ 'conditional' => array( 'login_secondary_btn', '=', 1 ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'login_secondary_btn_url',
+ 'type' => 'text',
+ 'label' => __( 'Login Secondary Button URL', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'login_secondary_btn_url' ),
+ 'description' => __( 'You can replace default link for this button by entering custom URL.', 'ultimate-member' ),
+ 'conditional' => array( 'login_secondary_btn', '=', 1 ),
+ 'size' => 'medium',
+ ),
+ array(
+ 'id' => 'login_forgot_pass_link',
+ 'type' => 'checkbox',
+ 'label' => __( 'Login Forgot Password Link', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show Login Forgot Password Link', 'ultimate-member' ),
+ 'default' => 1,
+ 'description' => __( 'Switch on/off the forgot password link in login form.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'login_show_rememberme',
+ 'type' => 'checkbox',
+ 'label' => __( '"Remember Me" checkbox', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show "Remember Me" checkbox', 'ultimate-member' ),
+ 'default' => 1,
+ 'description' => __( 'Allow users to choose If they want to stay signed in even after closing the browser. If you do not show this option, the default will be to not remember login session.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'login_icons',
+ 'type' => 'select',
+ 'label' => __( 'Login Field Icons', 'ultimate-member' ),
+ 'description' => __( 'This controls the display of field icons in the login form.', 'ultimate-member' ),
+ 'default' => um_get_metadefault( 'login_icons' ),
+ 'options' => array(
+ 'field' => __( 'Show inside text field', 'ultimate-member' ),
+ 'label' => __( 'Show with label', 'ultimate-member' ),
+ 'off' => __( 'Turn off', 'ultimate-member' ),
+ ),
+ 'size' => 'small',
+ ),
),
- 'size' => 'small',
- ),
- array(
- 'id' => 'login_primary_btn_word',
- 'type' => 'text',
- 'label' => __( 'Login Primary Button Text', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'login_primary_btn_word' ),
- 'tooltip' => __( 'The text that is used for primary button text', 'ultimate-member' ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'login_secondary_btn',
- 'type' => 'checkbox',
- 'label' => __( 'Login Secondary Button', 'ultimate-member' ),
- 'default' => 1,
- 'tooltip' => __( 'Switch on/off the secondary button display in the form', 'ultimate-member' ),
- ),
- array(
- 'id' => 'login_secondary_btn_word',
- 'type' => 'text',
- 'label' => __( 'Login Secondary Button Text', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'login_secondary_btn_word' ),
- 'tooltip' => __( 'The text that is used for the secondary button text', 'ultimate-member' ),
- 'conditional' => array( 'login_secondary_btn', '=', 1 ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'login_secondary_btn_url',
- 'type' => 'text',
- 'label' => __( 'Login Secondary Button URL', 'ultimate-member' ),
- 'default' => um_get_metadefault( 'login_secondary_btn_url' ),
- 'tooltip' => __( 'You can replace default link for this button by entering custom URL', 'ultimate-member' ),
- 'conditional' => array( 'login_secondary_btn', '=', 1 ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'login_forgot_pass_link',
- 'type' => 'checkbox',
- 'label' => __( 'Login Forgot Password Link', 'ultimate-member' ),
- 'default' => 1,
- 'tooltip' => __( 'Switch on/off the forgot password link in login form', 'ultimate-member' ),
- ),
- array(
- 'id' => 'login_show_rememberme',
- 'type' => 'checkbox',
- 'label' => __( 'Show "Remember Me"', 'ultimate-member' ),
- 'default' => 1,
- 'tooltip' => __( 'Allow users to choose If they want to stay signed in even after closing the browser. If you do not show this option, the default will be to not remember login session.', 'ultimate-member' ),
),
),
),
@@ -1800,90 +2085,177 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
'licenses' => array(
'title' => __( 'Licenses', 'ultimate-member' ),
),
- 'misc' => array(
- 'title' => __( 'Misc', 'ultimate-member' ),
- 'fields' => array(
- array(
- 'id' => 'form_asterisk',
- 'type' => 'checkbox',
- 'label' => __( 'Show an asterisk for required fields', 'ultimate-member' ),
- ),
- array(
- 'id' => 'profile_title',
- 'type' => 'text',
- 'label' => __( 'User Profile Title', 'ultimate-member' ),
- 'tooltip' => __( 'This is the title that is displayed on a specific user profile', 'ultimate-member' ),
- 'size' => 'medium',
- ),
- array(
- 'id' => 'profile_desc',
- 'type' => 'textarea',
- 'label' => __( 'User Profile Dynamic Meta Description', 'ultimate-member' ),
- 'tooltip' => __( 'This will be used in the meta description that is available for search-engines.', 'ultimate-member' ),
- 'args' => array(
- 'textarea_rows' => 6,
+ 'advanced' => array(
+ 'title' => __( 'Advanced', 'ultimate-member' ),
+ 'sections' => array(
+ '' => array(
+ 'title' => __( 'General', 'ultimate-member' ),
+ 'description' => sprintf( __( 'Advanced settings section is designed to help you fine-tune your website or add extra features.
Learn more about advanced settings section .', 'ultimate-member' ), 'https://docs.ultimatemember.com/article/1902-advanced-tab' ),
+ 'fields' => array(
+ array(
+ 'id' => 'form_asterisk',
+ 'type' => 'checkbox',
+ 'label' => __( 'Required fields\' asterisk', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Show an asterisk for required fields', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'um_profile_object_cache_stop',
+ 'type' => 'checkbox',
+ 'label' => __( 'Cache User Profile', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Disable user data cache', 'ultimate-member' ),
+ 'description' => __( 'Check this box if you would like to disable Ultimate Member user\'s cache.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'uninstall_on_delete',
+ 'type' => 'checkbox',
+ 'label' => __( 'Remove Data on Uninstall?', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable flushing data', 'ultimate-member' ),
+ 'description' => __( 'Check this box if you would like Ultimate Member to completely remove all of its data when the plugin/extensions are deleted.', 'ultimate-member' ),
+ ),
),
),
- array(
- 'id' => 'um_profile_object_cache_stop',
- 'type' => 'checkbox',
- 'label' => __( 'Disable Cache User Profile', 'ultimate-member' ),
- 'tooltip' => __( 'Check this box if you would like to disable Ultimate Member user\'s cache.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'enable_blocks',
- 'type' => 'checkbox',
- 'label' => __( 'Enable Gutenberg Blocks', 'ultimate-member' ),
- 'tooltip' => __( 'Check this box if you would like to use Ultimate Member blocks in Gutenberg editor. Important some themes have the conflicts with Gutenberg editor.', 'ultimate-member' ),
- ),
- array(
- 'id' => 'rest_api_version',
- 'type' => 'select',
- 'label' => __( 'REST API version', 'ultimate-member' ),
- 'tooltip' => __( 'This controls the REST API version, we recommend to use the last version', 'ultimate-member' ),
- 'options' => array(
- '1.0' => __( '1.0 version', 'ultimate-member' ),
- '2.0' => __( '2.0 version', 'ultimate-member' ),
+ 'override_templates' => array(
+ 'title' => __( 'Override templates', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'override_templates' => array(
+ 'title' => __( 'Override templates', 'ultimate-member' ),
+ // translators: %s: Link to the docs article.
+ 'description' => sprintf( __( 'Each time we release an update, you\'ll find a list of changes made to the template files.
Learn more about overriding templates .
You can easily check the status of the latest templates to see if they are up-to-date or need updating.
Learn more about fixing outdated templates .', 'ultimate-member' ), 'https://docs.ultimatemember.com/article/1516-templates-map', 'https://docs.ultimatemember.com/article/1847-fixing-outdated-ultimate-member-templates' ), /** @noinspection HtmlUnknownTarget */
+ 'fields' => array(
+ array(
+ 'id' => 'override_templates_list_table',
+ 'type' => 'override_templates_list_table',
+ ),
+ ),
+ ),
),
),
- // backward compatibility option leave it disabled for better security and ability to exclude posts/terms pre-query
- // otherwise we filtering only results and restricted posts/terms can be visible
- array(
- 'id' => 'disable_restriction_pre_queries',
- 'type' => 'checkbox',
- 'label' => __( 'Disable pre-queries for restriction content logic (advanced)', 'ultimate-member' ),
- 'tooltip' => __( 'Please enable this option only in the cases when you have big or unnecessary queries on your site with active restriction logic. If you want to exclude posts only from the results queries instead of pre_get_posts and fully-hidden post logic also please enable this option. It activates the restriction content logic until 2.2.x version without latest security enhancements', 'ultimate-member' ),
+ 'features' => array(
+ 'title' => __( 'Features', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'features' => array(
+ 'title' => __( 'Features', 'ultimate-member' ),
+ 'description' => __( 'Start using new features that are being progressively rolled out to improve the users management experience.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'enable_blocks',
+ 'type' => 'checkbox',
+ 'label' => __( 'Gutenberg Blocks', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable Gutenberg Blocks', 'ultimate-member' ),
+ 'description' => __( 'Check this box if you would like to use Ultimate Member blocks in Gutenberg editor. Important some themes have the conflicts with Gutenberg editor.', 'ultimate-member' ),
+ ),
+ $same_page_update,
+ ),
+ ),
+ 'beta_features' => array(
+ 'title' => __( 'Experimental features', 'ultimate-member' ),
+ 'description' => __( 'These features are either experimental or incomplete, enable them at your own risk!', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'enable_new_ui',
+ 'type' => 'checkbox',
+ 'label' => __( 'Design scheme', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable new UI (for developers only)', 'ultimate-member' ),
+ 'description' => __( 'Check this box if you would like to enable new UI.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'enable_new_form_builder',
+ 'type' => 'checkbox',
+ 'label' => __( 'Form Builder', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable new Form Builder (for developers only)', 'ultimate-member' ),
+ 'description' => __( 'Check this box if you would like to enable new Form Builder.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'enable_legacy_fonticons',
+ 'type' => 'checkbox',
+ 'label' => __( 'Legacy fonticons', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable legacy fonticons', 'ultimate-member' ),
+ 'description' => __( 'Check this box if you would like to enable legacy Ultimate Member fonticons used outdated versions of FontAwesome and Ionicons libraries.', 'ultimate-member' ),
+ ),
+ ),
+ ),
+ 'legacy_features' => array(
+ 'title' => __( 'Legacy features', 'ultimate-member' ),
+ 'description' => __( 'These features are related to the legacy logic or functionality. Please enable them only for the backward compatibility.', 'ultimate-member' ),
+ 'fields' => array(
+ // backward compatibility option leave it disabled for better security and ability to exclude posts/terms pre-query
+ // otherwise we're filtering only results and restricted posts/terms can be visible
+ array(
+ 'id' => 'disable_restriction_pre_queries',
+ 'type' => 'checkbox',
+ 'label' => __( 'Restriction content pre-queries', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Disable pre-queries for restriction content logic', 'ultimate-member' ),
+ 'description' => __( 'Please enable this option only in the cases when you have big or unnecessary queries on your site with active restriction logic. If you want to exclude posts only from the results queries instead of pre_get_posts and fully-hidden post logic also please enable this option. It activates the restriction content logic until 2.2.x version without latest security enhancements.', 'ultimate-member' ),
+ ),
+ ),
+ ),
+ ),
),
- $same_page_update,
- array(
- 'id' => 'uninstall_on_delete',
- 'type' => 'checkbox',
- 'label' => __( 'Remove Data on Uninstall?', 'ultimate-member' ),
- 'tooltip' => __( 'Check this box if you would like Ultimate Member to completely remove all of its data when the plugin/extensions are deleted.', 'ultimate-member' ),
+ 'developers' => array(
+ 'title' => __( 'Developers', 'ultimate-member' ),
+ 'form_sections' => array(
+ 'developers' => array(
+ 'title' => __( 'Developers', 'ultimate-member' ),
+ 'description' => __( 'This section is designed to modify settings that are tailored for developers. If you are not a developer, please be cautious when changing these settings.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'allowed_choice_callbacks',
+ 'type' => 'textarea',
+ 'label' => __( 'Allowed Choice Callbacks (Enter one PHP function per line)', 'ultimate-member' ),
+ 'description' => __( 'This option lets you specify the choice callback functions to prevent anyone from using 3rd-party functions that may put your site at risk.', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => 'rest_api_version',
+ 'type' => 'select',
+ 'label' => __( 'REST API Version', 'ultimate-member' ),
+ 'description' => __( 'This controls the REST API version, we recommend to use the last version.', 'ultimate-member' ),
+ 'options' => array(
+ '1.0' => __( '1.0 version', 'ultimate-member' ),
+ '2.0' => __( '2.0 version', 'ultimate-member' ),
+ ),
+ ),
+ ),
+ ),
+ 'redirect' => array(
+ 'title' => __( 'Redirect', 'ultimate-member' ),
+ 'description' => __( 'Allows to manage redirect settings.', 'ultimate-member' ),
+ 'fields' => array(
+ array(
+ 'id' => 'allow_url_redirect_confirm',
+ 'type' => 'checkbox',
+ 'label' => __( 'Allow external link redirect confirm', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable JS.confirm for external links', 'ultimate-member' ),
+ 'description' => __( 'Using JS.confirm alert when you go to an external link.', 'ultimate-member' ),
+ ),
+ ),
+ ),
+ ),
),
),
),
- 'install_info' => array(
- 'title' => __( 'Install Info', 'ultimate-member' ),
- 'fields' => array(
- array(
- 'type' => 'install_info',
- ),
- ),
- ),
- 'override_templates' => array(
- 'title' => __( 'Override templates', 'ultimate-member' ),
- 'fields' => array(
- array(
- 'type' => 'override_templates',
- ),
- ),
+ 'system_info' => array(
+ 'title' => __( 'System info', 'ultimate-member' ),
+ 'link' => add_query_arg( array( 'tab' => 'debug' ), admin_url( 'site-health.php' ) ),
),
)
);
- }
+ if ( false === UM()->account()->is_notifications_tab_visible() ) {
+ unset( $this->settings_structure['']['sections']['account']['form_sections']['notifications_tab'] );
+ }
+ // Hide sub tab if there aren't custom templates in theme.
+ $custom_templates = UM()->common()->theme()->get_custom_templates_list();
+ if ( empty( $custom_templates ) ) {
+ unset( $this->settings_structure['advanced']['sections']['override_templates'] );
+ }
+
+ if ( defined( 'UM_DEV_MODE' ) && UM_DEV_MODE ) {
+
+ } else {
+ unset( $this->settings_structure['advanced']['sections']['features']['form_sections']['beta_features'] );
+ }
+ }
/**
* @param array $settings
@@ -1922,71 +2294,66 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
return $settings;
}
-
/**
* @param $tab
* @param $section
*
* @return array
*/
- function get_section_fields( $tab, $section ) {
+ public function get_section_fields( $tab, $section ) {
+ $custom_section_fields = apply_filters( 'um_settings_section_custom_fields', false, $tab, $section );
+ if ( false !== $custom_section_fields ) {
+ return $custom_section_fields;
+ }
if ( empty( $this->settings_structure[ $tab ] ) ) {
return array();
}
+ if ( ! empty( $this->settings_structure[ $tab ]['sections'][ $section ]['form_sections'] ) ) {
+ return array( 'form_sections' => $this->settings_structure[ $tab ]['sections'][ $section ]['form_sections'] );
+ }
+
if ( ! empty( $this->settings_structure[ $tab ]['sections'][ $section ]['fields'] ) ) {
return $this->settings_structure[ $tab ]['sections'][ $section ]['fields'];
- } elseif ( ! empty( $this->settings_structure[ $tab ]['fields'] ) ) {
+ }
+
+ if ( ! empty( $this->settings_structure[ $tab ]['form_sections'] ) ) {
+ return array( 'form_sections' => $this->settings_structure[ $tab ]['form_sections'] );
+ }
+
+ if ( ! empty( $this->settings_structure[ $tab ]['fields'] ) ) {
return $this->settings_structure[ $tab ]['fields'];
}
return array();
}
-
/**
- * Setup admin menu
+ * Settings page callback.
*/
- function primary_admin_menu() {
- add_submenu_page( 'ultimatemember', __( 'Settings', 'ultimate-member' ), __( 'Settings', 'ultimate-member' ), 'manage_options', 'um_options', array( &$this, 'settings_page' ) );
- }
-
-
- /**
- * Settings page callback
- */
- function settings_page() {
- $current_tab = empty( $_GET['tab'] ) ? '' : sanitize_key( $_GET['tab'] );
+ public function settings_page() {
+ $current_tab = empty( $_GET['tab'] ) ? '' : sanitize_key( $_GET['tab'] );
$current_subtab = empty( $_GET['section'] ) ? '' : sanitize_key( $_GET['section'] );
- $settings_struct = $this->settings_structure[ $current_tab ];
+ $temp_structure = $this->settings_structure; // Don't remove this temp variable. Internal workaround for Email Tab integration.
- //remove not option hidden fields
- if ( ! empty( $settings_struct['fields'] ) ) {
- foreach ( $settings_struct['fields'] as $field_key => $field_options ) {
+ $custom_content = apply_filters( 'um_settings_section_' . $current_tab . '_' . $current_subtab . '_custom_content', false, $current_tab, $current_subtab );
- if ( isset( $field_options['is_option'] ) && $field_options['is_option'] === false ) {
- unset( $settings_struct['fields'][ $field_key ] );
- }
-
- }
+ if ( false === $custom_content ) {
+ $section_fields = $this->get_section_fields( $current_tab, $current_subtab );
+ $settings_section = $this->render_settings_section( $section_fields, $current_tab, $current_subtab );
+ } else {
+ $settings_section = $custom_content;
}
- if ( empty( $settings_struct['fields'] ) && empty( $settings_struct['sections'] ) ) {
- um_js_redirect( add_query_arg( array( 'page' => 'um_options' ), admin_url( 'admin.php' ) ) );
- }
+ $this->settings_structure = $temp_structure; // Don't remove this temp variable. Internal workaround for Email Tab integration.
- if ( ! empty( $settings_struct['sections'] ) ) {
- if ( empty( $settings_struct['sections'][ $current_subtab ] ) ) {
- um_js_redirect( add_query_arg( array( 'page' => 'um_options', 'tab' => $current_tab ), admin_url( 'admin.php' ) ) );
- }
- }
-
- echo '
' . __( 'Ultimate Member - Settings', 'ultimate-member' ) . ' ';
+ echo '
' . esc_html__( 'Ultimate Member - Settings', 'ultimate-member' ) . ' ';
echo $this->generate_tabs_menu() . $this->generate_subtabs_menu( $current_tab );
+ echo '
';
/**
* UM hook
*
@@ -2004,158 +2371,99 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
* }
* ?>
*/
- do_action( "um_settings_page_before_" . $current_tab . "_" . $current_subtab . "_content" );
-
- if ( in_array( $current_tab, apply_filters('um_settings_custom_tabs', array( 'licenses', 'install_info', 'override_templates' ) ) ) || in_array( $current_subtab, apply_filters( 'um_settings_custom_subtabs', array(), $current_tab ) ) ) {
-
- /**
- * UM hook
- *
- * @type action
- * @title um_settings_page_{$current_tab}_{$current_subtab}_before_section
- * @description Show some content before section content at settings page
- * @change_log
- * ["Since: 2.0"]
- * @usage add_action( 'um_settings_page_{$current_tab}_{$current_subtab}_before_section', 'function_name', 10 );
- * @example
- *
- */
- do_action( "um_settings_page_" . $current_tab . "_" . $current_subtab . "_before_section" );
-
- $section_fields = $this->get_section_fields( $current_tab, $current_subtab );
- $settings_section = $this->render_settings_section( $section_fields, $current_tab, $current_subtab );
-
- /**
- * UM hook
- *
- * @type filter
- * @title um_settings_section_{$current_tab}_{$current_subtab}_content
- *
- * @description Render settings section
- * @input_vars
- * [{"var":"$content","type":"string","desc":"Section content"},
- * {"var":"$section_fields","type":"array","desc":"Section Fields"}]
- * @change_log
- * ["Since: 2.0"]
- * @usage add_filter( 'um_settings_section_{$current_tab}_{$current_subtab}_content', 'function_name', 10, 2 );
- * @example
- *
- */
- echo apply_filters( 'um_settings_section_' . $current_tab . '_' . $current_subtab . '_content',
- $settings_section,
- $section_fields
- );
-
- } else { ?>
+ do_action( "um_settings_page_before_{$current_tab}_{$current_subtab}_content" );
+ $form_wrapper = true;
+ if ( 'licenses' === $current_tab ) {
+ $form_wrapper = false;
+ }
+ if ( 'advanced' === $current_tab && 'override_templates' === $current_subtab ) {
+ $form_wrapper = false;
+ }
+ $form_wrapper = apply_filters( 'um_settings_default_form_wrapper', $form_wrapper, $current_tab, $current_subtab );
+ if ( $form_wrapper ) {
+ ?>
-
- ';
- $tabs = '
';
-
- switch( $page ) {
+ switch ( $page ) {
case 'settings':
$menu_tabs = array();
foreach ( $this->settings_structure as $slug => $tab ) {
if ( ! empty( $tab['fields'] ) ) {
foreach ( $tab['fields'] as $field_key => $field_options ) {
- if ( isset( $field_options['is_option'] ) && $field_options['is_option'] === false ) {
+ if ( isset( $field_options['is_option'] ) && false === $field_options['is_option'] ) {
unset( $tab['fields'][ $field_key ] );
}
}
}
- if ( ! empty( $tab['fields'] ) || ! empty( $tab['sections'] ) ) {
+ if ( ! empty( $tab['fields'] ) || ! empty( $tab['sections'] ) || ! empty( $tab['form_sections'] ) ) {
+ $menu_tabs[ $slug ] = $tab['title'];
+ } elseif ( ! empty( $tab['link'] ) ) {
$menu_tabs[ $slug ] = $tab['title'];
}
}
$current_tab = empty( $_GET['tab'] ) ? '' : sanitize_key( $_GET['tab'] );
foreach ( $menu_tabs as $name => $label ) {
- $active = ( $current_tab == $name ) ? 'nav-tab-active' : '';
- $tabs .= '' .
- $label .
- ' ';
+ if ( ! empty( $this->settings_structure[ $name ]['link'] ) ) {
+ $active = '';
+ $tab_url = $this->settings_structure[ $name ]['link'];
+ } else {
+ $active = $current_tab === $name ? 'nav-tab-active' : '';
+ $args = array( 'page' => 'um_options' );
+ if ( ! empty( $name ) ) {
+ $args['tab'] = $name;
+ }
+ $tab_url = add_query_arg( $args, admin_url( 'admin.php' ) );
+ }
+ $tabs .= '' . esc_html( $label ) . ' ';
}
break;
@@ -2184,39 +2492,49 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
break;
}
- return $tabs . ' ';
+ return $tabs . '';
}
-
/**
* @param string $tab
*
* @return string
*/
- function generate_subtabs_menu( $tab = '' ) {
+ private function generate_subtabs_menu( $tab = '' ) {
if ( empty( $this->settings_structure[ $tab ]['sections'] ) ) {
return '';
}
+ $current_tab = empty( $_GET['tab'] ) ? '' : sanitize_key( $_GET['tab'] );
+ $current_subtab = empty( $_GET['section'] ) ? '' : sanitize_key( $_GET['section'] );
+
$menu_subtabs = array();
foreach ( $this->settings_structure[ $tab ]['sections'] as $slug => $subtab ) {
$menu_subtabs[ $slug ] = $subtab['title'];
}
- $subtabs = '
';
-
- $current_tab = empty( $_GET['tab'] ) ? '' : sanitize_key( $_GET['tab'] );
- $current_subtab = empty( $_GET['section'] ) ? '' : sanitize_key( $_GET['section'] );
+ $subtabs = array();
foreach ( $menu_subtabs as $name => $label ) {
- $active = ( $current_subtab == $name ) ? 'current' : '';
- $subtabs .= ''
- . $label .
- ' | ';
+ $active = $current_subtab === $name ? 'current' : '';
+
+ $args = array( 'page' => 'um_options' );
+ if ( ! empty( $current_tab ) ) {
+ $args['tab'] = $current_tab;
+ }
+ if ( ! empty( $name ) ) {
+ $args['section'] = $name;
+ }
+ $tab_url = add_query_arg( $args, admin_url( 'admin.php' ) );
+
+ $subtabs[] = '' . esc_html( $label ) . ' ';
}
- return substr( $subtabs, 0, -3 ) . ' ';
- }
+ if ( empty( $subtabs ) ) {
+ return '';
+ }
+ return '
' . implode( ' | ', $subtabs ) . ' ';
+ }
/**
* Handler for settings forms
@@ -2318,8 +2636,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
}
}
-
- function set_default_if_empty( $settings ) {
+ public function set_default_if_empty( $settings ) {
$tab = '';
if ( ! empty( $_GET['tab'] ) ) {
$tab = sanitize_key( $_GET['tab'] );
@@ -2330,7 +2647,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$section = sanitize_key( $_GET['section'] );
}
-
if ( 'access' === $tab && empty( $section ) ) {
if ( ! array_key_exists( 'access_exclude_uris', $settings ) ) {
$settings['access_exclude_uris'] = array();
@@ -2340,14 +2656,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
return $settings;
}
-
/**
- * Remove empty values from multi text fields
+ * Remove empty values from multi text fields.
*
- * @param $settings
+ * @param array $settings
* @return array
*/
- function remove_empty_values( $settings ) {
+ public function remove_empty_values( $settings ) {
$tab = '';
if ( ! empty( $_GET['tab'] ) ) {
$tab = sanitize_key( $_GET['tab'] );
@@ -2358,9 +2673,25 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$section = sanitize_key( $_GET['section'] );
}
- if ( isset( $this->settings_structure[ $tab ]['sections'][ $section ]['fields'] ) ) {
+ if ( ! empty( $this->settings_structure[ $tab ]['sections'][ $section ]['form_sections'] ) ) {
+ $fields = array();
+ foreach ( $this->settings_structure[ $tab ]['sections'][ $section ]['form_sections'] as $section_key => $section_data ) {
+ if ( ! empty( $section_data['fields'] ) ) {
+ $fields[] = $section_data['fields'];
+ }
+ }
+ $fields = array_merge( ...$fields );
+ } elseif ( ! empty( $this->settings_structure[ $tab ]['sections'][ $section ]['fields'] ) ) {
$fields = $this->settings_structure[ $tab ]['sections'][ $section ]['fields'];
- } else {
+ } elseif ( ! empty( $this->settings_structure[ $tab ]['form_sections'] ) ) {
+ $fields = array();
+ foreach ( $this->settings_structure[ $tab ]['form_sections'] as $section_key => $section_data ) {
+ if ( ! empty( $section_data['fields'] ) ) {
+ $fields[] = $section_data['fields'];
+ }
+ }
+ $fields = array_merge( ...$fields );
+ } elseif ( ! empty( $this->settings_structure[ $tab ]['fields'] ) ) {
$fields = $this->settings_structure[ $tab ]['fields'];
}
@@ -2368,15 +2699,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
return $settings;
}
-
$filtered_settings = array();
foreach ( $settings as $key => $value ) {
-
$filtered_settings[ $key ] = $value;
foreach ( $fields as $field ) {
- if ( $field['id'] == $key && isset( $field['type'] ) && $field['type'] == 'multi_text' ) {
- $filtered_settings[ $key ] = array_filter( $settings[ $key ] );
+ if ( $field['id'] === $key && array_key_exists( 'type', $field ) && 'multi_text' === $field['type'] ) {
+ $filtered_settings[ $key ] = array_filter( $value );
}
}
}
@@ -2384,7 +2713,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
return $filtered_settings;
}
-
/**
*
*/
@@ -2541,12 +2869,10 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
}
}
}
-
}
}
}
-
/**
*
*/
@@ -2560,7 +2886,6 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
}
}
-
/**
*
*/
@@ -2591,13 +2916,13 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
}
$item_name = false;
- $version = false;
- $author = false;
+ $version = false;
+ $author = false;
foreach ( $this->settings_structure['licenses']['fields'] as $field_data ) {
if ( $field_data['id'] == $key ) {
$item_name = ! empty( $field_data['item_name'] ) ? $field_data['item_name'] : false;
- $version = ! empty( $field_data['version'] ) ? $field_data['version'] : false;
- $author = ! empty( $field_data['author'] ) ? $field_data['author'] : false;
+ $version = ! empty( $field_data['version'] ) ? $field_data['version'] : false;
+ $author = ! empty( $field_data['author'] ) ? $field_data['author'] : false;
}
}
@@ -2615,7 +2940,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
array(
'timeout' => UM()->request_timeout,
'sslverify' => false,
- 'body' => $api_params
+ 'body' => $api_params,
)
);
@@ -2627,7 +2952,7 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
array(
'timeout' => UM()->request_timeout,
'sslverify' => true,
- 'body' => $api_params
+ 'body' => $api_params,
)
);
@@ -2638,44 +2963,86 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
$request = ( $request ) ? maybe_unserialize( $request ) : false;
- if ( $edd_action == 'activate_license' || $edd_action == 'check_license' ) {
+ if ( in_array( $edd_action, array( 'activate_license', 'check_license' ), true ) ) {
update_option( "{$key}_edd_answer", $request );
} else {
delete_option( "{$key}_edd_answer" );
}
-
}
}
-
/**
- *
+ * Adds email notifications list table before the email options list.
*/
- function settings_before_email_tab() {
+ public function settings_before_email_tab() {
$email_key = empty( $_GET['email'] ) ? '' : sanitize_key( $_GET['email'] );
- $emails = UM()->config()->email_notifications;
+ $emails = UM()->config()->email_notifications;
if ( empty( $email_key ) || empty( $emails[ $email_key ] ) ) {
include_once UM_PATH . 'includes/admin/core/list-tables/emails-list-table.php';
}
}
-
/**
- * @param $section
+ * Set settings field per email notification.
*
- * @return string
+ * @param bool|array $section_fields
+ * @param string $tab
+ *
+ * @return bool|array
*/
- function settings_email_tab( $section ) {
+ public function email_section_custom_fields( $section_fields, $tab ) {
+ if ( 'email' !== $tab ) {
+ return $section_fields;
+ }
+
$email_key = empty( $_GET['email'] ) ? '' : sanitize_key( $_GET['email'] );
- $emails = UM()->config()->email_notifications;
+ $emails = UM()->config()->email_notifications;
if ( empty( $email_key ) || empty( $emails[ $email_key ] ) ) {
- return $section;
+ return $section_fields;
}
$in_theme = UM()->mail()->template_in_theme( $email_key );
+ $back_link = add_query_arg(
+ array(
+ 'page' => 'um_options',
+ 'tab' => 'email',
+ ),
+ admin_url( 'admin.php' )
+ );
+
+ $this->settings_structure['email']['title'] = '
← ' . $emails[ $email_key ]['title'];
+ $this->settings_structure['email']['description'] = $emails[ $email_key ]['description'];
+
+ $section_fields = array(
+ array(
+ 'id' => 'um_email_template',
+ 'type' => 'hidden',
+ 'value' => $email_key,
+ ),
+ array(
+ 'id' => $email_key . '_on',
+ 'type' => 'checkbox',
+ 'label' => __( 'Enable/Disable', 'ultimate-member' ),
+ 'checkbox_label' => __( 'Enable this email notification', 'ultimate-member' ),
+ ),
+ array(
+ 'id' => $email_key . '_sub',
+ 'type' => 'text',
+ 'label' => __( 'Subject', 'ultimate-member' ),
+ 'conditional' => array( $email_key . '_on', '=', 1 ),
+ ),
+ array(
+ 'id' => $email_key,
+ 'type' => 'email_template',
+ 'label' => __( 'Email Content', 'ultimate-member' ),
+ 'conditional' => array( $email_key . '_on', '=', 1 ),
+ 'value' => UM()->mail()->get_email_template( $email_key ),
+ 'in_theme' => $in_theme,
+ ),
+ );
/**
* UM hook
*
@@ -2697,73 +3064,55 @@ if ( ! class_exists( 'um\admin\core\Admin_Settings' ) ) {
* }
* ?>
*/
- $section_fields = apply_filters( 'um_admin_settings_email_section_fields', array(
- array(
- 'id' => 'um_email_template',
- 'type' => 'hidden',
- 'value' => $email_key,
- ),
- array(
- 'id' => $email_key . '_on',
- 'type' => 'checkbox',
- 'label' => $emails[ $email_key ]['title'],
- 'tooltip' => $emails[ $email_key ]['description'],
- ),
- array(
- 'id' => $email_key . '_sub',
- 'type' => 'text',
- 'label' => __( 'Subject Line', 'ultimate-member' ),
- 'conditional' => array( $email_key . '_on', '=', 1 ),
- 'tooltip' => __( 'This is the subject line of the e-mail', 'ultimate-member' ),
- ),
- array(
- 'id' => $email_key,
- 'type' => 'email_template',
- 'label' => __( 'Message Body', 'ultimate-member' ),
- 'conditional' => array( $email_key . '_on', '=', 1 ),
- 'tooltip' => __( 'This is the content of the e-mail', 'ultimate-member' ),
- 'value' => UM()->mail()->get_email_template( $email_key ),
- 'in_theme' => $in_theme
- ),
- ), $email_key );
-
- return $this->render_settings_section( $section_fields, 'email', $email_key );
+ return apply_filters( 'um_admin_settings_email_section_fields', $section_fields, $email_key );
}
-
/**
+ * @param bool $html
+ * @param string $current_tab
+ * @param string $current_subtab
*
+ * @return bool|string
*/
- function settings_appearance_profile_tab() {
- wp_enqueue_media();
- }
-
-
- /**
- * @param $html
- * @param $section_fields
- *
- * @return string
- */
- function settings_licenses_tab( $html, $section_fields ) {
- ob_start(); ?>
+ public function settings_licenses_tab( $html, $current_tab, $current_subtab ) {
+ $section_fields = $this->get_section_fields( $current_tab, $current_subtab );
+ if ( empty( $section_fields ) ) {
+ return $html;
+ }
+ $um_settings_nonce = wp_create_nonce( 'um-settings-nonce' );
+ ob_start();
+ ?>