Skip to:
Content

BuddyPress.org

Ticket #5552: 5552.patch

File 5552.patch, 3.2 KB (added by boonebgorges, 5 years ago)
  • src/bp-core/bp-core-catchuri.php

    diff --git src/bp-core/bp-core-catchuri.php src/bp-core/bp-core-catchuri.php
    index 8b49816..e3abb72 100644
    function bp_core_enable_root_profiles() { 
    342342function bp_core_load_template( $templates ) {
    343343        global $post, $bp, $wp_query, $wpdb;
    344344
     345        // Store the name of the requested template for later use
     346        buddypress()->requested_template = $templates;
     347
    345348        // Determine if the root object WP page exists for this request
    346349        // note: get_page_by_path() breaks non-root pages
    347350        if ( !empty( $bp->unfiltered_uri_offset ) ) {
  • src/bp-core/bp-core-template.php

    diff --git src/bp-core/bp-core-template.php src/bp-core/bp-core-template.php
    index 3d71621..1e6018c 100644
    function bp_is_directory() { 
    12941294}
    12951295
    12961296/**
     1297 * Get the top-level template requested on this pageload.
     1298 *
     1299 * @since BuddyPress (2.1.0)
     1300 *
     1301 * @return string
     1302 */
     1303function bp_get_requested_template() {
     1304        return apply_filters( 'bp_get_requested_template', buddypress()->requested_template );
     1305}
     1306
     1307/**
    12971308 * Check to see if a component's URL should be in the root, not under a member page.
    12981309 *
    12991310 * - Yes ('groups' is root)    : http://domain.com/groups/the-group
  • src/bp-loader.php

    diff --git src/bp-loader.php src/bp-loader.php
    index e73cbf9..5e0ad53 100644
    class BuddyPress { 
    9595         */
    9696        public $active_components = array();
    9797
     98        /**
     99         * @var string Template requested for the current pageload.
     100         */
     101        public $requested_template = '';
     102
    98103        /** Option Overload *******************************************************/
    99104
    100105        /**
  • src/bp-templates/bp-legacy/buddypress/members/single/home.php

    diff --git src/bp-templates/bp-legacy/buddypress/members/single/home.php src/bp-templates/bp-legacy/buddypress/members/single/home.php
    index 0022cb3..0a61a71 100644
     
    2424
    2525                <?php do_action( 'bp_before_member_body' );
    2626
    27                 if ( bp_is_user_activity() || !bp_current_component() ) :
     27                // If a plugin is requesting the plugins.php template, skip
     28                // the component logic and load it directly
     29                if ( 'members/single/plugins' === bp_get_requested_template() ) :
     30                        bp_get_template_part( 'members/single/plugins' );
     31
     32                elseif ( bp_is_user_activity() || !bp_current_component() ) :
    2833                        bp_get_template_part( 'members/single/activity' );
    2934
    3035                elseif ( bp_is_user_blogs() ) :
  • src/bp-templates/bp-legacy/buddypress/members/single/plugins.php

    diff --git src/bp-templates/bp-legacy/buddypress/members/single/plugins.php src/bp-templates/bp-legacy/buddypress/members/single/plugins.php
    index 4c956fb..50833ef 100644
     
    1212
    1313                <?php do_action( 'bp_before_member_plugin_template' ); ?>
    1414
    15                 <?php if ( ! bp_is_current_component_core() ) : ?>
    16 
    1715                <div class="item-list-tabs no-ajax" id="subnav">
    1816                        <ul>
    1917                                <?php bp_get_options_nav(); ?>
     
    2220                        </ul>
    2321                </div><!-- .item-list-tabs -->
    2422
    25                 <?php endif; ?>
    26 
    2723                <h3><?php do_action( 'bp_template_title' ); ?></h3>
    2824
    2925                <?php do_action( 'bp_template_content' ); ?>