Skip to:
Content

BuddyPress.org

Changeset 8683


Ignore:
Timestamp:
07/23/2014 08:43:51 PM (10 years ago)
Author:
imath
Message:

Make sure to get the subdomain base on Multisite configs

Move the function to get the subdomain base out of the blogs component to be sure it will be retrieved (when registering a new blog) even if the blogs component is not active.

fixes #5530

Location:
trunk/src
Files:
4 edited

Legend:

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

    r8662 r8683  
    10441044
    10451045/**
    1046  * Output the base URL for subdomain installations of WordPress Multisite.
    1047  *
    1048  * @since BuddyPress (1.6.0)
    1049  */
    1050 function bp_blogs_subdomain_base() {
    1051     echo bp_blogs_get_subdomain_base();
    1052 }
    1053     /**
    1054      * Return the base URL for subdomain installations of WordPress Multisite.
    1055      *
    1056      * @since BuddyPress (1.6.0)
    1057      *
    1058      * @return string The base URL - eg, 'example.com' for site_url() example.com or www.example.com.
    1059      */
    1060     function bp_blogs_get_subdomain_base() {
    1061         global $current_site;
    1062 
    1063         return apply_filters( 'bp_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path );
    1064     }
    1065 
    1066 /**
    10671046 * Process a blog registration submission.
    10681047 *
  • trunk/src/bp-core/deprecated/2.1.php

    r8677 r8683  
    571571}
    572572add_action( 'bp_adminbar_menus', 'bp_adminbar_notifications_menu', 8 );
     573
     574/**
     575 * Output the base URL for subdomain installations of WordPress Multisite.
     576 *
     577 * @since BuddyPress (1.6.0)
     578 *
     579 * @deprecated BuddyPress (2.1.0)
     580 */
     581function bp_blogs_subdomain_base() {
     582    _deprecated_function( __FUNCTION__, '2.1', 'bp_signup_subdomain_base()' );
     583    echo bp_signup_get_subdomain_base();
     584}
     585
     586/**
     587 * Return the base URL for subdomain installations of WordPress Multisite.
     588 *
     589 * @since BuddyPress (1.6.0)
     590 *
     591 * @return string The base URL - eg, 'example.com' for site_url() example.com or www.example.com.
     592 *
     593 * @deprecated BuddyPress (2.1.0)
     594 */
     595function bp_blogs_get_subdomain_base() {
     596    _deprecated_function( __FUNCTION__, '2.1', 'bp_signup_get_subdomain_base()' );
     597    return bp_signup_get_subdomain_base();
     598}
  • trunk/src/bp-members/bp-members-template.php

    r8677 r8683  
    15741574
    15751575/**
     1576 * Output the base URL for subdomain installations of WordPress Multisite.
     1577 *
     1578 * @since BuddyPress (2.1.0)
     1579 */
     1580function bp_signup_subdomain_base() {
     1581    echo bp_signup_get_subdomain_base();
     1582}
     1583    /**
     1584     * Return the base URL for subdomain installations of WordPress Multisite.
     1585     *
     1586     * Replaces bp_blogs_get_subdomain_base()
     1587     *
     1588     * @since BuddyPress (2.1.0)
     1589     *
     1590     * @return string The base URL - eg, 'example.com' for site_url() example.com or www.example.com.
     1591     */
     1592    function bp_signup_get_subdomain_base() {
     1593        global $current_site;
     1594
     1595        // In case plugins are still using this filter
     1596        $subdomain_base = apply_filters( 'bp_blogs_subdomain_base', preg_replace( '|^www\.|', '', $current_site->domain ) . $current_site->path );
     1597
     1598        return apply_filters( 'bp_signup_subdomain_base', $subdomain_base );
     1599    }
     1600
     1601/**
    15761602 * Output the 'signup_blog_titl' value submitted at signup.
    15771603 */
  • trunk/src/bp-templates/bp-legacy/buddypress/members/register.php

    r8442 r8683  
    134134
    135135                        <?php if ( is_subdomain_install() ) : ?>
    136                             http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" /> .<?php bp_blogs_subdomain_base(); ?>
     136                            http:// <input type="text" name="signup_blog_url" id="signup_blog_url" value="<?php bp_signup_blog_url_value(); ?>" /> .<?php bp_signup_subdomain_base(); ?>
    137137                        <?php else : ?>
    138138                            <?php echo home_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.