本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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 “%2$s”. 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 “%3$s”. 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>';
//.........這裏部分代碼省略.........
示例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;
}