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

PHP wp_logout_url函数代码示例

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

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



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

示例1: add_login_logout_link

 function add_login_logout_link($items, $args)
 {
     if (is_user_logged_in()) {
         $items .= '<li><a href="' . esc_url(wp_logout_url('/')) . '">Salir</a></li>';
     }
     return $items;
 }
开发者ID:betocastillo86,项目名称:bicimensajeria,代码行数:7,代码来源:User.php


示例2: ac_redirect_on_logout

 function ac_redirect_on_logout($links)
 {
     if (in_array('redirect_on_logout', (array) self::$options->general_settings)) {
         $links[15] = '| <a href="' . wp_logout_url(home_url()) . '" title="Log Out">Log Out</a>';
     }
     return $links;
 }
开发者ID:kitfrench,项目名称:Futurestep,代码行数:7,代码来源:core.php


示例3: widget

 /**
  * create the widget's public face
  */
 public function widget($args, $instance)
 {
     if (!isset($instance['title'])) {
         $instance['title'] = '';
     }
     $text = __('Admin', 'teaberry');
     $title = $instance['title'] == '' ? $text : $instance['title'];
     $title = apply_filters('widget_title', $title);
     /* before and after widget args */
     echo $args['before_widget'];
     if (!empty($title)) {
         echo $args['before_title'] . $title . $args['after_title'];
     }
     echo '<ul>';
     echo wp_register('<li>', '</li>', false);
     $redirect = is_home() ? false : get_permalink();
     /* show different link based on user status */
     if (is_user_logged_in()) {
         $url = wp_logout_url($redirect);
         $text = __('Logout', 'teaberry');
         echo '<li><a href="' . $url . '" title="Logout">' . $text . '</a></li>';
     } else {
         $url = wp_login_url($redirect);
         $text = __('Login', 'teaberry');
         echo '<li><a href="' . $url . '" title="Login">' . $text . '</a></li>';
     }
     echo '</ul>';
     echo $args['after_widget'];
 }
开发者ID:honeymustard,项目名称:teaberry,代码行数:32,代码来源:widgets.php


示例4: lrl_custom_form_filters

