• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP um_get_core_page函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中um_get_core_page函数的典型用法代码示例。如果您正苦于以下问题:PHP um_get_core_page函数的具体用法?PHP um_get_core_page怎么用?PHP um_get_core_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了um_get_core_page函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: um_block_wpadmin_for_guests

function um_block_wpadmin_for_guests()
{
    global $pagenow;
    if (isset($_REQUEST['um_panic_key']) && $_REQUEST['um_panic_key'] == um_get_option('panic_key')) {
        exit(wp_redirect(add_query_arg('_verified_key', $_REQUEST['um_panic_key'], wp_login_url())));
    }
    if (!isset($_REQUEST['_verified_key']) || $_REQUEST['_verified_key'] != um_get_option('panic_key')) {
        // Logout screen
        if (isset($pagenow) && $pagenow == 'wp-login.php' && is_user_logged_in() && isset($_REQUEST['action']) && $_REQUEST['action'] == 'logout') {
            $redirect = um_get_core_page('logout');
            if (isset($_REQUEST['redirect_to']) && !empty($_REQUEST['redirect_to'])) {
                $redirect = add_query_arg('redirect_to', $_REQUEST['redirect_to'], $redirect);
            }
            exit(wp_redirect($redirect));
        }
        // Login screen
        if (isset($pagenow) && $pagenow == 'wp-login.php' && !is_user_logged_in() && !isset($_REQUEST['action'])) {
            $allowed = um_get_option('wpadmin_login');
            $allowed = apply_filters('um_whitelisted_wpadmin_access', $allowed);
            if (!$allowed) {
                $act = um_get_option('wpadmin_login_redirect');
                $custom_url = um_get_option('wpadmin_login_redirect_url');
                if ($act == 'um_login_page' || !$custom_url) {
                    $redirect = um_get_core_page('login');
                } else {
                    $redirect = $custom_url;
                }
                exit(wp_redirect($redirect));
            }
        }
        // Register screen
        if (isset($pagenow) && $pagenow == 'wp-login.php' && !is_user_logged_in() && isset($_REQUEST['action']) && $_REQUEST['action'] == 'register') {
            $allowed = um_get_option('wpadmin_register');
            $allowed = apply_filters('um_whitelisted_wpadmin_access', $allowed);
            if (!$allowed) {
                $act = um_get_option('wpadmin_register_redirect');
                $custom_url = um_get_option('wpadmin_register_redirect_url');
                if ($act == 'um_register_page' || !$custom_url) {
                    $redirect = um_get_core_page('register');
                } else {
                    $redirect = $custom_url;
                }
                exit(wp_redirect($redirect));
            }
        }
        // Lost password page
        if (isset($pagenow) && $pagenow == 'wp-login.php' && isset($_REQUEST['action']) && $_REQUEST['action'] == 'lostpassword') {
            exit(wp_redirect(um_get_core_page('password-reset')));
        }
        // Prevention for logged in user
        if (isset($pagenow) && $pagenow == 'wp-login.php' && is_user_logged_in() && isset($_REQUEST['action']) && $_REQUEST['action'] != 'postpass') {
            if (!um_user('can_access_wpadmin')) {
                exit(wp_redirect(home_url()));
            } else {
                exit(wp_redirect(admin_url()));
            }
        }
    }
}
开发者ID:Zurtr,项目名称:ultimatemember,代码行数:59,代码来源:um-actions-wpadmin.php


示例2: tab_link

 function tab_link($id)
 {
     if (get_option('permalink_structure')) {
         $url = trailingslashit(untrailingslashit(um_get_core_page('account')));
         $url = $url . $id . '/';
     } else {
         $url = add_query_arg('um_tab', $id, um_get_core_page('account'));
     }
     return $url;
 }
开发者ID:samuelshih,项目名称:daily-gazette,代码行数:10,代码来源:um-account.php


示例3: reset_url

 function reset_url()
 {
     global $ultimatemember;
     if (!um_user('reset_pass_hash')) {
         return false;
     }
     $url = add_query_arg('act', 'reset_password', um_get_core_page('password-reset'));
     $url = add_query_arg('hash', esc_attr(um_user('reset_pass_hash')), $url);
     $url = add_query_arg('user_id', esc_attr(um_user('ID')), $url);
     return $url;
 }
开发者ID:Zurtr,项目名称:ultimatemember,代码行数:11,代码来源:um-password.php


示例4: um_change_password_process_hook

function um_change_password_process_hook($args)
{
    global $ultimatemember;
    wp_set_password($args['user_password'], $args['user_id']);
    delete_user_meta($args['user_id'], 'reset_pass_hash');
    delete_user_meta($args['user_id'], 'reset_pass_hash_token');
    do_action('um_after_changing_user_password', $args['user_id']);
    if (is_user_logged_in()) {
        wp_logout();
    }
    exit(wp_redirect(um_get_core_page('login', 'password_changed')));
}
开发者ID:Ksajikyan,项目名称:poiskuslug,代码行数:12,代码来源:um-actions-password.php


示例5: um_convert_tags

