Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/27/2011 03:11:41 AM (13 years ago)
Author:
boonebgorges
Message:

Introduces bp_blogs_get_subdomain_base(). Fixes subdomain address base on registration screen. Fixes #3684

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-template.php

    r5379 r5380  
    460460        echo '<span class="prefix_address">' . $current_site->domain . $current_site->path . '</span> <input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /><br />';
    461461    else
    462         echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /> <span class="suffix_address">.' . preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path . '</span><br />';
     462        echo '<input name="blogname" type="text" id="blogname" value="'.$blogname.'" maxlength="50" /> <span class="suffix_address">.' . bp_blogs_get_subdomain_base() . '</span><br />';
    463463
    464464    if ( !is_user_logged_in() ) {
     
    504504    do_action('signup_blogform', $errors);
    505505}
     506
     507/**
     508 * Echo the value of bp_blogs_get_subdomain_base()
     509 *
     510 * @since 1.6
     511 */
     512function bp_blogs_subdomain_base() {
     513    echo bp_blogs_get_subdomain_base();
     514}
     515    /**
     516     * Return the base URL to be displayed when a user chooses an address for a new blog, on
     517     * a subdomain installation of WordPress MS
     518     *
     519     * @since 1.6
     520     * @return str The base URL - eg, 'example.com' for site_url() example.com or www.example.com
     521     */
     522    function bp_blogs_get_subdomain_base() {
     523        global $current_site;
     524       
     525        return apply_filters( 'bp_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path );
     526    }
    506527
    507528function bp_blogs_validate_blog_signup() {
Note: See TracChangeset for help on using the changeset viewer.