本文整理汇总了PHP中show_user_form函数的典型用法代码示例。如果您正苦于以下问题:PHP show_user_form函数的具体用法?PHP show_user_form怎么用?PHP show_user_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了show_user_form函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: signup_user
/**
* Setup the new user signup process
*
* @since MU
*
* @param string $user_name The username
* @param string $user_email The user's email
* @param array $errors
*/
function signup_user( $user_name = '', $user_email = '', $errors = '' ) {
global $active_signup;
if ( !is_wp_error($errors) )
$errors = new WP_Error();
$signup_for = isset( $_POST[ 'signup_for' ] ) ? esc_html( $_POST[ 'signup_for' ] ) : 'blog';
$signup_user_defaults = array(
'user_name' => $user_name,
'user_email' => $user_email,
'errors' => $errors,
);
/**
* Filter the default user variables used on the user sign-up form.
*
* @since 3.0.0
*
* @param array $signup_user_defaults {
* An array of default user variables.
*
* @type string $user_name The user username.
* @type string $user_email The user email address.
* @type array $errors An array of possible errors relevant to the sign-up user.
* }
*/
$filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults );
$user_name = $filtered_results['user_name'];
$user_email = $filtered_results['user_email'];
$errors = $filtered_results['errors'];
?>
<h2><?php printf( __( 'Get your own %s account in seconds' ), get_current_site()->site_name ) ?></h2>
<form id="setupform" method="post" action="wp-signup.php" novalidate="novalidate">
<input type="hidden" name="stage" value="validate-user-signup" />
<?php
/** This action is documented in wp-signup.php */
do_action( 'signup_hidden_fields', 'validate-user' );
?>
<?php show_user_form($user_name, $user_email, $errors); ?>
<p>
<?php if ( $active_signup == 'blog' ) { ?>
<input id="signupblog" type="hidden" name="signup_for" value="blog" />
<?php } elseif ( $active_signup == 'user' ) { ?>
<input id="signupblog" type="hidden" name="signup_for" value="user" />
<?php } else { ?>
<input id="signupblog" type="radio" name="signup_for" value="blog" <?php checked( $signup_for, 'blog' ); ?> />
<label class="checkbox" for="signupblog"><?php _e('Gimme a site!') ?></label>
<br />
<input id="signupuser" type="radio" name="signup_for" value="user" <?php checked( $signup_for, 'user' ); ?> />
<label class="checkbox" for="signupuser"><?php _e('Just a username, please.') ?></label>
<?php } ?>
</p>
<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Next') ?>" /></p>
</form>
<?php
}
示例2: signup_user
function signup_user($user_name = '', $user_email = '', $errors = '')
{
global $current_site, $active_signup;
if (!is_wp_error($errors)) {
$errors = new WP_Error();
}
if (isset($_POST['signup_for'])) {
$signup[esc_html($_POST['signup_for'])] = 'checked="checked"';
} else {
$signup['blog'] = 'checked="checked"';
}
//TODO - This doesn't seem to do anything do we really need it?
$signup['user'] = isset($signup['user']) ? $signup['user'] : '';
// allow definition of default variables
$filtered_results = apply_filters('signup_user_init', array('user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors));
$user_name = $filtered_results['user_name'];
$user_email = $filtered_results['user_email'];
$errors = $filtered_results['errors'];
?>
<h2><?php
printf(__('Get your own %s account in seconds'), $current_site->site_name);
?>
</h2>
<form id="setupform" method="post" action="wp-signup.php">
<input type="hidden" name="stage" value="validate-user-signup" />
<?php
do_action("signup_hidden_fields");
?>
<?php
show_user_form($user_name, $user_email, $errors);
?>
<p>
<?php
if ($active_signup == 'blog') {
?>
<input id="signupblog" type="hidden" name="signup_for" value="blog" />
<?php
} elseif ($active_signup == 'user') {
?>
<input id="signupblog" type="hidden" name="signup_for" value="user" />
<?php
} else {
?>
<input id="signupblog" type="radio" name="signup_for" value="blog" <?php
echo $signup['blog'];
?>
/>
<label class="checkbox" for="signupblog"><?php
_e('Gimme a site!');
?>
</label>
<br />
<input id="signupuser" type="radio" name="signup_for" value="user" <?php
echo $signup['user'];
?>
/>
<label class="checkbox" for="signupuser"><?php
_e('Just a username, please.');
?>
</label>
<?php
}
?>
</p>
<p class="submit"><input type="submit" name="submit" class="submit" value="<?php
esc_attr_e('Next');
?>
" /></p>
</form>
<?php
}
示例3: signup_user
/**
* Setup the new user signup process
*
* @since MU
*
* @uses apply_filters() filter $filtered_results
* @uses show_user_form() to display the user registration form
* @param string $user_name The username
* @param string $user_email The user's email
* @param array $errors
*/
function signup_user($user_name = '', $user_email = '', $errors = '')
{
global $current_site, $active_signup;
$jmm_options = get_option('helfjmm_options');
if (!is_null($jmm_options['perpage']) && $jmm_options['perpage'] != "XXXXXX") {
$goto = get_permalink($jmm_options['perpage']);
} else {
$goto = '/wp-signup.php';
}
if (!is_wp_error($errors)) {
$errors = new WP_Error();
}
$signup_for = isset($_POST['signup_for']) ? esc_html($_POST['signup_for']) : 'blog';
$signup_user_defaults = array('user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors);
/**
* Filter the default user variables used on the user sign-up form.
*
* @since 3.0.0
*
* @param array $signup_user_defaults {
* An array of default user variables.
*
* @type string $user_name The user username.
* @type string $user_email The user email address.
* @type array $errors An array of possible errors relevant to the sign-up user.
* }
*/
$filtered_results = apply_filters('signup_user_init', $signup_user_defaults);
$user_name = $filtered_results['user_name'];
$user_email = $filtered_results['user_email'];
$errors = $filtered_results['errors'];
?>
<h2><?php
printf(__('Create your account on %s', 'join-my-multisite'), $current_site->site_name);
?>
</h2>
<form id="setupform" method="post" action="<?php
echo $goto;
?>
">
<input type="hidden" name="stage" value="validate-user-signup" />
<?php
/** This action is documented in wp-signup.php */
do_action('signup_hidden_fields', 'validate-user');
?>
<?php
show_user_form($user_name, $user_email, $errors);
?>
<p><input id="signupblog" type="hidden" name="signup_for" value="user" /></p>
<p class="submit"><input type="submit" name="submit" class="submit" value="<?php
esc_attr_e('Signup', 'join-my-multisite');
?>
" /></p>
</form>
<?php
}
示例4: signup_user
function signup_user($user_name = '', $user_email = '', $errors = '')
{
global $current_site, $active_signup;
if (!is_wp_error($errors)) {
$errors = new WP_Error();
}
if (isset($_POST['signup_for'])) {
$signup[wp_specialchars($_POST['signup_for'])] = 'checked="checked"';
} else {
$signup['blog'] = 'checked="checked"';
}
// allow definition of default variables
$filtered_results = apply_filters('signup_user_init', array('user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors));
$user_name = $filtered_results['user_name'];
$user_email = $filtered_results['user_email'];
$errors = $filtered_results['errors'];
?>
<h2><?php
printf(__('Get your own %s account in seconds'), $current_site->site_name);
?>
</h2>
<form id="setupform" method="post" action="wp-signup.php">
<input type="hidden" name="stage" value="validate-user-signup" />
<?php
do_action("signup_hidden_fields");
?>
<?php
show_user_form($user_name, $user_email, $errors);
?>
<p>
<input id="signupblog" type="hidden" name="signup_for" value="blog" />
</p>
<br />
<input id="submit" type="submit" name="submit" class="submit" value="<?php
_e('Next »');
?>
" />
</form>
<?php
}
示例5: show_user_form
$login = "";
show_user_form("create");
} elseif ($create == "Create User" && !check_input()) {
show_user_form("create");
} elseif ($modify == "Modify User" && !check_input()) {
show_user_form("modify");
} elseif ($mod == true) {
// pull existing data from database
$query = "SELECT {$userfields} FROM users WHERE id={$modarray['1']};";
$r = $db->Execute($query);
$fieldname = strtok($userfields, ",");
while ($fieldname) {
${$fieldname} = $r->fields["{$fieldname}"];
$fieldname = strtok(",");
}
show_user_form("modify");
} else {
echo "<table align='center' border='1'><caption><h5>";
if ($modify == "Modify User") {
modify($db, "modify");
}
if ($create == "Create User") {
modify($db, "create");
}
if ($del == true) {
if (!delete_user($db, $delarray[1])) {
echo "</table>\n";
printfooter();
exit;
}
}