function um_convert_tags($content, $args = array())
{
    $search = array('{display_name}', '{first_name}', '{last_name}', '{gender}', '{username}', '{email}', '{password}', '{login_url}', '{site_name}', '{site_url}', '{account_activation_link}', '{password_reset_link}', '{admin_email}', '{user_profile_link}', '{user_account_link}', '{submitted_registration}', '{user_avatar_url}');
    $search = apply_filters('um_template_tags_patterns_hook', $search);
    $replace = array(um_user('display_name'), um_user('first_name'), um_user('last_name'), um_user('gender'), um_user('user_login'), um_user('user_email'), um_user('_um_cool_but_hard_to_guess_plain_pw'), um_get_core_page('login'), um_get_option('site_name'), get_bloginfo('url'), um_user('account_activation_link'), um_user('password_reset_link'), um_admin_email(), um_user_profile_url(), um_get_core_page('account'), um_user_submitted_registration(), um_get_user_avatar_url());
    $replace = apply_filters('um_template_tags_replaces_hook', $replace);
    $content = str_replace($search, $replace, $content);
    if (isset($args['tags']) && isset($args['tags_replace'])) {
        $content = str_replace($args['tags'], $args['tags_replace'], $content);
    }
    return $content;
}
开发者ID:blogfor,项目名称:king,代码行数:12,代码来源:um-short-functions.php


示例6: template_redirect

 function template_redirect()
 {
     global $ultimatemember;
     do_action('um_access_homepage_per_role');
     do_action('um_access_global_settings');
     do_action('um_access_post_settings');
     if ($this->redirect_handler && !$this->allow_access) {
         // login page add protected page automatically
         if (strstr($this->redirect_handler, um_get_core_page('login'))) {
             $curr = $ultimatemember->permalinks->get_current_url();
             $this->redirect_handler = esc_url(add_query_arg('redirect_to', $curr, $this->redirect_handler));
         }
         exit(wp_redirect($this->redirect_handler));
     }
 }
开发者ID:BurlesonBrad,项目名称:ultimatemember,代码行数:15,代码来源:um-access.php


示例7: template_redirect

 function template_redirect()
 {
     global $post, $ultimatemember;
     do_action('um_access_global_settings');
     do_action('um_access_frontpage_per_role');
     do_action('um_access_homepage_per_role');
     do_action('um_access_category_settings');
     do_action('um_access_post_settings');
     if ($this->redirect_handler && $this->allow_access == false && !um_is_core_page('login')) {
         // login page add protected page automatically
         if (strstr($this->redirect_handler, um_get_core_page('login'))) {
             $curr = $ultimatemember->permalinks->get_current_url();
             $this->redirect_handler = esc_url(add_query_arg('redirect_to', urlencode_deep($curr), $this->redirect_handler));
         }
         wp_redirect($this->redirect_handler);
     }
 }
开发者ID:TeamSubjectMatter,项目名称:juddfoundation,代码行数:17,代码来源:um-access.php


示例8: locate_user_profile

 function locate_user_profile()
 {
     global $post, $ultimatemember;
     if (um_queried_user() && um_is_core_page('user')) {
         if (um_get_option('permalink_base') == 'user_login') {
             $user_id = username_exists(um_queried_user());
             // Try nice name
             if (!$user_id) {
                 $slug = um_queried_user();
                 $slug = str_replace('.', '-', $slug);
                 $the_user = get_user_by('slug', $slug);
                 if (isset($the_user->ID)) {
                     $user_id = $the_user->ID;
                 }
             }
         }
         if (um_get_option('permalink_base') == 'user_id') {
             $user_id = $ultimatemember->user->user_exists_by_id(um_queried_user());
         }
         if (um_get_option('permalink_base') == 'name') {
             $user_id = $ultimatemember->user->user_exists_by_name(um_queried_user());
         }
         /** USER EXISTS SET USER AND CONTINUE **/
         if ($user_id) {
             um_set_requested_user($user_id);
         } else {
             exit(wp_redirect(um_get_core_page('user')));
         }
     } else {
         if (um_is_core_page('user')) {
             // just base64_decode
             if (is_user_logged_in()) {
                 // just redirect to their profile
                 $query = $ultimatemember->permalinks->get_query_array();
                 $url = um_user_profile_url();
                 if ($query) {
                     foreach ($query as $key => $val) {
                         $url = add_query_arg($key, $val, $url);
                     }
                 }
                 exit(wp_redirect($url));
             }
         }
     }
 }
开发者ID:smithsa,项目名称:daily-job-hunter,代码行数:45,代码来源:um-rewrite.php


示例9: activate_account_via_email_link

 function activate_account_via_email_link()
 {
     global $ultimatemember;
     if (isset($_REQUEST['act']) && $_REQUEST['act'] == 'activate_via_email' && isset($_REQUEST['hash']) && strlen($_REQUEST['hash']) == 40 && isset($_REQUEST['user_id']) && is_numeric($_REQUEST['user_id'])) {
         // valid token
         um_fetch_user($_REQUEST['user_id']);
         if (um_user('account_status') != 'awaiting_email_confirmation') {
             wp_die('The activation link you used is invalid or has expired.');
         }
         if ($_REQUEST['hash'] != um_user('account_secret_hash')) {
             wp_die('The secret key provided does not match this one for the user.');
         }
         $ultimatemember->user->approve();
         $redirect = um_user('url_email_activate') ? um_user('url_email_activate') : um_get_core_page('login', 'account_active');
         um_reset_user();
         exit(wp_redirect($redirect));
     }
 }
开发者ID:smithsa,项目名称:daily-job-hunter,代码行数:18,代码来源:um-permalinks.php


示例10: um_convert_tags

