/**
  * Adds the directory post type.
  * This handles the creation of user directories.
  *
  * @access public
  * @since 1.0.0
  * @return void
  */
 public function meta_options()
 {
     $general_options = array('id' => 'wpum_directory_general_options', 'title' => __('General Settings', 'wpum'), 'pages' => array('wpum_directory'), 'fields' => array(array('id' => 'directory_roles', 'name' => __('User Roles', 'wpum'), 'sub' => __('Leave blank to display all user roles.', 'wpum'), 'desc' => __('Select the user roles you wish to display into this directory.', 'wpum'), 'type' => 'multiselect', 'options' => wpum_get_roles(true)), array('id' => 'display_search_form', 'name' => __('Display search form', 'wpum'), 'desc' => __('Enable this option to display the user search form', 'wpum'), 'type' => 'checkbox', 'std' => 1), array('id' => 'excluded_ids', 'name' => __('Exclude users', 'wpum'), 'sub' => __('Comma separated list of users id you wish to exclude.', 'wpum'), 'desc' => sprintf(__(' Example: type %s to exclude users with those id(s).', 'wpum'), '<code>1, 6, 89</code>'), 'type' => 'text'), array('id' => 'profiles_per_page', 'name' => __('Profiles per page', 'wpum'), 'sub' => __('Select how many profiles you wish to display per page.', 'wpum'), 'type' => 'number', 'std' => 10), array('id' => 'directory_template', 'name' => __('Directory Template', 'wpum'), 'desc' => __('Select a template from the list.', 'wpum'), 'type' => 'select', 'options' => wpum_get_directory_templates())));
     // Create the new metabox
     $this->general_options = new Pretty_Metabox(apply_filters('wpum_directory_general_options', $general_options));
     // Build the sorting metabox options
     $sorting_options = array('id' => 'wpum_directory_sorting_options', 'title' => __('Users sorting', 'wpum'), 'pages' => array('wpum_directory'), 'fields' => array(array('id' => 'display_sorter', 'name' => __('Display sorter', 'wpum'), 'desc' => __('Enable this setting to display a dropdown menu into the directory with the sorting options.', 'wpum'), 'type' => 'checkbox', 'std' => 1), array('id' => 'display_amount', 'name' => __('Display amount filter', 'wpum'), 'desc' => __('Enable this setting to display a dropdown menu into the directory with the results amount filter.', 'wpum'), 'type' => 'checkbox', 'std' => 1), array('id' => 'default_sorting_method', 'name' => __('Sorting method', 'wpum'), 'sub' => __('Select the sorting method for the directory', 'wpum'), 'desc' => __('If the sorter field is visible, this will be used as default option.', 'wpum'), 'type' => 'select', 'std' => 'newest', 'options' => wpum_get_directory_sorting_methods())));
     // Create the new metabox
     $this->sorting_options = new Pretty_Metabox(apply_filters('wpum_directory_general_options', $sorting_options));
 }
