Skip to:
Content

BuddyPress.org

Ticket #7903: 7903.02.patch

File 7903.02.patch, 2.8 KB (added by imath, 7 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 c7dd4aef8..e2415b898 100644
    function bp_core_set_uri_globals() { 
    311311                                ) );
    312312
    313313                                if ( ! empty( $matched_types ) ) {
    314                                         $bp->current_member_type = reset( $matched_types );
     314                                        $bp->current_member_type             = reset( $matched_types );
     315                                        $bp->members->current_directory_type = $bp->current_member_type;
    315316                                        unset( $bp_uri[ $uri_offset + 1 ] );
    316317                                }
    317318                        }
  • src/bp-core/bp-core-template.php

    diff --git src/bp-core/bp-core-template.php src/bp-core/bp-core-template.php
    index b0b21e289..b6b5890a3 100644
    function bp_is_directory() { 
    19081908        return (bool) apply_filters( 'bp_is_directory', $retval );
    19091909}
    19101910
     1911/**
     1912 * Is this a component's type directory page?
     1913 *
     1914 * @since 3.2.0
     1915 *
     1916 * @return bool True if the current page is a component's type directory, otherwise false.
     1917 */
     1918function bp_is_directory_type() {
     1919        $bp        = buddypress();
     1920        $retval    = false;
     1921        $component = bp_current_component();
     1922
     1923        if ( bp_is_directory() && bp_is_active( $component ) ) {
     1924                $retval = ! empty( $bp->{$component}->current_directory_type );
     1925        }
     1926
     1927        /**
     1928         * Filters whether or not user is on a component's type directory page.
     1929         *
     1930         * @since 3.2.0
     1931         *
     1932         * @param bool   $retval    Whether or not user is on a component'type directory page.
     1933         * @param string $component The current component.
     1934         */
     1935        return (bool) apply_filters( 'bp_is_directory_type', $retval, $component );
     1936}
     1937
    19111938/**
    19121939 * Check to see if a component's URL should be in the root, not under a member page.
    19131940 *
    function bp_the_body_class() { 
    32453272                                $bp_classes[] = 'my-activity';
    32463273                        }
    32473274                } else {
    3248                         if ( bp_get_current_member_type() ) {
     3275                        if ( bp_is_directory_type() ) {
    32493276                                $bp_classes[] = 'type';
    32503277                        }
    32513278                }
  • src/bp-templates/bp-nouveau/includes/template-tags.php

    diff --git src/bp-templates/bp-nouveau/includes/template-tags.php src/bp-templates/bp-nouveau/includes/template-tags.php
    index ce2ad93f5..f497158ac 100644
    function bp_nouveau_nav_classes() { 
    907907                $nav_item   = $bp_nouveau->current_nav_item;
    908908                $classes    = array();
    909909
    910                 if ( 'directory' === $bp_nouveau->displayed_nav && ! empty( $nav_item->li_class ) ) {
    911                         $classes = (array) $nav_item->li_class;
     910                if ( 'directory' === $bp_nouveau->displayed_nav ) {
     911                        if ( ! empty( $nav_item->li_class ) ) {
     912                                $classes = (array) $nav_item->li_class;
     913                        }
     914
     915                        if ( bp_is_directory_type() ) {
     916                                $classes[] = 'no-ajax';
     917                        }
    912918                } elseif ( 'groups' === $bp_nouveau->displayed_nav || 'personal' === $bp_nouveau->displayed_nav ) {
    913919                        $classes  = array( 'bp-' . $bp_nouveau->displayed_nav . '-tab' );
    914920                        $selected = bp_current_action();