本文整理汇总了PHP中wp_login_url函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_login_url函数的具体用法?PHP wp_login_url怎么用?PHP wp_login_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_login_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: wp_new_user_notification
/**
* Notify the blog admin of a new user, normally via email.
*
* @since 2.0
*
* @param int $user_id User ID
* @param string $plaintext_pass Optional. The user's plaintext password
*/
function wp_new_user_notification($user_id, $plaintext_pass = '')
{
global $LoginWithAjax;
//Copied out of /wp-includes/pluggable.php
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$message = sprintf(__('New user registration on your blog %s:'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
if (empty($plaintext_pass)) {
return;
}
//LWA Customizations
if ($LoginWithAjax->data['notification_override'] == true) {
//We can use our own logic here
$LoginWithAjax->new_user_notification($user_login, $plaintext_pass, $user_email, $blogname);
} else {
//Copied out of /wp-includes/pluggable.php
$message = sprintf(__('Username: %s'), $user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
$message .= wp_login_url() . "\r\n";
wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
}
}
开发者ID:Esleelkartea,项目名称:herramienta_para_autodiagnostico_ADEADA,代码行数:37,代码来源:pluggable.php
示例2: json_create_user
public function json_create_user()
{
$error = array("status" => 0, "msg" => __('There has been an error processing your request. Please, reload the page and try again.', Eab_EventsHub::TEXT_DOMAIN));
$data = stripslashes_deep($_POST);
$email = $data['email'];
if (empty($email)) {
$error['msg'] = __('Please, submit an email.', Eab_EventsHub::TEXT_DOMAIN);
die(json_encode($error));
}
if (!is_email($email)) {
$error['msg'] = __('Please, submit a valid email.', Eab_EventsHub::TEXT_DOMAIN);
die(json_encode($error));
}
if (email_exists($email)) {
$current_location = get_permalink();
if (!empty($data['location'])) {
// Let's make this sane first - it's coming from a POST request, so make that sane
$loc = wp_validate_redirect(wp_sanitize_redirect($data['location']));
if (!empty($loc)) {
$current_location = $loc;
}
}
$login_link = wp_login_url($current_location);
$login_message = sprintf(__('The email address already exists. Please <a href="%s">Login</a> and RSVP to the event.', Eab_EventsHub::TEXT_DOMAIN), $login_link);
$error['msg'] = $login_message;
die(json_encode($error));
}
$wordp_user = $this->_create_user($email);
if (is_object($wordp_user) && !empty($wordp_user->ID)) {
$this->_login_user($wordp_user);
} else {
die(json_encode($error));
}
die(json_encode(array("status" => 1)));
}
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:35,代码来源:eab-rsvps-rsvp_with_email.php
示例3: wp_new_user_notification_original
function wp_new_user_notification_original($user_id, $plaintext_pass = '', $include_fields = false, $activation_data = false, $welcome_email = '')
{
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
$admin_email = get_option('admin_email');
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
// Get the site domain and get rid of www.
$sitename = strtolower($_SERVER['SERVER_NAME']);
if (substr($sitename, 0, 4) == 'www.') {
$sitename = substr($sitename, 4);
}
$from_email = 'wordpress@' . $sitename;
$headers = sprintf("From: %s <%s>\r\n\\", $blogname, $from_email);
$message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
if ($include_fields) {
$message .= cimy_uef_mail_fields($user, $activation_data);
}
@wp_mail($admin_email, sprintf(__('[%s] New User Registration'), $blogname), $message, $headers);
if (empty($plaintext_pass)) {
return;
}
$welcome_email = str_replace("USERNAME", $user_login, $welcome_email);
$welcome_email = str_replace("PASSWORD", $plaintext_pass, $welcome_email);
if ($include_fields) {
$welcome_email .= cimy_uef_mail_fields($user, $activation_data);
}
$welcome_email = str_replace("LOGINLINK", wp_login_url(), $welcome_email);
wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $welcome_email, $headers);
}
开发者ID:nunomorgadinho,项目名称:SimplePhone,代码行数:34,代码来源:cimy_uef_email_handler.php
示例4: bp_members_admin_bar_my_account_menu
/**
* Add the "My Account" menu and all submenus.
*
* @since 1.6.0
*
* @todo Deprecate WP 3.2 Toolbar compatibility when we drop 3.2 support
*/
function bp_members_admin_bar_my_account_menu()
{
global $wp_admin_bar;
// Bail if this is an ajax request
if (defined('DOING_AJAX')) {
return;
}
// Logged in user
if (is_user_logged_in()) {
$bp = buddypress();
// Stored in the global so we can add menus easily later on
$bp->my_account_menu_id = 'my-account-buddypress';
// Create the main 'My Account' menu
$wp_admin_bar->add_menu(array('id' => $bp->my_account_menu_id, 'group' => true, 'title' => __('Edit My Profile', 'buddypress'), 'href' => bp_loggedin_user_domain(), 'meta' => array('class' => 'ab-sub-secondary')));
// Show login and sign-up links
} elseif (!empty($wp_admin_bar)) {
add_filter('show_admin_bar', '__return_true');
// Create the main 'My Account' menu
$wp_admin_bar->add_menu(array('id' => 'bp-login', 'title' => __('Log in', 'buddypress'), 'href' => wp_login_url(bp_get_requested_url())));
// Sign up
if (bp_get_signup_allowed()) {
$wp_admin_bar->add_menu(array('id' => 'bp-register', 'title' => __('Register', 'buddypress'), 'href' => bp_get_signup_page()));
}
}
}
开发者ID:jasonmcalpin,项目名称:BuddyPress,代码行数:32,代码来源:bp-members-adminbar.php
示例5: palo_filter_frontend_modal_link_atts
/**
* Sets the right href and class attributes for the modal link in menus
*/
function palo_filter_frontend_modal_link_atts($atts, $item, $args)
{
/**
* Ony apply to modal login or register
*/
if (in_array($atts['href'], array('#pa_modal_login', '#pa_modal_register'))) {
/**
* Add trigger if not logged in
*/
if (!is_user_logged_in()) {
$atts['class'] = assign_if_exists('class', $atts) . ' palo-modal-login-trigger';
}
/**
* Modify links
*/
if ('#pa_modal_login' == $atts['href']) {
if (is_user_logged_in()) {
$atts['href'] = wp_logout_url();
} else {
$atts['href'] = wp_login_url();
$atts['data-palo-modal'] = palo_append_qs(wp_login_url(), 'palo-login=1');
}
} else {
if ('#pa_modal_register' == $atts['href']) {
$atts['href'] = wp_registration_url();
$atts['data-palo-modal'] = palo_append_qs(wp_registration_url(), 'palo-login=1');
}
}
}
return $atts;
}
开发者ID:gvh1993,项目名称:project-vvvh,代码行数:34,代码来源:front.php
示例6: authenticate
/**
* Authenticates the user using SAML
*
* @return void
*/
public function authenticate()
{
if (isset($_GET['loggedout']) && $_GET['loggedout'] == 'true') {
header('Location: ' . get_option('siteurl'));
exit;
} elseif ($this->settings->get_allow_sso_bypass() == true && (isset($_GET['use_sso']) && $_GET['use_sso'] == 'false' || isset($_POST['use_sso']) && $_POST['use_sso'] == 'false')) {
// User wants native WP login, do nothing
} else {
$redirect_url = array_key_exists('redirect_to', $_GET) ? wp_login_url($_GET['redirect_to']) : get_admin_url();
$this->saml->requireAuth(array('ReturnTo' => $redirect_url));
$attrs = $this->saml->getAttributes();
if (array_key_exists($this->settings->get_attribute('username'), $attrs) && array_key_exists($this->settings->get_attribute('email'), $attrs)) {
$username = $attrs[$this->settings->get_attribute('username')][0];
$email = $attrs[$this->settings->get_attribute('email')][0];
if (get_user_by('login', $username)) {
//$this->simulate_signon($username);
// FIX https://wordpress.org/support/topic/passwords-of-existing-users-not-working-how-to-update#post-6835783
require_once ABSPATH . WPINC . '/ms-functions.php';
$user = get_user_by('login', $username);
if ($user) {
$newpass = $this->user_password($username, $this->secretsauce);
wp_set_password($newpass, $user->ID);
wp_update_user(array('ID' => $user->ID, 'user_email' => $email));
}
$this->simulate_signon($username);
} else {
$this->new_user($attrs);
}
} else {
die('A username and email was not provided. ' . $this->support_message);
}
}
}
开发者ID:pajtai,项目名称:saml-20-single-sign-on-alt,代码行数:38,代码来源:saml_client.php
示例7: security_check
public function security_check($template)
{
global $woocommerce, $current_user;
//var_dump( Instore_Reports::get_report_data() );
//make sure we are on console page
if (is_page(ins_set_instore_page_id())) {
//load scripts and style
$this->load_includes();
//check if user is logged in
if (is_user_logged_in()) {
//if instore login set display console
if (isset($woocommerce->session->instore_login)) {
$template = self::load_environment();
} else {
//if user locked out, logout and redirect to wp_login and display error message, otherwise prompt for instore login pin
if (!isset($settings['lockout']) || !in_array($current_user->ID, $setting['lockout'])) {
$template = self::instore_login();
} else {
ob_start();
add_filter('login_message', 'ins_login_message');
wp_redirect(wp_logout_url(get_permalink()));
}
}
//user not logged in redirect to login page
} else {
ob_start();
wp_redirect(wp_login_url(get_permalink()));
}
}
return $template;
}
开发者ID:jusmark123,项目名称:instore-Dev,代码行数:31,代码来源:class-instore-interface.php
示例8: csmm_plugin_init
function csmm_plugin_init()
{
// Plugin options from the database
$signals_csmm_options = get_option('signals_csmm_options');
// Localization
load_plugin_textdomain('signals', false, SIGNALS_CSMM_PATH . 'framework/langs');
// Getting custom login URL for the admin
$signals_login_url = wp_login_url();
// Checking for the server protocol status
if (isset($_SERVER['HTTPS']) === true) {
$signals_protocol = 'https';
} else {
$signals_protocol = 'http';
}
// This is the server address of the current page
$signals_server_url = $signals_protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
// Checking for the custom_login_url value
if (empty($signals_csmm_options['custom_login_url'])) {
$signals_csmm_options['custom_login_url'] = NULL;
}
// Not for the backend
// Only modifies the frontend of the system
if (!is_admin()) {
if ('1' == $signals_csmm_options['status']) {
/**
* A lot of checks are going on over here.
* We are checking for admin role, crawler status, and important wordpress pages to bypass.
* If the admin decides to exclude search engine from viewing the plugin, the website will be shown.
*/
if (false === strpos($signals_server_url, '/wp-login.php') && false === strpos($signals_server_url, '/wp-admin/') && false === strpos($signals_server_url, '/async-upload.php') && false === strpos($signals_server_url, '/upgrade.php') && false === strpos($signals_server_url, '/plugins/') && false === strpos($signals_server_url, '/xmlrpc.php') && false === strpos($signals_server_url, $signals_login_url) && false === strpos($signals_server_url, $signals_csmm_options['custom_login_url'])) {
// Checking for the search engine option
if ('1' == $signals_csmm_options['exclude_se']) {
if (!csmm_check_referrer()) {
if ('1' == $signals_csmm_options['show_logged_in']) {
// Checking if the user is logged in or not
if (!is_user_logged_in()) {
// Render the maintenance mode template since the user is not logged in
csmm_render_template($signals_csmm_options);
}
} else {
// Render the maintenance mode template
csmm_render_template($signals_csmm_options);
}
}
} else {
if ('1' == $signals_csmm_options['show_logged_in']) {
// Checking if the user is logged in or not
if (!is_user_logged_in()) {
// Render the maintenance mode template since the user is not logged in
csmm_render_template($signals_csmm_options);
}
} else {
// Render the maintenance mode template.
csmm_render_template($signals_csmm_options);
}
}
}
}
}
}
开发者ID:ConceptHaus,项目名称:atra,代码行数:60,代码来源:init.php
示例9: wp_new_user_notification
function wp_new_user_notification($user_id, $plaintext_pass = '')
{
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
if (empty($user_login)) {
return;
}
$user_email = stripslashes($user->user_email);
$message = sprintf(__('New user registration on your site %s:'), get_option('blogname')) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
$message .= __('Thanks!');
$headers = 'From:' . get_option('blogname') . ' <' . get_option('admin_email') . '>' . "\r\n";
@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message, $headers);
if (empty($plaintext_pass)) {
return;
}
$message = __('Hi there,') . "\r\n\r\n";
$message .= sprintf(__("Welcome to %s! Here's how to log in:"), get_option('blogname')) . "\r\n\r\n";
$message .= wp_login_url() . "\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n\r\n";
$message .= sprintf(__('If you have any problems, please contact me at %s.'), get_option('admin_email')) . "\r\n\r\n";
$message .= __('Thanks!');
$headers = 'From:' . get_option('blogname') . ' <' . get_option('admin_email') . '>' . "\r\n";
wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message, $headers);
}
开发者ID:mauricioabisay,项目名称:loc,代码行数:27,代码来源:accesspress-social-login-lite.php
示例10: add_login_link
function add_login_link()
{
global $redirect_to;
$login_uri = $this->_generate_uri($this->options['login_uri'], wp_login_url($redirect_to));
$auth_label = $this->options['auth_label'];
echo "\t" . '<p id="http-authentication-link"><a class="button-primary" href="' . htmlspecialchars($login_uri) . '">Log In with ' . htmlspecialchars($auth_label) . '</a></p>' . "\n";
}
开发者ID:zamentur,项目名称:wordpress_ynh,代码行数:7,代码来源:http-authentication.php
示例11: wp_new_user_notification
/**
* Notify the blog admin of a new user, normally via email.
*
* @since 2.0
*
* @param int $user_id User ID
* @param string $plaintext_pass Optional. The user's plaintext password
*/
function wp_new_user_notification($user_id, $plaintext_pass = '', $flag='') {
if(func_num_args() > 1 && $flag !== 1)
return;
$user = new WP_User($user_id);
$user_login = stripslashes($user->user_login);
$user_email = stripslashes($user->user_email);
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
@wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
if ( empty($plaintext_pass) )
return;
// 你可以在此修改发送给用户的注册通知Email
$message = sprintf(__('Username: %s'), $user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
$message .= '登陆网址: ' . wp_login_url() . "\r\n";
// sprintf(__('[%s] Your username and password'), $blogname) 为邮件标题
wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
}
开发者ID:ramo01,项目名称:1kapp,代码行数:38,代码来源:ludou-custom-register.php
示例12: login_url
public function login_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_login_url($return_to);
return $to;
}
开发者ID:RCMmedia,项目名称:rubicon,代码行数:7,代码来源:auth.php
示例13: theme_enqueue_styles
/**
* Scripts and styles
*/
function theme_enqueue_styles()
{
global $PNAThemeOptions;
// styles
wp_enqueue_style('parent-style', PARENT_URI . '/style.css');
wp_enqueue_style('child-style', CHILD_URI . '/css/style.css');
//scripts
wp_enqueue_script('jquery');
wp_enqueue_script('flexslider', CHILD_URI . '/js/flexslider-min.js', 'jquery', 2.1);
wp_enqueue_script('scripts', CHILD_URI . '/js/script.js', '', '');
$var_pna['signup_url'] = get_bloginfo('url') . "/cadastro";
$var_pna['login_url'] = wp_login_url(get_permalink());
if (is_page()) {
$post = get_post();
$var_pna['comments_open'] = $post->comment_status == "closed" ? true : false;
}
wp_localize_script('scripts', 'pna', $var_pna);
if (is_single() || is_page()) {
wp_enqueue_script('jquery-ui-dialog');
//se o usuário ainda nao atualizou o cadastro
if (function_exists('cdbr_current_user_updated_profile')) {
if (!cdbr_current_user_updated_profile()) {
wp_enqueue_script('msg-update-register', CHILD_URI . '/js/msg-update-register.js');
wp_localize_script('msg-update-register', 'msg', array('ajaxurl' => admin_url('admin-ajax.php'), 'cadastro_url' => get_bloginfo('url') . "/cadastro"));
wp_deregister_script('terms-of-use');
} else {
if ($PNAThemeOptions->isPopupMsgAllowed()) {
wp_enqueue_script('msg-guide-1', CHILD_URI . '/js/msg-guide.js');
wp_localize_script('msg-guide-1', 'msg', array('ajaxurl' => admin_url('admin-ajax.php'), 'termos_url' => get_bloginfo('url') . "/termos-de-uso", 'comments_gerais_url' => get_permalink() . "?comments=general"));
}
}
}
}
}
开发者ID:CoordCulturaDigital-Minc,项目名称:pna,代码行数:37,代码来源:functions.php
示例14: __construct
function __construct()
{
$eol = "\n";
$link = wp_login_url() . '?TB_iframe=true&width=800&height=600&sandbox=""';
parent::__construct('admin', 'js', false, 'toplevel_page_clp-settings', true);
parent::$admin_scripts .= $eol . 'jQuery(document).ready(function(){jQuery(\'#prev\').attr(\'href\', \'' . $link . '\');});' . $eol;
}
开发者ID:SayenkoDesign,项目名称:gogo-racing.com,代码行数:7,代码来源:CLP_DynamicJSClass.php
示例15: 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
示例16: facebook_login_shortcode
function facebook_login_shortcode($atts, $content = null)
{
extract(shortcode_atts(array('text' => 'Login / Register with Facebook', 'size' => 'medium'), $atts));
ob_start();
global $post;
?>
<a href="<?php
echo wp_login_url();
?>
?loginFacebook=1&redirect=<?php
echo the_permalink();
?>
" class="button <?php
echo $size;
?>
facebook-button" onclick="window.location = '<?php
echo wp_login_url();
?>
?loginFacebook=1&redirect='+window.location.href; return false;"><i class="icon-facebook"></i><?php
echo $text;
?>
</a><?php
$content = ob_get_contents();
ob_end_clean();
return $content;
}
开发者ID:bqevin,项目名称:wp-shopeasy,代码行数:26,代码来源:buttons.php
示例17: 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
示例18: response_message
protected function response_message($data)
{
if (!is_user_logged_in()) {
$data['redirect'] = esc_url($_POST['current_url']);
$data['status'] = 'error';
$data['notice'] = sprintf(__('You must <a href="%1$s">login</a> to be able to favorite listings.', APP_TD), wp_login_url($data['redirect']));
return $data;
}
$p2p = p2p_type(APP_FAVORITES_CONNECTION);
$user_id = get_current_user_id();
$post_id = (int) $_POST['item_id'];
if ('add' == $_POST[$this->action_var]) {
$date = current_time('mysql');
$data['status'] = $p2p->connect($post_id, $user_id, array('date' => $date));
$message = __("Added '%s' to your favorites.", APP_TD);
$data['notice'] = sprintf($message, get_the_title($post_id));
} else {
$data['status'] = $p2p->disconnect($post_id, $user_id);
$message = __("Removed '%s' from your favorites.", APP_TD);
$data['notice'] = sprintf($message, get_the_title($post_id));
}
if (is_wp_error($p2p)) {
$data['status'] = 'error';
$message = __("Could not add '%s' to favorites at this time.", APP_TD);
$data['notice'] = sprintf($message, get_the_title($post_id));
}
return $data;
}
开发者ID:kalushta,项目名称:darom,代码行数:28,代码来源:class-ajax-view-favorites.php
示例19: rtmedia_login_register_modal_popup
function rtmedia_login_register_modal_popup()
{
if (!is_user_logged_in()) {
$uri = '';
if (isset($_REQUEST['REQUEST_URI'])) {
$uri = esc_url_raw(wp_unslash($_REQUEST['REQUEST_URI']));
}
?>
<div class="rtmedia-popup mfp-hide rtm-modal" id="rtmedia-login-register-modal">
<div id="rtm-modal-container">
<h2 class="rtm-modal-title"><?php
esc_html_e('Please login', 'buddypress-media');
?>
</h2>
<p><?php
esc_html_e('You need to be logged in to upload Media or to create Album.', 'buddypress-media');
?>
</p>
<p>
<?php
echo esc_html__('Click', 'buddypress-media') . ' <a href="' . esc_url(wp_login_url($uri)) . '" title="' . esc_attr__('Login', 'buddypress-media') . '">' . esc_html__('HERE', 'buddypress-media') . '</a>' . esc_html__(' to login.', 'buddypress-media');
?>
</p>
</div>
</div>
<?php
}
}
开发者ID:rtCamp,项目名称:rtMedia,代码行数:30,代码来源:RTMediaLoginPopup.php
示例20: bp_members_admin_bar_my_account_menu
/**
* Add the "My Account" menu and all submenus.
*
* @since BuddyPress (r4151)
*/
function bp_members_admin_bar_my_account_menu()
{
global $bp, $wp_admin_bar;
// Bail if this is an ajax request
if (defined('DOING_AJAX')) {
return;
}
// Logged in user
if (is_user_logged_in()) {
// User avatar
$avatar = bp_core_fetch_avatar(array('item_id' => $bp->loggedin_user->id, 'email' => $bp->loggedin_user->userdata->user_email, 'width' => 16, 'height' => 16));
// Unique ID for the 'My Account' menu
$bp->my_account_menu_id = !empty($avatar) ? 'my-account-with-avatar' : 'my-account';
// Create the main 'My Account' menu
$wp_admin_bar->add_menu(array('id' => $bp->my_account_menu_id, 'title' => $avatar . bp_get_loggedin_user_fullname(), 'href' => $bp->loggedin_user->domain));
// Show login and sign-up links
} elseif (!empty($wp_admin_bar)) {
add_filter('show_admin_bar', '__return_true');
// Create the main 'My Account' menu
$wp_admin_bar->add_menu(array('id' => 'bp-login', 'title' => __('Log in', 'buddypress'), 'href' => wp_login_url()));
// Sign up
if (bp_get_signup_allowed()) {
$wp_admin_bar->add_menu(array('id' => 'bp-register', 'title' => __('Register', 'buddypress'), 'href' => bp_get_signup_page()));
}
}
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:31,代码来源:bp-members-adminbar.php
注:本文中的wp_login_url函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论