bp_blogs_signup_blog( string $blogname = '', string $blog_title = '', string|WP_Error $errors = '' )

Output the input fields for the blog creation form.

Description

Parameters

$blogname

(Optional) The default blog name (path or domain).

Default value: ''

$blog_title

(Optional) The default blog title.

Default value: ''

$errors

(Optional) The WP_Error object returned by a previous submission attempt.

Default value: ''

Source

File: bp-blogs/bp-blogs-template.php

1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) {
    global $current_site;
 
    // Blog name.
    if( !is_subdomain_install() )
        echo '<label for="blogname">' . __('Site Name:', 'buddyboss') . '</label>';
    else
        echo '<label for="blogname">' . __('Site Domain:', 'buddyboss') . '</label>';
 
    if ( $errmsg = $errors->get_error_message('blogname') ) { ?>
 
        <p class="error"><?php echo $errmsg ?></p>
 
    <?php }
 
    if ( !is_subdomain_install() )
        echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /><br />';
    else
        echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" ' . bp_get_form_field_attributes( 'blogname' ) . '/> <span class="suffix_address">.' . bp_signup_get_subdomain_base() . '</span><br />';
 
    if ( !is_user_logged_in() ) {
        print '(<strong>' . __( 'Your address will be ' , 'buddyboss');
 
        if ( !is_subdomain_install() ) {
            print $current_site->domain . $current_site->path . __( 'blogname' , 'buddyboss');
        } else {
            print __( 'domain.' , 'buddyboss') . $current_site->domain . $current_site->path;
        }
 
        echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' , 'buddyboss') . '</p>';
    }
 
    // Blog Title.
    ?>
 
    <label for="blog_title"><?php _e('Site Title:', 'buddyboss') ?></label>
 
    <?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?>
 
        <p class="error"><?php echo $errmsg ?></p>
 
    <?php }
    echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_html($blog_title, 1).'" /></p>';
    ?>
 
    <fieldset class="create-site">
        <legend class="label"><?php _e('Privacy: I would like my site to appear in search engines, and in public listings around this network', 'buddyboss') ?></legend>
 
        <label class="checkbox" for="blog_public_on">
            <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if( !isset( $_POST['blog_public'] ) || '1' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
            <strong><?php _e( 'Yes' , 'buddyboss'); ?></strong>
        </label>
        <label class="checkbox" for="blog_public_off">
            <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { ?>checked="checked"<?php } ?> />
            <strong><?php _e( 'No' , 'buddyboss'); ?></strong>
        </label>
    </fieldset>
 
    <?php
 
    /**
     * Fires at the end of all of the default input fields for blog creation form.
     *
     * @since BuddyPress 1.0.0
     *
     * @param WP_Error $errors WP_Error object if any present.
     */
    do_action('signup_blogform', $errors);
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.