'pages_settings', 'type' => 'hidden', 'default' => true, 'is_option' => false ) ); $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', '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', 'label' => sprintf( __( '%s page', 'ultimate-member' ), $page_title ), 'options' => UM()->query()->wp_pages(), 'placeholder' => __('Choose a page...','ultimate-member'), 'compiler' => true, 'size' => 'small' ); } } $appearances_profile_menu_fields = array( array( 'id' => 'profile_menu', 'type' => 'checkbox', 'label' => __('Enable profile menu','ultimate-member'), ) ); $tabs = UM()->profile()->tabs_primary(); foreach( $tabs as $id => $tab ) { $appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array( array( 'id' => 'profile_tab_' . $id, 'type' => 'checkbox', 'label' => sprintf(__('%s Tab','ultimate-member'), $tab ), 'conditional' => array( 'profile_menu', '=', 1 ), ), array( 'id' => 'profile_tab_' . $id . '_privacy', 'type' => 'select', 'label' => sprintf( __( 'Who can see %s Tab?','ultimate-member' ), $tab ), 'tooltip' => __( 'Select which users can view this tab.','ultimate-member' ), 'options' => UM()->profile()->tabs_privacy(), 'conditional' => array( 'profile_tab_' . $id, '=', 1 ), 'size' => 'small' ), array( 'id' => 'profile_tab_' . $id . '_roles', 'type' => 'select', 'multi' => true, 'label' => __( 'Allowed roles','ultimate-member' ), 'tooltip' => __( 'Select the the user roles allowed to view this tab.','ultimate-member' ), 'options' => UM()->roles()->get_roles(), 'placeholder' => __( 'Choose user roles...','ultimate-member' ), 'conditional' => array( 'profile_tab_' . $id . '_privacy', '=', 4 ), 'size' => 'small' ) ) ); } $appearances_profile_menu_fields = array_merge( $appearances_profile_menu_fields, array( array( 'id' => 'profile_menu_default_tab', 'type' => 'select', 'label' => __( 'Profile menu default tab','ultimate-member' ), 'tooltip' => __( 'This will be the default tab on user profile page','ultimate-member' ), 'options' => UM()->profile()->tabs_enabled(), 'conditional' => array( 'profile_menu', '=', 1 ), 'size' => 'small' ), array( 'id' => 'profile_menu_icons', 'type' => 'checkbox', 'label' => __('Enable menu icons in desktop view','ultimate-member'), 'conditional' => array( 'profile_menu', '=', 1 ), ) ) ); $all_post_types = get_post_types( array( 'public' => true ) ); $all_taxonomies = get_taxonomies( array( 'public' => true ) ); $exclude_taxonomies = UM()->excluded_taxonomies(); foreach ( $all_taxonomies as $key => $taxonomy ) { if( in_array( $key , $exclude_taxonomies ) ) unset( $all_taxonomies[$key] ); } $restricted_access_post_metabox_value = array(); if ( $restricted_access_post_metabox = UM()->options()->get( 'restricted_access_post_metabox' ) ) { foreach ( $restricted_access_post_metabox as $key => $value ) { if ( $value ) $restricted_access_post_metabox_value[] = $key; } } $restricted_access_taxonomy_metabox_value = array(); if ( $restricted_access_taxonomy_metabox = UM()->options()->get( 'restricted_access_taxonomy_metabox' ) ) { foreach ( $restricted_access_taxonomy_metabox as $key => $value ) { if ( $value ) $restricted_access_taxonomy_metabox_value[] = $key; } } /** * UM hook * * @type filter * @title um_settings_structure * @description Extend UM Settings * @input_vars * [{"var":"$settings","type":"array","desc":"UM Settings"}] * @change_log * ["Since: 2.0"] * @usage add_filter( 'um_settings_structure', 'function_name', 10, 1 ); * @example * */ $this->settings_structure = apply_filters( 'um_settings_structure', array( '' => array( 'title' => __( 'General', 'ultimate-member' ), 'sections' => array( '' => array( 'title' => __( 'Pages', 'ultimate-member' ), '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' ), 'tooltip' => __( 'Here you can control the permalink structure of the user profile URL globally e.g. ' . trailingslashit( um_get_core_page('user') ) . 'username/','ultimate-member' ), 'options' => array( 'user_login' => __('Username','ultimate-member'), 'name' => __('First and Last Name with \'.\'','ultimate-member'), 'name_dash' => __('First and Last Name with \'-\'','ultimate-member'), 'name_plus' => __('First and Last Name with \'+\'','ultimate-member'), 'user_id' => __('User ID','ultimate-member'), ), 'placeholder' => __('Select...','ultimate-member'), ), 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' => array( 'default' => __('Default WP Display Name','ultimate-member'), 'nickname' => __('Nickname','ultimate-member'), 'username' => __('Username','ultimate-member'), 'full_name' => __('First name & last name','ultimate-member'), 'sur_name' => __('Last name & first name','ultimate-member'), 'initial_name' => __('First name & first initial of last name','ultimate-member'), 'initial_name_f' => __('First initial of first name & last name','ultimate-member'), 'first_name' => __('First name only','ultimate-member'), 'field' => __('Custom field(s)','ultimate-member'), ), 'placeholder' => __('Select...'), ), 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' ), ), 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' => 'reset_require_strongpass', 'type' => 'checkbox', 'label' => __( 'Require a strong password? (when user resets password only)','ultimate-member' ), 'tooltip' => __('Enable or disable a strong password rules on password reset and change procedure','ultimate-member'), ) ) ), 'account' => array( 'title' => __( 'Account', 'ultimate-member' ), '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', ), 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'), ), 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'), ), 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','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_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'), ), array( 'id' => 'account_require_strongpass', 'type' => 'checkbox', 'label' => __( 'Require a strong password?','ultimate-member' ), 'tooltip' => __('Enable or disable a strong password rules on account page / change password tab','ultimate-member'), ) ) ), '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' ), ), 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' ), ), 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_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' ), ), ) ) ) ), 'access' => array( 'title' => __( 'Access', 'ultimate-member' ), 'sections' => array( '' => array( 'title' => __( 'Restriction Content', 'ultimate-member' ), 'fields' => array( array( 'id' => 'accessible', 'type' => 'select', 'label' => __( 'Global Site Access','ultimate-member' ), 'tooltip' => __('Globally control the access of your site, you can have seperate restrict options per post/page by editing the desired item.','ultimate-member'), 'options' => array( 0 => 'Site accessible to Everyone', 2 => 'Site accessible to Logged In Users' ), 'size' => 'medium' ), array( 'id' => 'access_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'), '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' ), 'add_text' => __('Add New URL','ultimate-member'), 'conditional' => array( 'accessible', '=', 2 ), 'show_default_number' => 1, ), array( 'id' => 'home_page_accessible', 'type' => 'checkbox', 'label' => __( 'Allow Homepage to be accessible','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 ), ), 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' ), ), array( 'id' => 'restricted_access_post_metabox', 'type' => 'hidden', 'value' => '', ), array( 'id' => 'restricted_access_taxonomy_metabox', 'type' => 'hidden', 'value' => '', ), array( 'id' => 'restricted_access_post_metabox', 'type' => 'multi_checkbox', 'label' => __( 'Restricted Access to Posts','ultimate-member' ), 'tooltip' => __( 'Restriction content of the current Posts','ultimate-member' ), 'options' => $all_post_types, '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' => __( 'Restricted Access to Taxonomies','ultimate-member' ), 'tooltip' => __( 'Restriction content of the current Taxonomies','ultimate-member' ), 'options' => $all_taxonomies, 'columns' => 3, 'value' => $restricted_access_taxonomy_metabox_value, 'default' => UM()->options()->get_default( 'restricted_access_taxonomy_metabox' ), ), ) ), 'other' => array( 'title' => __( 'Other', 'ultimate-member' ), 'fields' => array( array( 'id' => 'enable_reset_password_limit', 'type' => 'checkbox', 'label' => __( 'Enable the Reset Password Limit?','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' => 'um-small-field', ), array( 'id' => 'blocked_emails', 'type' => 'textarea', 'label' => __( 'Blocked Email Addresses','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','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'), ) ) ), ) ), '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' ), ), 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'), ) ) ), 'appearance' => array( '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', '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' ), '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', ), ), 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' => 'profile_photosize', 'type' => 'text', 'label' => __( 'Profile Photo Size','ultimate-member' ), 'default' => um_get_metadefault('profile_photosize'), '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' => 1, 'tooltip' => __('Switch on/off the profile cover photos','ultimate-member'), ), 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', ), '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' ), 'default' => um_get_metadefault('profile_show_html_bio'), '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', 'lc' => 'Left of Icon', ), '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'), ), 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 ), ) ) ), 'profile_menu' => array( 'title' => __( 'Profile Menu', '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' ), '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'), 'left' => __('Left aligned'), 'right' => __('Right aligned'), ), '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'), 'label' => __('Show with label'), 'off' => __('Turn off'), ), '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( $add_default = 'Default' ), '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'), ), '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'), ), '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'), ) ) ) ) ), 'extensions' => array( 'title' => __( 'Extensions', 'ultimate-member' ) ), '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 ) ), 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' ), ) ) ), 'install_info' => array( 'title' => __( 'Install Info', 'ultimate-member' ), 'fields' => array( array( 'type' => 'install_info', ), ) ), ) ); } /** * @param $settings * * @return mixed */ function sorting_licenses_options( $settings ) { //sorting licenses if ( empty( $settings['licenses']['fields'] ) ) { return $settings; } $licenses = $settings['licenses']['fields']; @uasort( $licenses, function( $a, $b ) { return strnatcasecmp( $a["label"], $b["label"] ); } ); $settings['licenses']['fields'] = $licenses; //sorting extensions if ( empty( $settings['extensions']['sections'] ) ) { return $settings; } $extensions = $settings['extensions']['sections']; @uasort( $extensions, function( $a, $b ) { return strnatcasecmp( $a["title"], $b["title"] ); } ); $keys = array_keys( $extensions ); if ( $keys[0] != "" ) { $new_key = strtolower( str_replace( " ", "_", $extensions[""]['title'] ) ); $temp = $extensions[""]; $extensions[$new_key] = $temp; $extensions[""] = $extensions[$keys[0]]; unset( $extensions[$keys[0]] ); @uasort( $extensions, function( $a, $b ) { return strnatcasecmp( $a["title"], $b["title"] ); } ); } $settings['extensions']['sections'] = $extensions; return $settings; } /** * @param $tab * @param $section * * @return array */ function get_section_fields( $tab, $section ) { if ( empty( $this->settings_structure[ $tab ] ) ) { return array(); } if ( ! empty( $this->settings_structure[ $tab ]['sections'][ $section ]['fields'] ) ) { return $this->settings_structure[ $tab ]['sections'][ $section ]['fields']; } elseif ( ! empty( $this->settings_structure[ $tab ]['fields'] ) ) { return $this->settings_structure[ $tab ]['fields']; } return array(); } /** * Setup admin menu */ 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'] ) ? '' : urldecode( $_GET['tab'] ); $current_subtab = empty( $_GET['section'] ) ? '' : urldecode( $_GET['section'] ); $settings_struct = $this->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'] ) && $field_options['is_option'] === false ) unset( $settings_struct['fields'][$field_key] ); } } if ( empty( $settings_struct['fields'] ) && empty( $settings_struct['sections'] ) ) um_js_redirect( add_query_arg( array( 'page' => 'um_options' ), admin_url( 'admin.php' ) ) ); 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 '