function um_convert_tags($content, $args = array())
{
    $search = array('{display_name}', '{first_name}', '{last_name}', '{gender}', '{username}', '{email}', '{password}', '{login_url}', '{login_referrer}', '{site_name}', '{site_url}', '{account_activation_link}', '{password_reset_link}', '{admin_email}', '{user_profile_link}', '{user_account_link}', '{submitted_registration}', '{user_avatar_url}');
    $search = apply_filters('um_template_tags_patterns_hook', $search);
    $replace = array(um_user('display_name'), um_user('first_name'), um_user('last_name'), um_user('gender'), um_user('user_login'), um_user('user_email'), um_user('_um_cool_but_hard_to_guess_plain_pw'), um_get_core_page('login'), um_dynamic_login_page_redirect(), um_get_option('site_name'), get_bloginfo('url'), um_user('account_activation_link'), um_user('password_reset_link'), um_admin_email(), um_user_profile_url(), um_get_core_page('account'), um_user_submitted_registration(), um_get_user_avatar_url());
    $replace = apply_filters('um_template_tags_replaces_hook', $replace);
    $content = str_replace($search, $replace, $content);
    if (isset($args['tags']) && isset($args['tags_replace'])) {
        $content = str_replace($args['tags'], $args['tags_replace'], $content);
    }
    $regex = '~\\{([^}]*)\\}~';
    preg_match_all($regex, $content, $matches);
    // Support for all usermeta keys
    if (isset($matches[1]) && is_array($matches[1]) && !empty($matches[1])) {
        foreach ($matches[1] as $match) {
            $strip_key = str_replace('usermeta:', '', $match);
            $content = str_replace('{' . $match . '}', um_user($strip_key), $content);
        }
    }
    return $content;
}
开发者ID:vanlong200880,项目名称:tmdt,代码行数:21,代码来源:um-short-functions.php


示例11: um_logout_user_links

function um_logout_user_links($args)
{
    global $ultimatemember;
    ?>

		<li><a href="<?php 
    echo um_get_core_page('account');
    ?>
"><?php 
    _e('Your account', 'ultimatemember');
    ?>
</a></li>
		<li><a href="<?php 
    echo esc_url(add_query_arg('redirect_to', $ultimatemember->permalinks->get_current_url(true), um_get_core_page('logout')));
    ?>
"><?php 
    _e('Logout', 'ultimatemember');
    ?>
</a></li>

	<?php 
}
开发者ID:jonfalcon,项目名称:ultimatemember,代码行数:22,代码来源:um-actions-user.php


示例12: add_filter

