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


PHP show_blog_form函数代码示例

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


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

示例1: signup_blog

/**
 * Setup the new site signup
 *
 * @since MU
 *
 * @param string $user_name The username
 * @param string $user_email The user's email address
 * @param string $blogname The site name
 * @param string $blog_title The site title
 * @param array $errors
 */
function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') {
	if ( !is_wp_error($errors) )
		$errors = new WP_Error();

	$signup_blog_defaults = array(
		'user_name'  => $user_name,
		'user_email' => $user_email,
		'blogname'   => $blogname,
		'blog_title' => $blog_title,
		'errors'     => $errors
	);

	/**
	 * Filter the default site creation variables for the site sign-up form.
	 *
	 * @since 3.0.0
	 *
	 * @param array $signup_blog_defaults {
	 *     An array of default site creation variables.
	 *
	 *     @type string $user_name  The user username.
	 *     @type string $user_email The user email address.
	 *     @type string $blogname   The blogname.
	 *     @type string $blog_title The title of the site.
	 *     @type array  $errors     An array of possible errors relevant to new site creation variables.
	 * }
	 */
	$filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults );

	$user_name = $filtered_results['user_name'];
	$user_email = $filtered_results['user_email'];
	$blogname = $filtered_results['blogname'];
	$blog_title = $filtered_results['blog_title'];
	$errors = $filtered_results['errors'];

	if ( empty($blogname) )
		$blogname = $user_name;
	?>
	<form id="setupform" method="post" action="wp-signup.php">
		<input type="hidden" name="stage" value="validate-blog-signup" />
		<input type="hidden" name="user_name" value="<?php echo esc_attr($user_name) ?>" />
		<input type="hidden" name="user_email" value="<?php echo esc_attr($user_email) ?>" />
		<?php
		/** This action is documented in wp-signup.php */
		do_action( 'signup_hidden_fields', 'validate-site' );
		?>
		<?php show_blog_form($blogname, $blog_title, $errors); ?>
		<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Signup') ?>" /></p>
	</form>
	<?php
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:62,代码来源:wp-signup.php

示例2: signup_blog

function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '')
{
    if (!is_wp_error($errors)) {
        $errors = new WP_Error();
    }
    // allow definition of default variables
    $filtered_results = apply_filters('signup_blog_init', array('user_name' => $user_name, 'user_email' => $user_email, 'blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors));
    $user_name = $filtered_results['user_name'];
    $user_email = $filtered_results['user_email'];
    $blogname = $filtered_results['blogname'];
    $blog_title = $filtered_results['blog_title'];
    $errors = $filtered_results['errors'];
    if (empty($blogname)) {
        $blogname = $user_name;
    }
    ?>
	<form id="setupform" method="post" action="wp-signup.php">
		<input type="hidden" name="stage" value="validate-blog-signup" />
		<input type="hidden" name="user_name" value="<?php 
    echo esc_attr($user_name);
    ?>
" />
		<input type="hidden" name="user_email" value="<?php 
    echo esc_attr($user_email);
    ?>
" />
		<?php 
    do_action("signup_hidden_fields");
    ?>
		<?php 
    show_blog_form($blogname, $blog_title, $errors);
    ?>
		<p class="submit"><input type="submit" name="submit" class="submit" value="<?php 
    esc_attr_e('Signup');
    ?>
" /></p>
	</form>
	<?php 
}
开发者ID:google-code-backups,项目名称:pumpmyvote,代码行数:39,代码来源:wp-signup.php


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