bp_blogs_signup_blog

Output the input fields for the blog creation form.

Description

bp_blogs_signup_blog( (string) $blogname = '', (string) $blog_title = '', (string) $errors = '' ); 

Parameters (3)

0. $blogname — Optional. (string) => ''
The default blog name (path or domain).
1. $blog_title — Optional. (string) => ''
The default blog title.
2. $errors — Optional. (string) => ''
The WP_Error object returned by a previous submission attempt.

Usage

  1. if ( !function_exists( 'bp_blogs_signup_blog' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-blogs/bp-blogs-template.php'; 
  3.  
  4. // Optional. The default blog name (path or domain). 
  5. $blogname = ''; 
  6.  
  7. // Optional. The default blog title. 
  8. $blog_title = ''; 
  9.  
  10. // Optional. The WP_Error object returned by a previous 
  11. // submission attempt. 
  12. $errors = ''; 
  13.  
  14. // NOTICE! Understand what this does before running. 
  15. $result = bp_blogs_signup_blog($blogname, $blog_title, $errors); 
  16.  

Defined (1)

The function is defined in the following location(s).

/bp-blogs/bp-blogs-template.php  
  1. function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) { 
  2. global $current_site; 
  3.  
  4. // Blog name. 
  5. if( !is_subdomain_install() ) 
  6. echo '<label for="blogname">' . __('Site Name:', buddypress) . '</label>'; 
  7. else 
  8. echo '<label for="blogname">' . __('Site Domain:', buddypress) . '</label>'; 
  9.  
  10. if ( $errmsg = $errors->get_error_message('blogname') ) { ?> 
  11.  
  12. <p class="error"><?php echo $errmsg ?></p> 
  13.  
  14. <?php } 
  15.  
  16. if ( !is_subdomain_install() ) 
  17. echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="63" /><br />'; 
  18. else 
  19. 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 />'; 
  20.  
  21. if ( !is_user_logged_in() ) { 
  22. print '(<strong>' . __( 'Your address will be ' , buddypress); 
  23.  
  24. if ( !is_subdomain_install() ) { 
  25. print $current_site->domain . $current_site->path . __( 'blogname' , buddypress); 
  26. } else { 
  27. print __( 'domain.' , buddypress) . $current_site->domain . $current_site->path; 
  28.  
  29. echo '.</strong> ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed so choose carefully!)' , buddypress) . '</p>'; 
  30.  
  31. // Blog Title. 
  32. ?> 
  33.  
  34. <label for="blog_title"><?php _e('Site Title:', buddypress) ?></label> 
  35.  
  36. <?php if ( $errmsg = $errors->get_error_message('blog_title') ) { ?> 
  37.  
  38. <p class="error"><?php echo $errmsg ?></p> 
  39.  
  40. <?php } 
  41. echo '<input name="blog_title" type="text" id="blog_title" value="'.esc_html($blog_title, 1).'" /></p>'; 
  42. ?> 
  43.  
  44. <fieldset class="create-site"> 
  45. <legend class="label"><?php _e('Privacy: I would like my site to appear in search engines, and in public listings around this network', buddypress) ?></legend> 
  46.  
  47. <label class="checkbox" for="blog_public_on"> 
  48. <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 } ?> /> 
  49. <strong><?php _e( 'Yes' , buddypress); ?></strong> 
  50. </label> 
  51. <label class="checkbox" for="blog_public_off"> 
  52. <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 } ?> /> 
  53. <strong><?php _e( 'No' , buddypress); ?></strong> 
  54. </label> 
  55. </fieldset> 
  56.  
  57. <?php 
  58.  
  59. /** 
  60. * Fires at the end of all of the default input fields for blog creation form. 
  61. * @since 1.0.0 
  62. * @param WP_Error $errors WP_Error object if any present. 
  63. */