wpmu_signup_blog() - WordPress 函数参考中文文档

返回介绍

wpmu_signup_blog()

发布于 2017-09-11 字数3727 浏览 717 评论 0

wpmu_signup_blog( string $domain,  string $path,  string $title,  string $user,  string $user_email,  array $meta = array() )

Record site signup information for future activation.


描述


参数

$domain

(string)
(Required)
The requested domain.

$path

(string)
(Required)
The requested path.

$title

(string)
(Required)
The requested site title.

$user

(string)
(Required)
The user’s requested login name.

$user_email

(string)
(Required)
The user’s email address.

$meta

(array)
(Optional)
Signup meta data. By default, contains the requested privacy setting and lang_id.

Default value: array()


源代码

File: wp-includes/ms-functions.php

function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() )  {
	global $wpdb;

	$key = substr( md5( time() . wp_rand() . $domain ), 0, 16 );

	/**
	 * Filters the metadata for a site signup.
	 *
	 * The metadata will be serialized prior to storing it in the database.
	 *
	 * @since 4.8.0
	 *
	 * @param array  $meta       Signup meta data. Default empty array.
	 * @param string $domain     The requested domain.
	 * @param string $path       The requested path.
	 * @param string $title      The requested site title.
	 * @param string $user       The user's requested login name.
	 * @param string $user_email The user's email address.
	 * @param string $key        The user's activation key.
	 */
	$meta = apply_filters( 'signup_site_meta', $meta, $domain, $path, $title, $user, $user_email, $key );

	$wpdb->insert( $wpdb->signups, array(
		'domain' => $domain,
		'path' => $path,
		'title' => $title,
		'user_login' => $user,
		'user_email' => $user_email,
		'registered' => current_time('mysql', true),
		'activation_key' => $key,
		'meta' => serialize( $meta )
	) );

	/**
	 * Fires after site signup information has been written to the database.
	 *
	 * @since 4.4.0
	 *
	 * @param string $domain     The requested domain.
	 * @param string $path       The requested path.
	 * @param string $title      The requested site title.
	 * @param string $user       The user's requested login name.
	 * @param string $user_email The user's email address.
	 * @param string $key        The user's activation key.
	 * @param array  $meta       Signup meta data. By default, contains the requested privacy setting and lang_id.
	 */
	do_action( 'after_signup_site', $domain, $path, $title, $user, $user_email, $key, $meta );
}

更新日志

Version 描述
MU Introduced.

相关函数

Uses

  • wp-includes/ms-functions.php:
    signup_site_meta
  • wp-includes/ms-functions.php:
    after_signup_site
  • wp-includes/pluggable.php:
    wp_rand()
  • wp-includes/functions.php:
    current_time()
  • wp-includes/plugin.php:
    apply_filters()
  • wp-includes/plugin.php:
    do_action()
  • wp-includes/wp-db.php:
    wpdb::insert()
  • Show 2 more uses
    Hide more uses


Used By

  • wp-signup.php:
    validate_blog_signup()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!