/**
 * Retrieve the array of plugin settings
 *
 * @since 1.0.0
 * @return array
*/
function wpum_get_registered_settings()
{
    /**
     * 'Whitelisted' WPUM settings, filters are provided for each settings
     * section to allow extensions and other plugins to add their own settings
     */
    $wpum_settings = array('general' => apply_filters('wpum_settings_general', array('header1' => array('id' => 'header1', 'name' => __('Pages Setup', 'wpum'), 'type' => 'header'), 'login_page' => array('id' => 'login_page', 'name' => __('Login page:', 'wpum'), 'desc' => __('Select the page where you have added the login shortcode.', 'wpum'), 'type' => 'select', 'class' => 'select2', 'options' => wpum_get_pages()), 'password_recovery_page' => array('id' => 'password_recovery_page', 'name' => __('Password recovery page:', 'wpum'), 'desc' => __('Select the page where you have added the password recovery shortcode.', 'wpum'), 'type' => 'select', 'class' => 'select2', 'options' => wpum_get_pages()), 'registration_page' => array('id' => 'registration_page', 'name' => __('Registration page:', 'wpum'), 'desc' => __('Select the page where you have added the registration shortcode.', 'wpum'), 'type' => 'select', 'class' => 'select2', 'options' => wpum_get_pages()), 'account_page' => array('id' => 'account_page', 'name' => __('Account page:', 'wpum'), 'desc' => __('Select the page where you have added the account shortcode.', 'wpum'), 'type' => 'select', 'class' => 'select2', 'options' => wpum_get_pages()), 'profile_page' => array('id' => 'profile_page', 'name' => __('Profile page:', 'wpum'), 'desc' => __('Select the page where you have added the profile shortcode.', 'wpum'), 'type' => 'select', 'class' => 'select2', 'options' => wpum_get_pages()), 'header3' => array('id' => 'header3', 'name' => __('Passwords Setup', 'wpum'), 'type' => 'header'), 'password_strength' => array('id' => 'password_strength', 'name' => __('Minimum Password Strength:', 'wpum'), 'desc' => __('Select the required password strength. This will be forced on registration and account page.', 'wpum'), 'type' => 'select', 'options' => wpum_get_psw_lengths()), 'display_password_meter_registration' => array('id' => 'display_password_meter_registration', 'name' => __('Display password meter:', 'wpum'), 'desc' => __('Enable to display a password meter on registration page and account page.', 'wpum'), 'type' => 'checkbox'), 'header_n' => array('id' => 'header_n', 'name' => __('Extra', 'wpum'), 'type' => 'header'), 'login_method' => array('id' => 'login_method', 'name' => __('Allow users to login with:', 'wpum'), 'type' => 'select', 'options' => wpum_get_login_methods()), 'display_registration_link' => array('id' => 'display_registration_link', 'name' => __('Display registration link:', 'wpum'), 'desc' => __('Enable to display a registration link into the login form.', 'wpum'), 'type' => 'checkbox'), 'display_password_link' => array('id' => 'display_password_link', 'name' => __('Display password recovery link:', 'wpum'), 'desc' => __('Enable to display a password recovery link into the login form.', 'wpum'), 'type' => 'checkbox'), 'adminbar_roles' => array('id' => 'adminbar_roles', 'name' => __('Admin Bar:', 'wpum'), 'desc' => __('Hide admin bar for specific user roles.', 'wpum'), 'type' => 'multiselect', 'placeholder' => __('Select the user roles from the list.', 'wpum'), 'class' => 'select2_multiselect', 'options' => wpum_get_roles()))), 'registration' => apply_filters('wpum_settings_registration', array('registration_status' => array('id' => 'registration_status', 'name' => __('Registrations Status:', 'wpum'), 'type' => 'hook'), 'registration_role' => array('id' => 'registration_role', 'name' => __('Default user registration role:', 'wpum'), 'type' => 'hook'), 'custom_passwords' => array('id' => 'custom_passwords', 'name' => __('Users custom passwords:', 'wpum'), 'desc' => __('Enable to allow users to set custom passwords on the registration page.', 'wpum'), 'type' => 'checkbox'), 'allow_role_select' => array('id' => 'allow_role_select', 'name' => __('Allow role section:', 'wpum'), 'desc' => __('Enable to allow users to select a user role on registration.', 'wpum'), 'type' => 'checkbox'), 'register_roles' => array('id' => 'register_roles', 'name' => __('Allowed Roles:', 'wpum'), 'desc' => __('Select which roles can be selected upon registration.', 'wpum'), 'type' => 'multiselect', 'placeholder' => __('Select the user roles from the list.', 'wpum'), 'class' => 'select2_multiselect', 'options' => wpum_get_roles()), 'header4' => array('id' => 'header4', 'name' => __('Terms &amp; Conditions', 'wpum'), 'type' => 'header'), 'enable_terms' => array('id' => 'enable_terms', 'name' => __('Enable terms &amp conditions:', 'wpum'), 'desc' => __('Enable to force users to agree to your terms before registering an account.', 'wpum'), 'type' => 'checkbox'), 'terms_page' => array('id' => 'terms_page', 'name' => __('Terms Page:', 'wpum'), 'desc' => __('Select the page that contains your terms.', 'wpum'), 'type' => 'select', 'class' => 'select2', 'options' => wpum_get_pages()), 'header5' => array('id' => 'header5', 'name' => __('Extra', 'wpum'), 'type' => 'header'), 'enable_honeypot' => array('id' => 'enable_honeypot', 'name' => __('Anti-spam Honeypot:', 'wpum'), 'desc' => __('Enables honeypot spam protection technique.', 'wpum'), 'type' => 'checkbox'), 'login_after_registration' => array('id' => 'login_after_registration', 'name' => __('Login after registration:', 'wpum'), 'desc' => __('Enable this option to authenticate users after registration.', 'wpum'), 'type' => 'checkbox'))), 'emails' => apply_filters('wpum_settings_emails', array('from_name' => array('id' => 'from_name', 'name' => __('From Name:', 'wpum'), 'desc' => __('The name emails are said to come from. This should probably be your site name.', 'wpum'), 'type' => 'text', 'std' => get_option('blogname')), 'from_email' => array('id' => 'from_email', 'name' => __('From Email:', 'wpum'), 'desc' => __('This will act as the "from" and "reply-to" address.', 'wpum'), 'type' => 'text', 'std' => get_option('admin_email')), 'email_template' => array('id' => 'email_template', 'name' => __('Email Template', 'wpum'), 'desc' => __('Choose a template.', 'wpum'), 'type' => 'select', 'options' => wpum_get_email_templates()), 'emails_editor' => array('id' => 'emails_editor', 'name' => __('Emails Editor:', 'wpum'), 'type' => 'hook'), 'header6' => array('id' => 'header6', 'name' => __('Notifications Settings', 'wpum'), 'type' => 'header'), 'disable_admin_register_email' => array('id' => 'disable_admin_register_email', 'name' => __('Disable admin registration email:', 'wpum'), 'desc' => __('Enable this option to stop receiving notifications when a new user registers.', 'wpum'), 'type' => 'checkbox'), 'disable_admin_password_recovery_email' => array('id' => 'disable_admin_password_recovery_email', 'name' => __('Disable admin password recovery email:', 'wpum'), 'desc' => __('Enable this option to stop receiving notifications when a new user resets his password.', 'wpum'), 'type' => 'checkbox'))), 'profile' => apply_filters('wpum_settings_profile', array('profile_permalinks' => array('id' => 'profile_permalinks', 'name' => __('Profile permalink:', 'wpum'), 'type' => 'hook'), 'guests_can_view_profiles' => array('id' => 'guests_can_view_profiles', 'name' => __('Allow guests to view profiles', 'wpum'), 'desc' => __('Enable this option to allow guests to view users profiles.', 'wpum'), 'type' => 'checkbox'), 'members_can_view_profiles' => array('id' => 'members_can_view_profiles', 'name' => __('Allow members to view profiles', 'wpum'), 'desc' => __('Enable this option to allow members to view users profiles. If disabled, users can only see their own profile.', 'wpum'), 'type' => 'checkbox'), 'custom_avatars' => array('id' => 'custom_avatars', 'name' => __('Custom Avatars', 'wpum'), 'desc' => __('Enable this option to allow users to upload custom avatars for their profiles.', 'wpum') . wpum_check_permissions_button(), 'type' => 'checkbox'), 'profile_posts' => array('id' => 'profile_posts', 'name' => __('Display posts', 'wpum'), 'desc' => __('Enable this option to display users submitted post on their profile page.', 'wpum'), 'type' => 'checkbox'), 'profile_comments' => array('id' => 'profile_comments', 'name' => __('Display comments', 'wpum'), 'desc' => __('Enable this option to display users submitted comments on their profile page.', 'wpum'), 'type' => 'checkbox'))), 'redirects' => apply_filters('wpum_settings_redirects', array('login_redirect' => array('id' => 'login_redirect', 'name' => __('Login redirect:', 'wpum'), 'desc' => __('Select the page where you want to redirect users after they login. If empty will return to the current page.', 'wpum'), 'type' => 'select', 'class' => 'select2', 'options' => wpum_get_pages()), 'logout_redirect' => array('id' => 'logout_redirect', 'name' => __('Logout redirect:', 'wpum'), 'desc' => __('Select the page where you want to redirect users after they logout. If empty will return to wp-login.php', 'wpum'), 'type' => 'select', 'class' => 'select2', 'options' => wpum_get_pages()), 'wp_login_signup_redirect' => array('id' => 'wp_login_signup_redirect', 'name' => __('Backend register redirect:', 'wpum'), 'desc' => sprintf(__('Select a page if you wish to redirect users who try to signup through <a href="%s">the default registration page on wp-login.php</a>', 'wpum'), site_url('wp-login.php?action=register')), 'type' => 'select', 'class' => 'select2', 'options' => wpum_get_pages()), 'backend_profile_redirect' => array('id' => 'backend_profile_redirect', 'name' => __('Backend profile redirect:', 'wpum'), 'desc' => __('Select the page where you want to redirect users who try to access their profile on the backend.', 'wpum'), 'type' => 'select', 'class' => 'select2', 'options' => wpum_get_pages()))), 'extensions' => apply_filters('wpum_settings_extensions', array()), 'tools' => apply_filters('wpum_settings_tools', array('restore_emails' => array('id' => 'restore_emails', 'name' => __('Restore default emails:', 'wpum'), 'type' => 'hook'), 'restore_pages' => array('id' => 'restore_pages', 'name' => __('Restore Pages:', 'wpum'), 'type' => 'hook'), 'exclude_usernames' => array('id' => 'exclude_usernames', 'name' => __('Excluded usernames:', 'wpum'), 'desc' => '<br/>' . __('Enter the usernames that you wish to disable. Separate each username on a new line.', 'wpum'), 'type' => 'textarea'))));
    return apply_filters('wpum_registered_settings', $wpum_settings);
}