当前位置: 首页>>代码示例>>PHP>>正文


PHP signup_blog函数代码示例

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


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

示例1: validate_user_signup

/**
 * Validate the new user signup
 *
 * @since MU
 *
 * @return bool True if new user signup was validated, false if error
 */
function validate_user_signup()
{
    $result = validate_user_form();
    $user_name = $result['user_name'];
    $user_email = $result['user_email'];
    $errors = $result['errors'];
    if ($errors->get_error_code()) {
        signup_user($user_name, $user_email, $errors);
        return false;
    }
    if ('blog' == $_POST['signup_for']) {
        signup_blog($user_name, $user_email);
        return false;
    }
    /** This filter is documented in wp-signup.php */
    wpmu_signup_user($user_name, $user_email, apply_filters('add_signup_meta', array()));
    confirm_user_signup($user_name, $user_email);
    return true;
}
开发者ID:aaronholbrook,项目名称:ms-custom-signup,代码行数:26,代码来源:new-user.php

示例2: validate_blog_signup

/**
 * Validate new site signup
 *
 * @since MU
 *
 * @return bool True if the site signup was validated, false if error
 */
function validate_blog_signup() {
	// Re-validate user info.
	$user_result = wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] );
	$user_name = $user_result['user_name'];
	$user_email = $user_result['user_email'];
	$user_errors = $user_result['errors'];

	if ( $user_errors->get_error_code() ) {
		signup_user( $user_name, $user_email, $user_errors );
		return false;
	}

	$result = wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'] );
	$domain = $result['domain'];
	$path = $result['path'];
	$blogname = $result['blogname'];
	$blog_title = $result['blog_title'];
	$errors = $result['errors'];

	if ( $errors->get_error_code() ) {
		signup_blog($user_name, $user_email, $blogname, $blog_title, $errors);
		return false;
	}

	$public = (int) $_POST['blog_public'];
	$signup_meta = array ('lang_id' => 1, 'public' => $public);

	/** This filter is documented in wp-signup.php */
	$meta = apply_filters( 'add_signup_meta', $signup_meta );

	wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta);
	confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta);
	return true;
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:41,代码来源:wp-signup.php

示例3: validate_blog_signup

/**
 * Validate new site signup
 *
 * @since MU
 *
 * @uses wpmu_validate_user_signup() to retrieve an array of the new user data and errors
 * @uses wpmu_validate_blog_signup() to retrieve an array of the new site data and errors
 * @uses apply_filters() to make signup $meta filterable
 * @uses signup_user() to signup a new user
 * @uses signup_blog() to signup a the new user to a new site
 * @return bool True if the site signup was validated, false if error
 */
function validate_blog_signup()
{
    // Re-validate user info.
    $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
    extract($result);
    if ($errors->get_error_code()) {
        signup_user($user_name, $user_email, $errors);
        return false;
    }
    $result = wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title']);
    extract($result);
    if ($errors->get_error_code()) {
        signup_blog($user_name, $user_email, $blogname, $blog_title, $errors);
        return false;
    }
    $public = (int) $_POST['blog_public'];
    $meta = array('lang_id' => 1, 'public' => $public);
    //duplicate_hook
    $meta = apply_filters('add_signup_meta', $meta);
    wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta);
    confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta);
    return true;
}
开发者ID:openify,项目名称:wordpress-composer,代码行数:35,代码来源:wp-signup.php