function lrl_custom_form_filters($args = array(), $post_id = null)
{
    global $id;
    $options = get_option('bootstrap_theme');
    $custom_comment_message = isset($options['comment_form_text']) ? $options['comment_form_text'] : null;
    if (null === $post_id) {
        $post_id = $id;
    } else {
        $id = $post_id;
    }
    $commenter = wp_get_current_commenter();
    $user = wp_get_current_user();
    $user_identity = $user->exists() ? $user->display_name : '';
    $req = get_option('require_name_email');
    $aria_req = $req ? " aria-required='true'" : '';
    $fields = array('author' => '
			<div class="comment-form-author clearfix">' . ' ' . '<input id="author" name="author" placeholder="Enter your Name..." type="text" value="' . esc_attr($commenter['comment_author']) . '" size="30"' . $aria_req . ' />
			</div>', 'email' => '
			<div class="comment-form-email clearfix">
			' . '<input id="email" name="email" placeholder="Enter your Email Address..." type="text" value="' . esc_attr($commenter['comment_author_email']) . '" size="30"' . $aria_req . ' />
			</div>', 'url' => '
			<div class="comment-form-url clearfix">
			' . '<input id="url" name="url" placeholder="Enter your Website..." type="text" value="' . esc_attr($commenter['comment_author_url']) . '" size="30" />
			</div>');
    $required_text = sprintf(' ' . __('Required fields are marked %s', 'bootstrap'), '<span class="required">*</span>');
    $defaults = array('fields' => apply_filters('comment_form_default_fields', $fields), 'comment_field' => '<textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>', '', 'must_log_in' => '<p class="must-log-in">' . sprintf(__('You must be <a href="%s">logged in</a> to post a comment.', 'bootstrap'), wp_login_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</p>', 'logged_in_as' => '<p class="logged-in-as">' . sprintf(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'bootstrap'), admin_url('profile.php'), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink($post_id)))) . '</p>', 'comment_notes_before' => null, 'comment_notes_after' => null, 'id_form' => 'commentform', 'id_submit' => 'submit', 'title_reply' => sprintf(__('Have a Comment?', 'bootstrap'), apply_filters('lrl_comment_form_message', $custom_comment_message)), 'title_reply_to' => __('Leave a Reply to %s', 'bootstrap'), 'cancel_reply_link' => __('Cancel', 'bootstrap'), 'label_submit' => __('Submit Comment', 'bootstrap'));
    return $defaults;
}
开发者ID:scotlanddig,项目名称:bootstrap_basic,代码行数:28,代码来源:comments.php


示例5: wc_template_redirect

/**
 * Handle redirects before content is output - hooked into template_redirect so is_page works.
 *
 * @return void
 */
function wc_template_redirect()
{
    global $wp_query, $wp;
    // When default permalinks are enabled, redirect shop page to post type archive url
    if (!empty($_GET['page_id']) && get_option('permalink_structure') == "" && $_GET['page_id'] == wc_get_page_id('shop')) {
        wp_safe_redirect(get_post_type_archive_link('product'));
        exit;
    } elseif (is_page(wc_get_page_id('checkout')) && sizeof(WC()->cart->get_cart()) == 0 && empty($wp->query_vars['order-pay']) && !isset($wp->query_vars['order-received'])) {
        wp_redirect(get_permalink(wc_get_page_id('cart')));
        exit;
    } elseif (isset($wp->query_vars['customer-logout'])) {
        wp_redirect(str_replace('&amp;', '&', wp_logout_url(get_permalink(wc_get_page_id('myaccount')))));
        exit;
    } elseif (is_search() && is_post_type_archive('product') && apply_filters('woocommerce_redirect_single_search_result', true) && $wp_query->found_posts == 1) {
        $product = wc_get_product($wp_query->post);
        if ($product->is_visible()) {
            wp_safe_redirect(get_permalink($product->id), 302);
            exit;
        }
    } elseif (is_add_payment_method_page()) {
        WC()->payment_gateways();
    } elseif (is_checkout()) {
        // Buffer the checkout page
        ob_start();
        // Ensure gateways and shipping methods are loaded early
        WC()->payment_gateways();
        WC()->shipping();
    }
}
开发者ID:uwitec,项目名称:findgreatmaster,代码行数:34,代码来源:wc-template-functions.php


示例6: wepromotethis_search_form

function wepromotethis_search_form($form)
{
    global $hop;
    $plink = "http://www.wepromotethis.com/hop/" . $hop;
    $eplink = urlencode($plink);
    $socialLink = '';
    if (function_exists('display_social4i')) {
        $socialLink = display_social4i("large", "align-right");
        // Modify $socialLink so that the twitter, facebook, and google plus buttons display properly
        $socialLink = preg_replace('/data-url="([^"]+)"/i', 'data-url="' . $plink . '" ', $socialLink);
        $socialLink = preg_replace('/data-counturl="([^"]+)"/i', 'data-counturl="wepromotethis.com" ', $socialLink);
        $socialLink = preg_replace('/data-text="([^"]+)"/i', 'data-text="I just turned my computer into an ATM. Thanks #WPT !!! " ', $socialLink);
        $socialLink = preg_replace('/(<g:plusone.* href=)"([^"]+)"/i', '$1"https://plus.google.com/106500919528675853199"', $socialLink);
        $socialLink = preg_replace('/(<fb:like.* href=|fb-like.* data-href=)"([^"]+)"/i', '$1"https://www.facebook.com/pages/WePromoteThiscom/367519556648222?ref=hl"', $socialLink);
    }
    if (function_exists('theme_my_login')) {
        //global $theme_my_login;
        //$themeMyLoginForm = $theme_my_login -> shortcode(wp_parse_args('[widget_theme_my_login]'));
        //$themeMyLoginForm = $theme_my_login -> shortcode(wp_parse_args('[theme_my_login]'));
        ob_start();
        theme_my_login(wp_parse_args('[widget_theme_my_login]'));
        //theme_my_login(wp_parse_args('[theme_my_login]'));
        $themeMyLoginForm = ob_get_contents();
        ob_end_clean();
    }
    //$themeMyLoginForm = wp_login_form( array('echo' => false) );
    $form .= "<div class='register_button wpt_loggedout'>\r\n    <div>\r\n    " . $themeMyLoginForm . "\r\n    </div>\r\n    </div>\r\n\r\n    <div class='logout_button wpt_loggedin'>\r\n    <a href='" . wp_logout_url(home_url()) . "' title='Logout'>Logout</a>\r\n    </div>\r\n    \r\n    <div class='sociallink_page_header'>\r\n    " . $socialLink . "\r\n    </div>\r\n    ";
    return $form;
}
开发者ID:laiello,项目名称:we-promote-this,代码行数:29,代码来源:functions.php


示例7: ellak_social_links

function ellak_social_links()
{
    ?>
	<div class="header-login">
				<?php 
    if (is_user_logged_in()) {
        ?>
				<a href="<?php 
        echo esc_url(get_edit_user_link());
        ?>
"><?php 
        _e('Ο λογαριασμός μου', 'gpchild-ellak');
        ?>
</a>
				<a href="<?php 
        echo esc_url(wp_logout_url(get_permalink()));
        ?>
"><?php 
        _e('Αποσύνδεση', 'gpchild-ellak');
        ?>
</a>

				<?php 
    } else {
        if (get_option('users_can_register')) {
            ?>
				<a href="<?php 
            echo esc_url(wp_registration_url());
            ?>
"><?php 
            _e('Εγγραφή', 'gpchild-ellak');
            ?>
</a>
				<?php 
        }
        // get_option
        ?>

				<a href="<?php 
        echo esc_url(wp_login_url());
        ?>
"><?php 
        _e('Συνδεση', 'gpchild-ellak');
        ?>
</a>

				<?php 
    }
    // is_user_logged_in
    ?>
			</div>
	<div class="header-social-links">
		<ul class="social-links">
			<li class="social-link-facebook"><a href="https://www.facebook.com/CreativeCommonsGreece" target="_blank"><span>Facebook</span></a></li>
			<li class="social-link-twitter"><a href="https://www.twitter.com/cc_greece" target="_blank"><span>Twitter</span></a></li>
			<li class="social-link-rss"><a href="https://ellak.gr/rss-feeds/" target="_blank"><span>RSS</span></a></li>
		</ul>
	</div><!-- .header-social-links -->
<?php 
}
开发者ID:eellak,项目名称:gpchild-ellak-CC,代码行数:60,代码来源:functions.php


示例8: evc_lock_unlock

function evc_lock_unlock($url)
{
    global $user_ID, $post;
    $options = get_option('evc_lock');
    if (!$options || !isset($options['vk_lock_text'])) {
        $options['vk_lock_text'] = 'Чтобы увидеть скрытое содержимое, нужно';
    }
    $id = evc_get_vk_id($url);
    if (!$id) {
        return 'Cant get vk item id';
    }
    // Cant get vk item id
    if (isset($_COOKIE['vkUnLock' . $id]) && $_COOKIE['vkUnLock' . $id] == $id) {
        return $id;
    }
    if (!is_user_logged_in()) {
        // Need Enter via VK and Subscribe
        return '<p>' . $options['vk_lock_text'] . ' <a href= "' . evc_auth_login_url() . '" title = "Войти на сайт через ВКонтакте">войти на сайт через ВКонтакте</a>.</p>';
    }
    if (false == ($vk_user_id = get_user_meta($user_ID, 'vk_item_id', true))) {
        // Need Enter via VK
        return '<p>' . $options['vk_lock_text'] . ' <a href= "' . wp_logout_url(get_permalink($post->ID)) . '" title = "Выйти из своей учетной записи">выйти</a> и <a href= "' . evc_auth_login_url() . '" title = "Войти на сайт через ВКонтакте">войти на сайт через ВКонтакте</a>.</p>';
    }
    if (!isset($_COOKIE['vkUnLock' . $id]) || $_COOKIE['vkUnLock' . $id] != $id) {
        //$id = ($id < 0) ? -1 * $id : $id;
        $is_member = evc_vkapi_groups_is_member(array('group_id' => $id < 0 ? -1 * $id : $id, 'user_id' => $vk_user_id));
        if (!$is_member) {
            // Need Subscribe
            return '<p>' . $options['vk_lock_text'] . ' ' . evc_widget_subscribe(null, array(), $id, 'evc-vk-lock') . '</p>';
        }
        //setcookie("vkUnLock", $id, time() + DAY_IN_SECONDS);
    }
    return $id;
}
开发者ID:prosenjit-itobuz,项目名称:upages,代码行数:34,代码来源:evc-lock.php


示例9: get_wp_login_form

        protected function get_wp_login_form($args = array())
        {
            $defaults = array('echo' => false, 'redirect' => (is_ssl() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'form_id' => 'loginform', 'label_username' => _x('Username', 'shortcode simple login', 'the7mk2'), 'label_password' => _x('Password', 'shortcode simple login', 'the7mk2'), 'label_remember' => _x('Remember Me', 'shortcode simple login', 'the7mk2'), 'label_log_in' => _x('Log In', 'shortcode simple login', 'the7mk2'), 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'remember' => true, 'value_username' => '', 'value_remember' => false);
            $args = wp_parse_args($args, apply_filters('login_form_defaults', $defaults));
            if (is_user_logged_in()) {
                global $user_identity;
                get_currentuserinfo();
                $form = '<p class="logged-in-as">' . sprintf(_x('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'shortcode simple login', 'the7mk2'), get_edit_user_link(), $user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink()))) . '</p>';
            } else {
                $login_form_top = apply_filters('login_form_top', '', $args);
                $login_form_middle = apply_filters('login_form_middle', '', $args);
                $login_form_bottom = apply_filters('login_form_bottom', '', $args);
                $form = '
					<form name="' . $args['form_id'] . '" id="' . $args['form_id'] . '" action="' . esc_url(site_url('wp-login.php', 'login_post')) . '" method="post">
						' . $login_form_top . '
						<p class="login-username">
							<label class="assistive-text" for="' . esc_attr($args['id_username']) . '">' . esc_html($args['label_username']) . '</label>
							<input type="text" name="log" placeholder="' . esc_attr($args['label_username']) . '" id="' . esc_attr($args['id_username']) . '" class="input" value="' . esc_attr($args['value_username']) . '" size="20" />
						</p>
						<p class="login-password">
							<label class="assistive-text" for="' . esc_attr($args['id_password']) . '">' . esc_html($args['label_password']) . '</label>
							<input type="password" name="pwd" placeholder="' . esc_attr($args['label_password']) . '" id="' . esc_attr($args['id_password']) . '" class="input" value="" size="20" />
						</p>
						' . $login_form_middle . '
						' . ($args['remember'] ? '<p class="login-remember"><label><input name="rememberme" type="checkbox" id="' . esc_attr($args['id_remember']) . '" value="forever"' . ($args['value_remember'] ? ' checked="checked"' : '') . ' /> ' . esc_html($args['label_remember']) . '</label></p>' : '') . '
						<p class="login-submit">
							<input type="submit" name="wp-submit" id="' . esc_attr($args['id_submit']) . '" class="button-primary" value="' . esc_attr($args['label_log_in']) . '" />
							<input type="hidden" name="redirect_to" value="' . esc_url($args['redirect']) . '" />
						</p>
						' . $login_form_bottom . '
					</form>';
            }
            return $form;
        }
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:34,代码来源:simple-login.php


示例10: zm_ajax_login_register_localized_js

function zm_ajax_login_register_localized_js()
{
    $redirect_url = get_option('ajax_login_register_redirect');
    // Just use the current page
    if (empty($redirect_url)) {
        global $wp;
        $formatted_url = trailingslashit(add_query_arg('', '', network_site_url($wp->request)));
    } elseif (strpos($redirect_url, 'http') === false) {
        $formatted_url = network_site_url($redirect_url);
    } else {
        $formatted_url = esc_url($redirect_url);
    }
    $redirect_url = apply_filters('zm_ajax_login_redirect', $formatted_url);
    $width = array('default' => 265, 'wide' => 440, 'extra_buttons' => 666, 'mobile' => 300);
    $style = get_option('ajax_login_register_default_style');
    $fb_button = get_option('ajax_login_register_facebook');
    if ($style == 'wide' && $fb_button) {
        $key = 'extra_buttons';
    } elseif (wp_is_mobile()) {
        $key = 'mobile';
    } elseif ($style == 'wide') {
        $key = 'wide';
    } else {
        $key = 'default';
    }
    $defaults = array('ajaxurl' => admin_url("admin-ajax.php"), 'login_handle' => get_option('ajax_login_register_advanced_usage_login'), 'register_handle' => get_option('ajax_login_register_advanced_usage_register'), 'redirect' => $redirect_url, 'dialog_width' => $width[$key], 'match_error' => AjaxLogin::status('passwords_do_not_match', 'description'), 'is_user_logged_in' => is_user_logged_in() ? 1 : 0, 'wp_logout_url' => wp_logout_url(site_url()), 'logout_text' => __('Logout', 'ajax_login_register'), 'close_text' => __('Close', 'ajax_login_register'), 'pre_load_forms' => get_option('ajax_login_register_pre_load_forms'));
    $localized = apply_filters('zm_ajax_login_register_localized_js', $defaults);
    return $localized;
}
开发者ID:jekv,项目名称:devia,代码行数:29,代码来源:plugin.php


示例11: url_shortcode

function url_shortcode($atts)
{
    // Attributes
    extract(shortcode_atts(array('type' => '', 'id' => '0', 'path' => '', 'title' => '', 'action' => '', 'class' => ''), $atts));
    if (!$id && !$path && !$title && !$action) {
        return home_url();
    } else {
        $page_id = 0;
        if ($id && is_numeric($id)) {
            $page_id = $id;
        }
        if ($path != '') {
            $page_id = get_page_by_path($path);
        }
        if ($title != '') {
            $page_id = get_page_by_title($title);
        }
        if ($action != '') {
            if ($action == 'logout') {
                return wp_logout_url();
            }
        }
        if ($page_id) {
            return get_page_link($page_id);
        } else {
            return null;
        }
    }
}
开发者ID:sgssandhu,项目名称:aione-tools,代码行数:29,代码来源:general.php


示例12: tpl_link_logout

/**
 * Include the logout link template
 * @param  string $label   	Link text. Default: 'Logout'
 * @param  string $classes 	Classes to add to the <a> tag. Default: 'logout'
 */
function tpl_link_logout($label = null, $classes = 'logout')
{
    if (is_null($label)) {
        $label = __('Logout', 'theme');
    }
    tpl('link', 'login', array('url' => wp_logout_url(), 'label' => $label, 'classes' => $classes));
}
开发者ID:andrewcroce,项目名称:TPL,代码行数:12,代码来源:link_functions.php


示例13: widget

    function widget($args, $instance)
    {
        global $wpdb;
        $user_id = get_current_user_id();
        $page_name = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE post_title ='" . get_option('wkmp_seller_login_page_tile') . "'");
        $seller_info = $wpdb->get_var("SELECT user_id FROM " . $wpdb->prefix . "mpsellerinfo WHERE user_id = '" . $user_id . "' and seller_value='1'");
        if ($seller_info > 0) {
            do_action('chat_with_me');
            echo '<div class="wk_seller"><h2>' . get_option('wkmp_seller_menu_tile') . '</h2>';
            echo '<ul class="wk_sellermenu">';
            echo '<li class="selleritem"><a href="' . home_url("?page_id=" . $page_name) . '&page=mpProfile">My Profile</a></li>
				 <li class="selleritem"><a href="' . home_url("?page_id=" . $page_name) . '&page=Product">Add Product</a></li>
				 <li class="selleritem"><a href="' . home_url("?page_id=" . $page_name) . '&page=List">Product List</a></li>
				 <li class="selleritem"><a href="' . home_url("?page_id=" . $page_name) . '&page=History">Order History</a></li>
				 <li class="selleritem"><a href="' . home_url("?page_id=" . $page_name) . '&page=Dashboard">Dashboard</a></li>
				 <li class="selleritem"><a href="' . home_url("?page_id=" . $page_name) . '&page=payment">My Payments</a></li>
				 <li class="selleritem"><a href="' . home_url("?page_id=" . $page_name) . '&page=epschg">Change Password</a></li>
				 <li class="selleritem"><a href="' . home_url("?page_id=" . $page_name) . '&page=To">Ask To Admin</a></li>
				 <li class="selleritem"><a href="' . wp_logout_url() . '" title="Logout">Logout</a></li>
				 </ul></div>';
        }
        if ($user_id > 0 && $seller_info == 0) {
            echo '<div class="wk_seller"><h2>Buyer Menu</h2>';
            echo '<ul class="wk_sellermenu">';
            echo '<li class="selleritem"><a href="' . home_url("?page_id=" . $page_name) . '&page=mpProfile">My Profile</a></li>
				 <li class="selleritem"><a href="' . wp_logout_url() . '" title="Logout">Logout</a></li>
开发者ID:pcuervo,项目名称:mobbily-wordpress,代码行数:26,代码来源:class-mp-sellerpanel_orig.php


示例14: login_link

 public static function login_link($args)
 {
     add_thickbox();
     global $ultimatemember;
     $out = '';
     if (is_user_logged_in()) {
         $out .= sprintf('<a href="%s" class="profile-link n8prp-button">Profile</a>', um_user_profile_url());
         $account_page_id = $ultimatemember->permalinks->core['account'];
         if (!empty($account_page_id)) {
             $out .= sprintf('<a href="%s" class="account-link n8prp-button">Account</a>', get_permalink($account_page_id));
         }
         $out .= sprintf('<a href="%s" class="logout-link n8prp-button">Log out</a>', wp_logout_url());
     } else {
         $register_page_id = $ultimatemember->permalinks->core['register'];
         if (!empty($register_page_id)) {
             $out .= sprintf('<a href="%s" class="register-link n8prp-button">Register</a>', get_permalink($register_page_id));
         }
         $login_page_id = $ultimatemember->permalinks->core['login'];
         if (!empty($login_page_id)) {
             $out .= sprintf('<a href="%s" class="login-link n8prp-button">Log in</a>', get_permalink($login_page_id));
         }
         //$out .= sprintf('<div id="n8prp-login-form" style="display:none;">%s</div>', do_shortcode('[ultimatemember form_id=1105]') );
         //$out .= '<a href="#TB_inline?width=300&height=550&inlineId=n8prp-login-form" class="thickbox n8prp-button">Log in</a>';
         //$out .= '<script type="text/javascript">jQuery(\'.thickbox\').each(function(index, value){';
         //$out .= 'var w=window.innerWidth*.85;var h=window.innerHeight*.85;if(w>300){w=300;}';
         //$out .= 'var newHref=jQuery(this).attr(\'href\').replace(\'width=300&height=550\', \'width=\'+w+\'&height=\'+h);';
         //$out .= 'jQuery(this).attr(\'href\',newHref);});</script>';
     }
     return $out;
 }
开发者ID:essl-pvac,项目名称:n8prp-theme,代码行数:30,代码来源:shortcodes.php


示例15: logout_url

 public function logout_url()
 {
     $app = $this->config->item('nts_app');
     $return_to = isset($GLOBALS['NTS_CONFIG'][$app]['FRONTEND_WEBPAGE']) ? $GLOBALS['NTS_CONFIG'][$app]['FRONTEND_WEBPAGE'] : get_bloginfo('wpurl');
     $to = wp_logout_url($return_to);
     return $to;
 }
开发者ID:RCMmedia,项目名称:rubicon,代码行数:7,代码来源:auth.php


示例16: create_dwb_menu

function create_dwb_menu()
{
    if (is_super_admin()) {
        return;
    }
    global $wp_admin_bar;
    $current_user = wp_get_current_user();
    $userinfo = $wp_admin_bar->get_node('user-info');
    $userinfo->href = get_permalink(get_id_by_slug("members-dashboard"));
    $avatar = get_avatar($userinfo->ID, 64);
    $userinfo->title = $avatar . $current_user->last_name;
    $array = (array) $userinfo;
    $wp_admin_bar->add_menu($array);
    $logout = $wp_admin_bar->get_node('logout');
    $logout->href = wp_logout_url(get_permalink(get_id_by_slug("members-login")));
    $array = (array) $logout;
    $wp_admin_bar->add_menu($array);
    $sitename = $wp_admin_bar->get_node('site-name');
    $sitename->href = home_url();
    $array = (array) $sitename;
    $wp_admin_bar->add_menu($array);
    $my_account = $wp_admin_bar->get_node('my-account');
    $avatar = get_avatar($userinfo->ID, 28);
    $my_account->title = "Hello, {$current_user->last_name}" . $avatar;
    $array = (array) $my_account;
    $wp_admin_bar->add_menu($array);
    $wp_admin_bar->remove_node('edit-profile');
    $wp_admin_bar->remove_node('wp-logo');
    $wp_admin_bar->remove_node('dashboard');
}
开发者ID:ntnvu,项目名称:tcb_online,代码行数:30,代码来源:functions.php


示例17: widget

    /**
     * Outputs the content of the widget
     *
     * @param array $args
     * @param array $instance
     */
    public function widget($args, $instance) {

        $title = apply_filters('widget_title', $instance['title']);

        echo $args['before_widget'];
        echo '<div class="event-widget">';

        if (is_user_logged_in()) {
            if (!empty($instance['title'])) {
                echo $args['before_title'] . __('Profile Links') . $args['after_title'];
            }
            $user_ID = get_current_user_id();
            $profile_id = get_user_meta($user_ID, 'uiu_profile', TRUE);
            $profile_link = !empty($profile_id) ? get_permalink($profile_id) : get_dashboard_url($user_ID);
            ?>
            <ul class="menu user-menu">
                <li class="menu-item"><a href="<?php echo $profile_link; ?>">My Profile</a>  </li>               
                <li class="menu-item"><a href="<?php echo wp_logout_url(site_url()); ?>">Logout</a>  </li>

            </ul>
            <?php
        } else {
            if (!empty($instance['title'])) {
                echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
            }
            wp_login_form($args);
        }
        echo $args['after_widget'];
    }
开发者ID:ergov2015,项目名称:rideflag,代码行数:35,代码来源:widgets-ajax-login.php


示例18: start_el

 function start_el(&$output, $item, $depth = 0, $args = array(), $current_object_id = 0)
 {
     if ($item->title == '{logout}') {
         if (!is_user_logged_in()) {
             return;
         } else {
             $item->url = wp_logout_url(home_url());
             $item->title = __('Logout', 'yit');
         }
     }
     global $wp_query;
     $indent = $depth ? str_repeat("\t", $depth) : '';
     $class_names = $value = '';
     $classes = empty($item->classes) ? array() : (array) $item->classes;
     $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item));
     $class_names = ' class="' . esc_attr($class_names) . '"';
     $output .= $indent . '<li id="menu-item-' . $item->ID . '"' . $value . $class_names . '>';
     if (is_array($args)) {
         $args = (object) $args;
     }
     $attributes = !empty($item->attr_title) ? ' title="' . esc_attr($item->attr_title) . '"' : '';
     $attributes .= !empty($item->target) ? ' target="' . esc_attr($item->target) . '"' : '';
     $attributes .= !empty($item->xfn) ? ' rel="' . esc_attr($item->xfn) . '"' : '';
     $attributes .= !empty($item->url) ? ' href="' . esc_attr($item->url) . '"' : '';
     $item_output = $args->before;
     $item_output .= '<a' . $attributes . '>';
     $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
     $item_output .= '</a>';
     $item_output .= $args->after;
     $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
 }
开发者ID:jayeshnair,项目名称:ctp,代码行数:31,代码来源:Walker_Top_Menu.php


示例19: wc_template_redirect

/**
 * Handle redirects before content is output - hooked into template_redirect so is_page works.
 */
function wc_template_redirect()
{
    global $wp_query, $wp;
    if (!empty($_GET['page_id']) && '' === get_option('permalink_structure') && wc_get_page_id('shop') == $_GET['page_id']) {
        // When default permalinks are enabled, redirect shop page to post type archive url
        wp_safe_redirect(get_post_type_archive_link('product'));
        exit;
    } elseif (is_page(wc_get_page_id('checkout')) && wc_get_page_id('checkout') !== wc_get_page_id('cart') && WC()->cart->is_empty() && empty($wp->query_vars['order-pay']) && !isset($wp->query_vars['order-received'])) {
        // When on the checkout with an empty cart, redirect to cart page
        wc_add_notice(__('Checkout is not available whilst your cart is empty.', 'woocommerce'), 'notice');
        wp_redirect(wc_get_page_permalink('cart'));
        exit;
    } elseif (isset($wp->query_vars['customer-logout'])) {
        // Logout
        wp_redirect(str_replace('&amp;', '&', wp_logout_url(wc_get_page_permalink('myaccount'))));
        exit;
    } elseif (is_search() && is_post_type_archive('product') && apply_filters('woocommerce_redirect_single_search_result', true) && 1 === absint($wp_query->found_posts)) {
        // Redirect to the product page if we have a single product
        $product = wc_get_product($wp_query->post);
        if ($product && $product->is_visible()) {
            wp_safe_redirect(get_permalink($product->get_id()), 302);
            exit;
        }
    } elseif (is_add_payment_method_page()) {
        // Ensure payment gateways are loaded early
        WC()->payment_gateways();
    } elseif (is_checkout()) {
        // Checkout pages handling
        // Buffer the checkout page
        ob_start();
        // Ensure gateways and shipping methods are loaded early
        WC()->payment_gateways();
        WC()->shipping();
    }
}
开发者ID:woocommerce,项目名称:woocommerce,代码行数:38,代码来源:wc-template-functions.php


示例20: endpoints

    function endpoints()
    {
        $params = array_merge(array('wordcampers_internal_api' => '0', 'action' => ''), $_GET);
        if ($params['wordcampers_internal_api'] === '1') {
            header('Content-Type: application/json');
            $data = array();
            if ($params['action'] === 'login_form') {
                $args = array('echo' => true, 'redirect' => home_url('/wp-admin/'), 'form_id' => 'loginform', 'label_username' => __('Username'), 'label_password' => __('Password'), 'label_remember' => __('Remember Me'), 'label_log_in' => __('Log In'), 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'remember' => true, 'value_username' => NULL, 'value_remember' => true);
                ob_start();
                wp_login_form($args);
                $data['login_form'] = ob_get_clean();
            } else {
                if ($params['action'] === 'logout_form') {
                    ob_start();
                    ?>
				<div class="aa_logout">
					Hello,
					<div class="aa_logout_user">
						$user_login, You are already logged in.
					</div>
					<a id="wp-submit" href="<?php 
                    echo wp_logout_url();
                    ?>
" title="Logout">
						Logout
					</a>
				</div>
				<?php 
                    $data['logout_form'] = ob_get_clean();
                }
            }
            echo json_encode($data);
            die;
        }
    }
开发者ID:khromov,项目名称:wordcamper-news-plugin,代码行数:35,代码来源:APIEndpoints.php



注:本文中的wp_logout_url函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP wp_lostpassword_url函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_logout函数代码示例发布时间: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