本文整理汇总了PHP中wp_logout_url函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_logout_url函数的具体用法?PHP wp_logout_url怎么用?PHP wp_logout_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_logout_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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'];
}
示例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;
}
示例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('&', '&', 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();
}
}
示例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;
}
示例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
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
}
示例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));
}
示例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>
示例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;
}
示例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;
}