Skip to:
Content

BuddyPress.org

Changeset 9468


Ignore:
Timestamp:
02/10/2015 12:24:27 AM (5 years ago)
Author:
johnjamesjacoby
Message:

Replace all references to bp_get_root_domain() . '/' . bp_get_blogs_root_slug() with bp_get_blogs_directory_permalink(), ensuring all usages and filters are applied uniformly. See #4954.

Location:
trunk/src
Files:
3 edited

Legend:

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

    r9413 r9468  
    13761376/**
    13771377 * Output a "Create a Site" link for users viewing their own profiles.
     1378 *
     1379 * This function is not used by BuddyPress as of 1.2, but is kept here for older
     1380 * themes that may still be using it.
    13781381 */
    13791382function bp_create_blog_link() {
    1380     if ( bp_is_my_profile() )
    1381 
    1382         /**
    1383          * Filters "Create a Site" links for users viewing their own profiles.
    1384          *
    1385          * @since BuddyPress (1.0.0)
    1386          *
    1387          * @param string $value HTML link for creating a site.
    1388          */
    1389         echo apply_filters( 'bp_create_blog_link', '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __( 'Create a Site', 'buddypress' ) . '</a>' );
     1383
     1384    // Don't show this link when not on your own profile
     1385    if ( ! bp_is_my_profile() ) {
     1386        return;
     1387    }
     1388
     1389    /**
     1390     * Filters "Create a Site" links for users viewing their own profiles.
     1391     *
     1392     * @since BuddyPress (1.0.0)
     1393     *
     1394     * @param string $value HTML link for creating a site.
     1395     */
     1396    echo apply_filters( 'bp_create_blog_link', '<a href="' . trailingslashit( bp_get_blogs_directory_permalink() . 'create' ) . '">' . __( 'Create a Site', 'buddypress' ) . '</a>' );
    13901397}
    13911398
     
    13981405
    13991406    // Don't show these tabs on a user's own profile
    1400     if ( bp_is_my_profile() )
     1407    if ( bp_is_my_profile() ) {
    14011408        return false;
    1402 
    1403     ?>
     1409    } ?>
    14041410
    14051411    <ul class="content-header-nav">
     
    14711477            'link_title' => __( 'Create a Site', 'buddypress' ),
    14721478            'link_class' => 'blog-create no-ajax',
    1473             'link_href'  => trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_blogs_root_slug() ) . trailingslashit( 'create' ),
     1479            'link_href'  => trailingslashit( bp_get_blogs_directory_permalink() . 'create' ),
    14741480            'wrapper'    => false,
    14751481            'block_self' => false,
  • trunk/src/bp-blogs/bp-blogs-widgets.php

    r9351 r9468  
    5151
    5252        if ( ! empty( $instance['link_title'] ) ) {
    53             $title = '<a href="' . trailingslashit( bp_get_root_domain() ) . trailingslashit( bp_get_blogs_root_slug() ) . '">' . esc_html( $title ) . '</a>';
     53            $title = '<a href="' . bp_get_blogs_directory_permalink() . '">' . esc_html( $title ) . '</a>';
    5454        }
    5555
  • trunk/src/bp-core/deprecated/2.1.php

    r9467 r9468  
    144144        if ( bp_blog_signup_enabled() ) {
    145145            echo '<li' . $alt . '>';
    146             echo '<a href="' . bp_get_root_domain() . '/' . bp_get_blogs_root_slug() . '/create/">' . __( 'Create a Site!', 'buddypress' ) . '</a>';
     146            echo '<a href="' . trailingslashit( bp_get_blogs_directory_permalink() . 'create' ) . '">' . __( 'Create a Site!', 'buddypress' ) . '</a>';
    147147            echo '</li>';
    148148        }
     
    350350            <?php if ( is_multisite() && bp_is_active( 'blogs' ) ) : ?>
    351351
    352                 <li><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_blogs_root_slug() ) . '?random-blog' ?>"  rel="nofollow"><?php _e( 'Random Site', 'buddypress' ) ?></a></li>
     352                <li><a href="<?php bp_blogs_directory_permalink(); ?>?random-blog"  rel="nofollow"><?php _e( 'Random Site', 'buddypress' ) ?></a></li>
    353353
    354354            <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.