***/
add_filter('redux/options/um_options/compiler', 'um_core_page_setting_saved', 100, 3);
function um_core_page_setting_saved($options, $css, $changed_values)
{
    $core_pages = array('user' => __('User page', 'ultimatemember'), 'account' => __('Account page', 'ultimatemember'), 'members' => __('Members page', 'ultimatemember'), 'register' => __('Register page', 'ultimatemember'), 'login' => __('Login page', 'ultimatemember'), 'logout' => __('Logout page', 'ultimatemember'), 'password-reset' => __('Password reset page', 'ultimatemember'));
    $pages = get_option('um_core_pages');
    $core_pages = apply_filters('um_core_pages', $core_pages);
    foreach ($core_pages as $slug => $page) {
        $pages[$slug] = $options['core_' . $slug];
    }
    update_option('um_core_pages', $pages);
}
/***
***	@
***/
$this->sections[] = array('icon' => 'um-faicon-user', 'title' => __('Users', 'ultimatemember'), 'fields' => array(array('id' => 'default_role', 'type' => 'select', 'select2' => array('allowClear' => 0, 'minimumResultsForSearch' => -1), 'title' => __('Default New User Role', 'ultimatemember'), 'desc' => __('Select the default role that will be assigned to user after registration If you did not specify custom role settings per form.', 'ultimatemember'), 'default' => 'member', 'options' => $ultimatemember->query->get_roles(), 'placeholder' => __('Choose user role...', 'ultimatemember')), array('id' => 'permalink_base', 'type' => 'select', 'select2' => array('allowClear' => 0, 'minimumResultsForSearch' => -1), 'title' => __('Profile Permalink Base', 'ultimatemember'), 'desc' => __('Here you can control the permalink structure of the user profile URL globally', 'ultimatemember'), 'default' => 'user_login', 'desc' => 'e.g. ' . trailingslashit(um_get_core_page('user')) . '<strong>username</strong>/', 'options' => array('user_login' => __('Username', 'ultimatemember'), 'name' => __('First and Last Name with \'.\'', 'ultimatemember'), 'name_dash' => __('First and Last Name with \'-\'', 'ultimatemember'), 'name_plus' => __('First and Last Name with \'+\'', 'ultimatemember'), 'user_id' => __('User ID', 'ultimatemember')), 'placeholder' => __('Select...', 'ultimatemember')), array('id' => 'display_name', 'type' => 'select', 'select2' => array('allowClear' => 0, 'minimumResultsForSearch' => -1), 'title' => __('User Display Name', 'ultimatemember'), 'desc' => __('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', 'ultimatemember'), 'default' => 'full_name', 'options' => array('default' => __('Default WP Display Name', 'ultimatemember'), 'nickname' => __('Nickname', 'ultimatemember'), 'username' => __('Username', 'ultimatemember'), 'full_name' => __('First name & last name', 'ultimatemember'), 'sur_name' => __('Last name & first name', 'ultimatemember'), 'initial_name' => __('First name & first initial of last name', 'ultimatemember'), 'initial_name_f' => __('First initial of first name & last name', 'ultimatemember'), 'first_name' => __('First name only', 'ultimatemember'), 'field' => __('Custom field(s)', 'ultimatemember')), 'placeholder' => __('Select...')), array('id' => 'display_name_field', 'type' => 'text', 'title' => __('Display Name Custom Field(s)', 'ultimatemember'), 'desc' => __('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', 'ultimatemember'), 'required' => array('display_name', '=', 'field')), array('id' => 'author_redirect', 'type' => 'switch', 'title' => __('Automatically redirect author page to their profile?', 'ultimatemember'), 'default' => 1, 'desc' => __('If enabled, author pages will automatically redirect to the user\'s profile page', 'ultimatemember'), 'on' => __('Yes', 'ultimatemember'), 'off' => __('No', 'ultimatemember')), array('id' => 'members_page', 'type' => 'switch', 'title' => __('Enable Members Directory', 'ultimatemember'), 'default' => 1, 'desc' => __('Control whether to enable or disable member directories on this site', 'ultimatemember'), 'on' => __('Yes', 'ultimatemember'), 'off' => __('No', 'ultimatemember')), array('id' => 'use_gravatars', 'type' => 'switch', 'title' => __('Use Gravatars?', 'ultimatemember'), 'default' => 0, 'desc' => __('Do you want to use gravatars instead of the default plugin profile photo (If the user did not upload a custom profile photo / avatar)', 'ultimatemember'), 'on' => __('Yes', 'ultimatemember'), 'off' => __('No', 'ultimatemember')), array('id' => 'use_um_gravatar_default_builtin_image', 'type' => 'select', 'title' => __('Use Gravatar builtin image', 'ultimatemember'), 'desc' => __('Gravatar has a number of built in options which you can also use as defaults', 'ultimatemember'), 'default' => 'default', 'options' => array('default' => __('Default', 'ultimatemember'), '404' => __('404 ( File Not Found response )', 'ultimatemember'), 'mm' => __('Mystery Man', 'ultimatemember'), 'identicon' => __('Identicon', 'ultimatemember'), 'monsterid' => __('Monsterid', 'ultimatemember'), 'wavatar' => __('Wavatar', 'ultimatemember'), 'retro' => __('Retro', 'ultimatemember'), 'blank' => __('Blank ( a transparent PNG image )', 'ultimatemember')), 'required' => array('use_gravatars', '=', 1), 'select2' => array('allowClear' => 0, 'minimumResultsForSearch' => -1)), array('id' => 'use_um_gravatar_default_image', 'type' => 'switch', 'title' => __('Use Default plugin avatar as Gravatar\'s Default avatar', 'ultimatemember'), 'default' => 0, 'desc' => __('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)', 'ultimatemember'), 'on' => __('Yes', 'ultimatemember'), 'off' => __('No', 'ultimatemember'), 'required' => array('use_um_gravatar_default_builtin_image', '=', 'default')), array('id' => 'reset_require_strongpass', 'type' => 'switch', 'title' => __('Require a strong password? (when user resets password only)', 'ultimatemember'), 'default' => 0, 'desc' => __('Enable or disable a strong password rules on password reset and change procedure', 'ultimatemember'), 'on' => __('On', 'ultimatemember'), 'off' => __('Off', 'ultimatemember')), array('id' => 'editable_primary_email_in_profile', 'type' => 'switch', 'title' => __('Editable primary email field in profile view', 'ultimatemember'), 'default' => 0, 'desc' => __('Allow users to edit their primary emails in profile view ( when email address field is added only )', 'ultimatemember'), 'on' => __('On', 'ultimatemember'), 'off' => __('Off', 'ultimatemember'))));
/***
***	@
***/
$this->sections[] = array('icon' => 'um-faicon-cog', 'title' => __('Account', 'ultimatemember'), 'fields' => array(array('id' => 'account_tab_password', 'type' => 'switch', 'title' => __('Password Account Tab', 'ultimatemember'), 'default' => 1, 'desc' => 'Enable/disable the Password account tab in account page', 'on' => __('On', 'ultimatemember'), 'off' => __('Off', 'ultimatemember')), array('id' => 'account_tab_privacy', 'type' => 'switch', 'title' => __('Privacy Account Tab', 'ultimatemember'), 'default' => 1, 'desc' => __('Enable/disable the Privacy account tab in account page', 'ultimatemember'), 'on' => __('On', 'ultimatemember'), 'off' => __('Off', 'ultimatemember')), array('id' => 'account_tab_notifications', 'type' => 'switch', 'title' => __('Notifications Account Tab', 'ultimatemember'), 'default' => 1, 'desc' => __('Enable/disable the Notifications account tab in account page', 'ultimatemember'), 'on' => __('On', 'ultimatemember'), 'off' => __('Off', 'ultimatemember')), array('id' => 'account_tab_delete', 'type' => 'switch', 'title' => __('Delete Account Tab', 'ultimatemember'), 'default' => 1, 'desc' => __('Enable/disable the Delete account tab in account page', 'ultimatemember'), 'on' => __('On', 'ultimatemember'), 'off' => __('Off', 'ultimatemember')), array('id' => 'delete_account_text', 'type' => 'textarea', 'title' => __('Account Deletion Custom Text', 'ultimatemember'), 'default' => __('Are you sure you want to delete your account? This will erase all of your account data from the site. To delete your account enter your password below', 'ultimatemember'), 'desc' => __('This is custom text that will be displayed to users before they delete their accounts from your site', 'ultimatemember'), 'args' => array('teeny' => false, 'media_buttons' => false, 'textarea_rows' => 6)), array('id' => 'account_name', 'type' => 'switch', 'title' => __('Add a First & Last Name fields', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to enable these fields on the user account page by default or hide them.', 'ultimatemember'), 'on' => __('On', 'ultimatemember'), 'off' => __('Off', 'ultimatemember')), array('id' => 'account_email', 'type' => 'switch', 'title' => __('Allow users to change e-mail', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to allow users changing their email in account page.', 'ultimatemember'), 'on' => __('On', 'ultimatemember'), 'off' => __('Off', 'ultimatemember')), array('id' => 'account_hide_in_directory', 'type' => 'switch', 'title' => __('Allow users to hide their profiles from directory', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to allow users changing their profile visibility from member directory in account page.', 'ultimatemember'), 'on' => __('On', 'ultimatemember'), 'off' => __('Off', 'ultimatemember')), array('id' => 'account_require_strongpass', 'type' => 'switch', 'title' => __('Require a strong password?', 'ultimatemember'), 'default' => 0, 'desc' => __('Enable or disable a strong password rules on account page / change password tab', 'ultimatemember'), 'on' => __('On', 'ultimatemember'), 'off' => __('Off', 'ultimatemember'))));
/***
***	@
***/
$this->sections[] = array('icon' => 'um-faicon-lock', 'title' => __('Access', 'ultimatemember'), 'fields' => array(array('id' => 'panic_key', 'type' => 'text', 'title' => __('Panic Key', 'ultimatemember'), 'desc' => __('Panic Key is a random generated key that allow you to access the WordPress backend always regardless of backend settings.', 'ultimatemember'), 'default' => $ultimatemember->validation->randomize(), 'desc' => trailingslashit(get_bloginfo('url')) . 'wp-admin/?um_panic_key=<strong>your_panic_key</strong>'), array('id' => 'accessible', 'type' => 'select', 'select2' => array('allowClear' => 0, 'minimumResultsForSearch' => -1), 'title' => __('Global Site Access', 'ultimatemember'), 'default' => 0, 'desc' => __('Globally control the access of your site, you can have seperate restrict options per post/page by editing the desired item.', 'ultimatemember'), 'options' => array(0 => 'Site accessible to Everyone', 2 => 'Site accessible to Logged In Users')), array('id' => 'access_redirect', 'type' => 'text', 'title' => __('Custom Redirect URL', 'ultimatemember'), 'desc' => __('A logged out user will be redirected to this url If he is not permitted to access the site', 'ultimatemember'), 'required' => array('accessible', '=', 2)), array('id' => 'access_exclude_uris', 'type' => 'multi_text', 'default' => array(), 'title' => __('Exclude the following URLs', 'ultimatemember'), 'desc' => __('Here you can exclude URLs beside the redirect URI to be accessible to everyone', 'ultimatemember'), 'add_text' => __('Add New URL', 'ultimatemember'), 'required' => array('accessible', '=', 2)), array('id' => 'wpadmin_login', 'type' => 'switch', 'title' => __('Allow Backend Login Screen for Guests', 'ultimatemember'), 'default' => 1, 'desc' => __('Control whether guests are able to access the WP-admin login screen or not', 'ultimatemember'), 'on' => __('Yes', 'ultimatemember'), 'off' => __('No', 'ultimatemember')), array('id' => 'deny_admin_frontend_login', 'type' => 'switch', 'title' => __('Disable Admin Login via Frontend', 'ultimatemember'), 'default' => 0, 'desc' => __('DO NOT turn this option on if you have set the option  "Allow Backend Login Screen for Guests" to NO. This will result in being locked out of admin.', 'ultimatemember'), 'on' => __('Yes', 'ultimatemember'), 'off' => __('No', 'ultimatemember')), array('id' => 'wpadmin_login_redirect', 'type' => 'select', 'select2' => array('allowClear' => 0, 'minimumResultsForSearch' => -1), 'title' => __('Redirect to alternative login page', 'ultimatemember'), 'desc' => __('If you disable backend access to login screen, specify here where a user will be redirected', 'ultimatemember'), 'required' => array('wpadmin_login', '=', 0), 'default' => 'um_login_page', 'options' => array('um_login_page' => 'UM Login Page', 'custom_url' => 'Custom URL')), array('id' => 'wpadmin_login_redirect_url', 'type' => 'text', 'title' => __('Custom URL', 'ultimatemember'), 'desc' => __('Enter an alternate url here to redirect a user If they try to access the backend register screen', 'ultimatemember'), 'required' => array('wpadmin_login_redirect', '=', 'custom_url')), array('id' => 'wpadmin_register', 'type' => 'switch', 'title' => __('Allow Backend Register Screen for Guests', 'ultimatemember'), 'default' => 1, 'desc' => __('Control whether guests are able to access the WP-admin register screen or not', 'ultimatemember'), 'on' => __('Yes', 'ultimatemember'), 'off' => __('No', 'ultimatemember')), array('id' => 'wpadmin_register_redirect', 'type' => 'select', 'select2' => array('allowClear' => 0, 'minimumResultsForSearch' => -1), 'title' => __('Redirect to alternative register page', 'ultimatemember'), 'desc' => __('If you disable backend access to register screen, specify here where a user will be redirected', 'ultimatemember'), 'required' => array('wpadmin_register', '=', 0), 'default' => 'um_register_page', 'options' => array('um_register_page' => 'UM Register Page', 'custom_url' => 'Custom URL')), array('id' => 'wpadmin_register_redirect_url', 'type' => 'text', 'title' => __('Custom URL', 'ultimatemember'), 'desc' => __('Enter an alternate url here to redirect a user If they try to access the backend register screen', 'ultimatemember'), 'required' => array('wpadmin_register_redirect', '=', 'custom_url')), array('id' => 'access_widget_admin_only', 'type' => 'switch', 'title' => __('Enable the Access Control widget for Admins only?', 'ultimatemember'), 'default' => 1, 'on' => __('Yes', 'ultimatemember'), 'off' => __('No', 'ultimatemember')), array('id' => 'wpadmin_allow_ips', 'type' => 'textarea', 'title' => __('Whitelisted Backend IPs', 'ultimatemember'), 'desc' => __('Always allow the specified IP addresses to access the backend login screen and WP-admin to avoid being locked from site backend.', 'ultimatemember')), array('id' => 'blocked_ips', 'type' => 'textarea', 'title' => __('Blocked IP Addresses', 'ultimatemember'), 'desc' => __('This will block the listed IPs from signing up or signing in to the site, you can use full IP numbers or target specific range with a wildcard', 'ultimatemember')), array('id' => 'blocked_emails', 'type' => 'textarea', 'title' => __('Blocked Email Addresses', 'ultimatemember'), 'desc' => __('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', 'ultimatemember')), array('id' => 'blocked_words', 'type' => 'textarea', 'title' => __('Blacklist Words', 'ultimatemember'), 'desc' => __('This option lets you specify blacklist of words to prevent anyone from signing up with such a word as their username', 'ultimatemember'), 'default' => 'admin' . "\r\n" . 'administrator' . "\r\n" . 'webmaster' . "\r\n" . 'support' . "\r\n" . 'staff')));
/***
***	@
***/
$this->sections[] = array('icon' => 'um-faicon-envelope-o', 'title' => __('Emails', 'ultimatemember'), 'fields' => array(array('id' => 'mail_from', 'type' => 'text', 'title' => __('Mail appears from', 'ultimatemember'), 'desc' => __('e.g. Site Name', 'ultimatemember'), 'default' => get_bloginfo('name')), array('id' => 'mail_from_addr', 'type' => 'text', 'title' => __('Mail appears from address', 'ultimatemember'), 'desc' => __('e.g. [email protected]', 'ultimatemember'), 'default' => get_bloginfo('admin_email')), array('id' => 'email_html', 'type' => 'switch', 'title' => __('Use HTML for E-mails?', 'ultimatemember'), 'default' => 0, 'desc' => __('If you enable HTML for e-mails, you can customize the HTML e-mail templates found in <strong>templates/email</strong> folder.', 'ultimatemember')), array('id' => 'welcome_email_on', 'type' => 'switch', 'title' => __('Account Welcome Email', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to send the user an email when his account is automatically approved', 'ultimatemember')), array('id' => 'welcome_email_sub', 'type' => 'text', 'title' => __('Account Welcome Email', 'ultimatemember'), 'subtitle' => __('Subject Line', 'ultimatemember'), 'default' => 'Welcome to {site_name}!', 'required' => array('welcome_email_on', '=', 1), 'desc' => __('This is the subject line of the e-mail', 'ultimatemember')), array('id' => 'welcome_email', 'type' => 'textarea', 'title' => __('Account Welcome Email', 'ultimatemember'), 'subtitle' => __('Message Body', 'ultimatemember'), 'required' => array('welcome_email_on', '=', 1), 'default' => 'Hi {display_name},' . "\r\n\r\n" . 'Thank you for signing up with {site_name}! Your account is now active.' . "\r\n\r\n" . 'To login please visit the following url:' . "\r\n\r\n" . '{login_url}' . "\r\n\r\n" . 'Your account e-mail: {email}' . "\r\n" . 'Your account username: {username}' . "\r\n" . 'Your account password: {password}' . "\r\n\r\n" . 'If you have any problems, please contact us at {admin_email}' . "\r\n\r\n" . 'Thanks,' . "\r\n" . '{site_name}'), array('id' => 'checkmail_email_on', 'type' => 'switch', 'title' => __('Account Activation Email', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to send the user an email when his account needs e-mail activation', 'ultimatemember')), array('id' => 'checkmail_email_sub', 'type' => 'text', 'title' => __('Account Activation Email', 'ultimatemember'), 'subtitle' => __('Subject Line', 'ultimatemember'), 'default' => 'Please activate your account', 'required' => array('checkmail_email_on', '=', 1), 'desc' => __('This is the subject line of the e-mail', 'ultimatemember')), array('id' => 'checkmail_email', 'type' => 'textarea', 'title' => __('Account Activation Email', 'ultimatemember'), 'subtitle' => __('Message Body', 'ultimatemember'), 'required' => array('checkmail_email_on', '=', 1), 'default' => 'Hi {display_name},' . "\r\n\r\n" . 'Thank you for signing up with {site_name}! To activate your account, please click the link below to confirm your email address:' . "\r\n\r\n" . '{account_activation_link}' . "\r\n\r\n" . 'If you have any problems, please contact us at {admin_email}' . "\r\n\r\n" . 'Thanks,' . "\r\n" . '{site_name}'), array('id' => 'pending_email_on', 'type' => 'switch', 'title' => __('Pending Review Email', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to send the user an email when his account needs admin review', 'ultimatemember')), array('id' => 'pending_email_sub', 'type' => 'text', 'title' => __('Pending Review Email', 'ultimatemember'), 'subtitle' => __('Subject Line', 'ultimatemember'), 'default' => 'Your account is pending review', 'required' => array('pending_email_on', '=', 1), 'desc' => __('This is the subject line of the e-mail', 'ultimatemember')), array('id' => 'pending_email', 'type' => 'textarea', 'title' => __('Pending Review Email', 'ultimatemember'), 'subtitle' => __('Message Body', 'ultimatemember'), 'required' => array('pending_email_on', '=', 1), 'default' => 'Hi {display_name},' . "\r\n\r\n" . 'Thank you for signing up with {site_name}! Your account is currently being reviewed by a member of our team.' . "\r\n\r\n" . 'Please allow us some time to process your request.' . "\r\n\r\n" . 'If you have any problems, please contact us at {admin_email}' . "\r\n\r\n" . 'Thanks,' . "\r\n" . '{site_name}'), array('id' => 'approved_email_on', 'type' => 'switch', 'title' => __('Account Approved Email', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to send the user an email when his account is approved', 'ultimatemember')), array('id' => 'approved_email_sub', 'type' => 'text', 'title' => __('Account Approved Email', 'ultimatemember'), 'subtitle' => __('Subject Line', 'ultimatemember'), 'default' => 'Your account at {site_name} is now active', 'required' => array('approved_email_on', '=', 1), 'desc' => __('This is the subject line of the e-mail', 'ultimatemember')), array('id' => 'approved_email', 'type' => 'textarea', 'title' => __('Account Approved Email', 'ultimatemember'), 'subtitle' => __('Message Body', 'ultimatemember'), 'required' => array('approved_email_on', '=', 1), 'default' => 'Hi {display_name},' . "\r\n\r\n" . 'Thank you for signing up with {site_name}! Your account has been approved and is now active.' . "\r\n\r\n" . 'To login please visit the following url:' . "\r\n\r\n" . '{login_url}' . "\r\n\r\n" . 'Your account e-mail: {email}' . "\r\n" . 'Your account username: {username}' . "\r\n" . 'Your account password: {password}' . "\r\n\r\n" . 'If you have any problems, please contact us at {admin_email}' . "\r\n\r\n" . 'Thanks,' . "\r\n" . '{site_name}'), array('id' => 'rejected_email_on', 'type' => 'switch', 'title' => __('Account Rejected Email', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to send the user an email when his account is rejected', 'ultimatemember')), array('id' => 'rejected_email_sub', 'type' => 'text', 'title' => __('Account Rejected Email', 'ultimatemember'), 'subtitle' => __('Subject Line', 'ultimatemember'), 'default' => 'Your account has been rejected', 'required' => array('rejected_email_on', '=', 1), 'desc' => __('This is the subject line of the e-mail', 'ultimatemember')), array('id' => 'rejected_email', 'type' => 'textarea', 'title' => __('Account Rejected Email', 'ultimatemember'), 'subtitle' => __('Message Body', 'ultimatemember'), 'required' => array('rejected_email_on', '=', 1), 'default' => 'Hi {display_name},' . "\r\n\r\n" . 'Thank you for applying for membership to {site_name}! We have reviewed your information and unfortunately we are unable to accept you as a member at this moment.' . "\r\n\r\n" . 'Please feel free to apply again at a future date.' . "\r\n\r\n" . 'Thanks,' . "\r\n" . '{site_name}'), array('id' => 'inactive_email_on', 'type' => 'switch', 'title' => __('Account Deactivated Email', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to send the user an email when his account is deactivated', 'ultimatemember')), array('id' => 'inactive_email_sub', 'type' => 'text', 'title' => __('Account Deactivated Email', 'ultimatemember'), 'subtitle' => __('Subject Line', 'ultimatemember'), 'default' => 'Your account has been deactivated', 'required' => array('inactive_email_on', '=', 1), 'desc' => __('This is the subject line of the e-mail', 'ultimatemember')), array('id' => 'inactive_email', 'type' => 'textarea', 'title' => __('Account Deactivated Email', 'ultimatemember'), 'subtitle' => __('Message Body', 'ultimatemember'), 'required' => array('inactive_email_on', '=', 1), 'default' => 'Hi {display_name},' . "\r\n\r\n" . 'This is an automated email to let you know your {site_name} account has been deactivated.' . "\r\n\r\n" . 'If you would like your account to be reactivated please contact us at {admin_email}' . "\r\n\r\n" . 'Thanks,' . "\r\n" . '{site_name}'), array('id' => 'deletion_email_on', 'type' => 'switch', 'title' => __('Account Deleted Email', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to send the user an email when his account is deleted', 'ultimatemember')), array('id' => 'deletion_email_sub', 'type' => 'text', 'title' => __('Account Deleted Email', 'ultimatemember'), 'subtitle' => __('Subject Line', 'ultimatemember'), 'default' => 'Your account has been deleted', 'required' => array('deletion_email_on', '=', 1), 'desc' => __('This is the subject line of the e-mail', 'ultimatemember')), array('id' => 'deletion_email', 'type' => 'textarea', 'title' => __('Account Deleted Email', 'ultimatemember'), 'subtitle' => __('Message Body', 'ultimatemember'), 'required' => array('deletion_email_on', '=', 1), 'default' => 'Hi {display_name},' . "\r\n\r\n" . 'This is an automated email to let you know your {site_name} account has been deleted. All of your personal information has been permanently deleted and you will no longer be able to login to {site_name}.' . "\r\n\r\n" . 'If your account has been deleted by accident please contact us at {admin_email}' . "\r\n\r\n" . 'Thanks,' . "\r\n" . '{site_name}'), array('id' => 'resetpw_email_on', 'type' => 'switch', 'title' => __('Password Reset Email', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to send the user an email when he request to reset password (Recommended, please keep on)', 'ultimatemember')), array('id' => 'resetpw_email_sub', 'type' => 'text', 'title' => __('Password Reset Email', 'ultimatemember'), 'subtitle' => __('Subject Line', 'ultimatemember'), 'default' => 'Reset your password', 'required' => array('resetpw_email_on', '=', 1), 'desc' => __('This is the subject line of the e-mail', 'ultimatemember')), array('id' => 'resetpw_email', 'type' => 'textarea', 'title' => __('Password Reset Email', 'ultimatemember'), 'subtitle' => __('Message Body', 'ultimatemember'), 'required' => array('resetpw_email_on', '=', 1), 'default' => 'Hi {display_name},' . "\r\n\r\n" . 'We received a request to reset the password for your account. If you made this request, click the link below to change your password:' . "\r\n\r\n" . '{password_reset_link}' . "\r\n\r\n" . 'If you didn\'t make this request, you can ignore this email' . "\r\n\r\n" . 'Thanks,' . "\r\n" . '{site_name}'), array('id' => 'changedpw_email_on', 'type' => 'switch', 'title' => __('Password Changed Email', 'ultimatemember'), 'default' => 1, 'desc' => __('Whether to send the user an email when he request to reset password (Recommended, please keep on)', 'ultimatemember')), array('id' => 'changedpw_email_sub', 'type' => 'text', 'title' => __('Password Changed Email', 'ultimatemember'), 'subtitle' => __('Subject Line', 'ultimatemember'), 'default' => 'Your {site_name} password has been changed', 'required' => array('changedpw_email_on', '=', 1), 'desc' => __('This is the subject line of the e-mail', 'ultimatemember')), array('id' => 'changedpw_email', 'type' => 'textarea', 'title' => __('Password Changed Email', 'ultimatemember'), 'subtitle' => __('Message Body', 'ultimatemember'), 'required' => array('changedpw_email_on', '=', 1), 'default' => 'Hi {display_name},' . "\r\n\r\n" . 'You recently changed the password associated with your {site_name} account.' . "\r\n\r\n" . 'If you did not make this change and believe your {site_name} account has been compromised, please contact us at the following email address: {admin_email}' . "\r\n\r\n" . 'Thanks,' . "\r\n" . '{site_name}')));
/***
***	@
***/
开发者ID:jonfalcon,项目名称:ultimatemember,代码行数:31,代码来源:um-config.php


示例13: um_access_post_settings

function um_access_post_settings()
{
    global $post, $ultimatemember;
    // woo commerce shop ID
    if (function_exists('is_shop') && is_shop()) {
        $um_post_id = get_option('woocommerce_shop_page_id');
    } else {
        if (is_category() || is_archive() || is_search() || in_the_loop() || is_feed() || is_tax() || !get_post_type() || !isset($post->ID) || is_home() || is_front_page()) {
            return;
        }
    }
    if (!isset($um_post_id)) {
        $um_post_id = $post->ID;
    }
    $args = $ultimatemember->access->get_meta($um_post_id);
    extract($args);
    $categories = get_the_category($post->ID);
    // Check post category restriction
    foreach ($categories as $cat) {
        $opt = get_option("category_{$cat->term_id}");
        if (isset($opt['_um_accessible'])) {
            switch ($opt['_um_accessible']) {
                case 0:
                    // Open to everyone
                    $ultimatemember->access->allow_access = true;
                    $ultimatemember->access->redirect_handler = false;
                    // open to everyone
                    break;
                case 1:
                    // Logged out users only
                    if (is_user_logged_in()) {
                        $ultimatemember->access->redirect_handler = isset($opt['_um_redirect']) ? $opt['_um_redirect'] : site_url();
                    }
                    if (!is_user_logged_in()) {
                        $ultimatemember->access->allow_access = true;
                    }
                    break;
                case 2:
                    // Logged in users only
                    if (!is_user_logged_in()) {
                        $ultimatemember->access->redirect_handler = isset($opt['_um_redirect']) && !empty($opt['_um_redirect']) ? $opt['_um_redirect'] : um_get_core_page('login');
                        $ultimatemember->access->allow_access = false;
                    }
                    if (is_user_logged_in()) {
                        if (isset($opt['_um_roles']) && !empty($opt['_um_roles'])) {
                            if (in_array(um_user('role'), $opt['_um_roles'])) {
                                $ultimatemember->access->allow_access = true;
                            } else {
                                $ultimatemember->access->redirect_handler = isset($opt['_um_redirect']) && !empty($opt['_um_redirect']) ? $opt['_um_redirect'] : site_url();
                                $ultimatemember->access->allow_access = false;
                            }
                        } else {
                            // if allowed all roles
                            $ultimatemember->access->allow_access = true;
                        }
                    }
            }
        }
        // end if isset( $opt['_um_accessible'] )
        // if one of the categories has enabled restriction, apply its settings to the current post
        if ($ultimatemember->access->allow_access == false) {
            return;
        }
    }
    // end foreach
    if (!isset($args['custom_access_settings']) || $args['custom_access_settings'] == 0) {
        $um_post_id = apply_filters('um_access_control_for_parent_posts', $um_post_id);
        $args = $ultimatemember->access->get_meta($um_post_id);
        extract($args);
        if (!isset($args['custom_access_settings']) || $args['custom_access_settings'] == 0) {
            return;
        }
    }
    $redirect_to = null;
    if (!isset($accessible)) {
        return;
    }
    switch ($accessible) {
        case 0:
            $ultimatemember->access->allow_access = true;
            $ultimatemember->access->redirect_handler = false;
            // open to everyone
            break;
        case 1:
            $redirect_to = esc_url($access_redirect2);
            if (is_user_logged_in()) {
                $ultimatemember->access->allow_access = false;
            }
            if (!is_user_logged_in()) {
                $ultimatemember->access->allow_access = true;
            }
            if (!empty($redirect_to)) {
                $ultimatemember->access->redirect_handler = esc_url($redirect_to);
            } else {
                if (!is_user_logged_in()) {
                    $ultimatemember->access->redirect_handler = um_get_core_page("login");
                } else {
                    $ultimatemember->access->redirect_handler = um_get_core_page("user");
                }
            }
//.........这里部分代码省略.........
开发者ID:alexpull,项目名称:ultimatemember,代码行数:101,

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP um_get_default_avatar_uri函数代码示例发布时间:2022-05-23
下一篇:
PHP um_filtered_value函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap