當前位置: 首頁>>代碼示例>>PHP>>正文


PHP um_redirect_home函數代碼示例

本文整理匯總了PHP中um_redirect_home函數的典型用法代碼示例。如果您正苦於以下問題:PHP um_redirect_home函數的具體用法?PHP um_redirect_home怎麽用?PHP um_redirect_home使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了um_redirect_home函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: um_block_wpadmin_by_user_role

function um_block_wpadmin_by_user_role()
{
    global $ultimatemember;
    if (is_admin() && !defined('DOING_AJAX') && um_user('ID') && !um_user('can_access_wpadmin') && !is_super_admin(um_user('ID'))) {
        um_redirect_home();
    }
}
開發者ID:Zurtr,項目名稱:ultimatemember,代碼行數:7,代碼來源:um-actions-wpadmin.php

示例2: account

 function account()
 {
     global $ultimatemember;
     if (um_is_core_page('account') && !is_user_logged_in()) {
         um_redirect_home();
     }
     if (um_is_core_page('account')) {
         $ultimatemember->fields->set_mode = 'account';
         $ultimatemember->fields->editing = true;
         if (get_query_var('um_tab')) {
             $this->current_tab = get_query_var('um_tab');
         }
     }
 }
開發者ID:smithsa,項目名稱:daily-job-hunter,代碼行數:14,代碼來源:um-account.php

示例3: um_submit_account_details

function um_submit_account_details($args)
{
    global $ultimatemember;
    $tab = get_query_var('um_tab') ? get_query_var('um_tab') : 'general';
    if ($_POST['user_password'] && $_POST['confirm_user_password']) {
        $changes['user_pass'] = $_POST['user_password'];
        add_filter('send_password_change_email', 'um_send_password_change_email');
    }
    foreach ($_POST as $k => $v) {
        if (!strstr($k, 'password') && !strstr($k, 'um_account')) {
            $changes[$k] = $v;
        }
    }
    if (isset($changes['hide_in_members']) && $changes['hide_in_members'] == __('No', 'ultimatemember')) {
        delete_user_meta(um_user('ID'), 'hide_in_members');
        unset($changes['hide_in_members']);
    }
    // fired on account page, just before updating profile
    do_action('um_account_pre_update_profile', $changes, um_user('ID'));
    $ultimatemember->user->update_profile($changes);
    // delete account
    if ($_POST['single_user_password'] && $tab == 'delete') {
        if (current_user_can('delete_users') || um_user('can_delete_profile')) {
            if (!um_user('super_admin')) {
                $ultimatemember->user->delete();
                if (um_user('after_delete') && um_user('after_delete') == 'redirect_home') {
                    um_redirect_home();
                } elseif (um_user('delete_redirect_url')) {
                    exit(wp_redirect(um_user('delete_redirect_url')));
                } else {
                    um_redirect_home();
                }
            }
        }
    }
    do_action('um_post_account_update');
    do_action('um_after_user_account_updated', get_current_user_id());
    $url = $ultimatemember->account->tab_link($tab);
    $url = add_query_arg('updated', 'account', $url);
    if (function_exists('icl_get_current_language')) {
        if (icl_get_current_language() != icl_get_default_language()) {
            $url = $ultimatemember->permalinks->get_current_url(true);
            $url = add_query_arg('updated', 'account', $url);
            exit(wp_redirect($url));
        }
    }
    exit(wp_redirect($url));
}
開發者ID:samuelshih,項目名稱:daily-gazette,代碼行數:48,代碼來源:um-actions-account.php

示例4: logout_page

 function logout_page()
 {
     if (um_is_core_page('logout')) {
         if (is_user_logged_in()) {
             if (isset($_REQUEST['redirect_to']) && $_REQUEST['redirect_to'] !== '') {
                 $redirect_to = $_REQUEST['redirect_to'];
             } else {
                 if (um_user('after_logout') == 'redirect_home') {
                     $redirect_to = home_url();
                 } else {
                     $redirect_to = um_user('logout_redirect_url');
                 }
             }
             wp_logout();
             exit(wp_redirect($redirect_to));
         } else {
             um_redirect_home();
         }
     }
 }
開發者ID:BurlesonBrad,項目名稱:ultimatemember,代碼行數:20,代碼來源:um-logout.php

示例5: logout_page

 function logout_page()
 {
     if (um_is_core_page('logout')) {
         if (is_user_logged_in()) {
             if (isset($_REQUEST['redirect_to']) && $_REQUEST['redirect_to'] !== '') {
                 wp_logout();
                 session_unset();
                 exit(wp_redirect($_REQUEST['redirect_to']));
             } else {
                 if (um_user('after_logout') == 'redirect_home') {
                     wp_logout();
                     session_unset();
                     um_redirect_home();
                 } else {
                     wp_logout();
                     session_unset();
                     exit(wp_redirect(um_user('logout_redirect_url')));
                 }
             }
         } else {
             um_redirect_home();
         }
     }
 }
開發者ID:TeamSubjectMatter,項目名稱:juddfoundation,代碼行數:24,代碼來源:um-logout.php

示例6: access_members

 function access_members()
 {
     if (um_get_option('members_page') == 0 && um_is_core_page('members')) {
         um_redirect_home();
     }
 }
開發者ID:purplewhite,項目名稱:ultimatemember,代碼行數:6,代碼來源:um-members.php

示例7: um_pre_profile_shortcode

function um_pre_profile_shortcode($args)
{
    global $ultimatemember;
    extract($args);
    if ($mode == 'profile' && $ultimatemember->fields->editing == false) {
        $ultimatemember->fields->viewing = 1;
        if (um_get_requested_user()) {
            if (!um_can_view_profile(um_get_requested_user())) {
                um_redirect_home();
            }
            if (!um_current_user_can('edit', um_get_requested_user())) {
                $ultimatemember->user->cannot_edit = 1;
            }
            um_fetch_user(um_get_requested_user());
        } else {
            if (!is_user_logged_in()) {
                um_redirect_home();
            }
            if (!um_user('can_edit_profile')) {
                $ultimatemember->user->cannot_edit = 1;
            }
        }
    }
    if ($mode == 'profile' && $ultimatemember->fields->editing == true) {
        $ultimatemember->fields->editing = 1;
        if (um_get_requested_user()) {
            if (!um_current_user_can('edit', um_get_requested_user())) {
                um_redirect_home();
            }
            um_fetch_user(um_get_requested_user());
        }
    }
}
開發者ID:TeamSubjectMatter,項目名稱:juddfoundation,代碼行數:33,代碼來源:um-actions-profile.php

示例8: um_access_profile

function um_access_profile($user_id)
{
    if (!um_is_myprofile() && um_is_core_page('user') && !current_user_can('edit_users')) {
        um_fetch_user($user_id);
        if (!in_array(um_user('account_status'), array('approved'))) {
            um_redirect_home();
        }
        um_reset_user();
    }
}
開發者ID:alexpull,項目名稱:ultimatemember,代碼行數:10,代碼來源:um-actions-access.php


注:本文中的um_redirect_home函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。