示例4: rpr_preprocess_signup_form

        public function rpr_preprocess_signup_form()
        {
            global $active_signup, $stage;
            switch ($stage) {
                case 'user-signup':
                    if ($active_signup == 'all' || $_POST['signup_for'] == 'blog' && $active_signup == 'blog' || $_POST['signup_for'] == 'user' && $active_signup == 'user') {
                        /* begin validate_user_signup stage */
                        // validate signup form, do wpmu_validate_user_signup action
                        $result = wpmu_validate_user_signup(isset($_POST['user_name']) ? (string) $_POST['user_name'] : "", isset($_POST['user_email']) ? (string) $_POST['user_email'] : "");
                        extract($result);
                        if ($errors->get_error_code()) {
                            echo "signup_user";
                            signup_user($user_name, $user_email, $errors);
                            do_action('after_signup_form');
                            get_footer();
                            exit;
                        }
                        if ('blog' === $_POST['signup_for']) {
                            echo "signup_blog";
                            signup_blog($user_name, $user_email);
                            do_action('after_signup_form');
                            get_footer();
                            exit;
                        }
                        // collect meta, commit user to database, send email
                        wpmu_signup_user($user_name, $user_email, apply_filters('add_signup_meta', array()));
                        // previously, displayed confirm_user_signup message before signup_finished action
                        do_action('signup_finished');
                        /* end validate_user_signup stage */
                    } else {
                        _e('User registration has been disabled.');
                        ?>
						</div>
						</div>
						<?php 
                        do_action('after_signup_form');
                        get_footer();
                        exit;
                    }
                    break;
                case 'blog-signup':
                    if ($active_signup == 'all' || $active_signup == 'blog') {
                        /* begin validate_blog_signup stage */
                        $result = wpmu_validate_user_signup(isset($_POST['user_name']) ? (string) $_POST['user_name'] : "", isset($_POST['user_email']) ? (string) $_POST['user_email'] : "");
                        extract($result);
                        if ($errors->get_error_code()) {
                            echo "signup_user";
                            signup_user($user_name, $user_email, $errors);
                            do_action('after_signup_form');
                            get_footer();
                            exit;
                        }
                        $result = wpmu_validate_blog_signup(isset($_POST['blogname']) ? (string) $_POST['blogname'] : "", isset($_POST['blog_title']) ? (string) $_POST['blog_title'] : "");
                        extract($result);
                        if ($errors->get_error_code()) {
                            signup_blog($user_name, $user_email, $blogname, $blog_title, $errors);
                            do_action('after_signup_form');
                            get_footer();
                            exit;
                        }
                        // collect meta, commit user to database, send email
                        $meta = array('lang_id' => 1, 'public' => (int) $_POST['blog_public']);
                        wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, apply_filters('add_signup_meta', $meta));
                        // previously, displayed confirm_blog_signup message before signup_finished action
                        do_action('signup_finished');
                        /* end validate_blog_signup stage */
                    } else {
                        _e('Site registration has been disabled.');
                        ?>
						</div>
						</div>
						<?php 
                        do_action('after_signup_form');
                        get_footer();
                        exit;
                    }
                    break;
                default:
                    return;
            }
            /* begin wp-activate page */
            $key = (string) $_REQUEST['key'];
            // wpmu_create_user, wpmu_welcome_user_notification, add_new_user_to_blog, do wpmu_activate_user action
            $result = wpmu_activate_signup($key);
            if (is_wp_error($result)) {
                if ('already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code()) {
                    $signup = $result->get_error_data();
                    ?>
					<h2><?php 
                    _e('Your account is now active!');
                    ?>
</h2>
					<?php 
                    echo '<p class="lead-in">';
                    if ($signup->domain . $signup->path == '') {
                        printf(__('Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.'), network_site_url('wp-login.php', 'login'), $signup->user_login, $signup->user_email, wp_lostpassword_url());
                    } else {
                        printf(__('Your site at <a href="%1$s">%2$s</a> is active. You may now log in to your site using your chosen username of &#8220;%3$s&#8221;. Please check your email inbox at %4$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%5$s">reset your password</a>.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_email, wp_lostpassword_url());
                    }
                    echo '</p>';
//.........这里部分代码省略.........
开发者ID:bvassmer,项目名称:Register-Plus-Redux,代码行数:101,代码来源:rpr-signup.php

示例5: validate_blog_signup

/**
 * Validate new site signup
 *
 * @since MU
 *
 * @return bool True if the site signup was validated, false if error
 */
function validate_blog_signup()
{
    // Re-validate user info.
    $user_result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']);
    $user_name = $user_result['user_name'];
    $user_email = $user_result['user_email'];
    $user_errors = $user_result['errors'];
    if ($user_errors->get_error_code()) {
        signup_user($user_name, $user_email, $user_errors);
        return false;
    }
    $result = wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title']);
    $domain = $result['domain'];
    $path = $result['path'];
    $blogname = $result['blogname'];
    $blog_title = $result['blog_title'];
    $errors = $result['errors'];
    if ($errors->get_error_code()) {
        signup_blog($user_name, $user_email, $blogname, $blog_title, $errors);
        return false;
    }
    $public = (int) $_POST['blog_public'];
    $signup_meta = array('lang_id' => 1, 'public' => $public);
    // Handle the language setting for the new site.
    if (!empty($_POST['WPLANG'])) {
        $languages = signup_get_available_languages();
        if (in_array($_POST['WPLANG'], $languages)) {
            $language = wp_unslash(sanitize_text_field($_POST['WPLANG']));
            if ($language) {
                $signup_meta['WPLANG'] = $language;
            }
        }
    }
    /** This filter is documented in wp-signup.php */
    $meta = apply_filters('add_signup_meta', $signup_meta);
    wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta);
    confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta);
    return true;
}
开发者ID:aaemnnosttv,项目名称:develop.git.wordpress.org,代码行数:46,代码来源:wp-signup.php


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