Skip to:
Content

Changeset 5380


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

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

Location:
trunk
Files:
2 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() {
  • trunk/bp-themes/bp-default/registration/register.php

    r5004 r5380  
    191191
    192192                            <?php if ( is_subdomain_install() ) : ?>
    193                                 http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>" /> .<?php echo preg_replace( '|^https?://(?:www\.)|', '', site_url() ) ?>
     193                                http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>" /> .<?php bp_blogs_subdomain_base() ?>
    194194                            <?php else : ?>
    195195                                <?php echo site_url() ?>/ <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value() ?>" />
Note: See TracChangeset for help on using the changeset viewer.