Skip to:
Content

BuddyPress.org

Ticket #5408: 5408.diff

File 5408.diff, 4.4 KB (added by imath, 11 years ago)
  • bp-activity/bp-activity-screens.php

    diff --git bp-activity/bp-activity-screens.php bp-activity/bp-activity-screens.php
    index 787e247..cd0b679 100644
    if ( !defined( 'ABSPATH' ) ) exit; 
    2828 * @uses apply_filters() To call the 'bp_activity_screen_index' hook.
    2929 */
    3030function bp_activity_screen_index() {
    31         if ( !bp_displayed_user_id() && bp_is_activity_component() && !bp_current_action() ) {
     31        if ( bp_is_activity_directory() ) {
    3232                bp_update_is_directory( true, 'activity' );
    3333
    3434                do_action( 'bp_activity_screen_index' );
  • bp-blogs/bp-blogs-screens.php

    diff --git bp-blogs/bp-blogs-screens.php bp-blogs/bp-blogs-screens.php
    index 5ea62c3..16e7a4f 100644
    add_action( 'bp_screens', 'bp_blogs_screen_create_a_blog', 3 ); 
    4343 * Load the top-level Blogs directory.
    4444 */
    4545function bp_blogs_screen_index() {
    46         if ( is_multisite() && bp_is_blogs_component() && !bp_current_action() ) {
     46        if ( bp_is_blogs_directory() ) {
    4747                bp_update_is_directory( true, 'blogs' );
    4848
    4949                do_action( 'bp_blogs_screen_index' );
  • bp-core/bp-core-template.php

    diff --git bp-core/bp-core-template.php bp-core/bp-core-template.php
    index 51c1b38..2db9a55 100644
    function bp_is_current_component_core() { 
    14911491/** Activity ******************************************************************/
    14921492
    14931493/**
     1494 * Is the current page the activity directory ?
     1495 *
     1496 * @since BuddyPress (2.0.0)
     1497 *
     1498 * @return True if the current page is the activity directory.
     1499 */
     1500function bp_is_activity_directory() {
     1501        if ( ! bp_displayed_user_id() && bp_is_activity_component() && ! bp_current_action() )
     1502                return true;
     1503
     1504        return false;
     1505}
     1506
     1507/**
    14941508 * Is the current page a single activity item permalink?
    14951509 *
    14961510 * @return True if the current page is a single activity item permalink.
    function bp_is_single_activity() { 
    15051519/** User **********************************************************************/
    15061520
    15071521/**
     1522 * Is the current page the members directory ?
     1523 *
     1524 * @since BuddyPress (2.0.0)
     1525 *
     1526 * @return True if the current page is the members directory.
     1527 */
     1528function bp_is_members_directory() {
     1529        if ( ! bp_is_user() && bp_is_members_component() )
     1530                return true;
     1531
     1532        return false;
     1533}
     1534
     1535/**
    15081536 * Is the current page part of the profile of the logged-in user?
    15091537 *
    15101538 * Will return true for any subpage of the logged-in user's profile, eg
    function bp_is_user_settings_account_delete() { 
    18461874/** Groups ********************************************************************/
    18471875
    18481876/**
     1877 * Is the current page the groups directory ?
     1878 *
     1879 * @since BuddyPress (2.0.0)
     1880 *
     1881 * @return True if the current page is the groups directory.
     1882 */
     1883function bp_is_groups_directory() {
     1884        if ( bp_is_groups_component() && ! bp_current_action() && ! bp_current_item() )
     1885                return true;
     1886
     1887        return false;
     1888}
     1889
     1890/**
    18491891 * Does the current page belong to a single group?
    18501892 *
    18511893 * Will return true for any subpage of a single group.
    function bp_is_create_blog() { 
    20512093        return false;
    20522094}
    20532095
     2096/**
     2097 * Is the current page the blogs directory ?
     2098 *
     2099 * @since BuddyPress (2.0.0)
     2100 *
     2101 * @return True if the current page is the blogs directory.
     2102 */
     2103function bp_is_blogs_directory() {
     2104        if ( is_multisite() && bp_is_blogs_component() && ! bp_current_action() )
     2105                return true;
     2106
     2107        return false;
     2108}
     2109
    20542110/** Messages ******************************************************************/
    20552111
    20562112/**
  • bp-groups/bp-groups-screens.php

    diff --git bp-groups/bp-groups-screens.php bp-groups/bp-groups-screens.php
    index aef0c90..b6475f8 100644
     
    1515if ( !defined( 'ABSPATH' ) ) exit;
    1616
    1717function groups_directory_groups_setup() {
    18         if ( bp_is_groups_component() && !bp_current_action() && !bp_current_item() ) {
     18        if ( bp_is_groups_directory() ) {
    1919                bp_update_is_directory( true, 'groups' );
    2020
    2121                do_action( 'groups_directory_groups_setup' );
  • bp-members/bp-members-screens.php

    diff --git bp-members/bp-members-screens.php bp-members/bp-members-screens.php
    index 72a4031..4cb9f40 100644
    function bp_members_screen_display_profile() { 
    3535 * @uses apply_filters()
    3636 */
    3737function bp_members_screen_index() {
    38         if ( !bp_is_user() && bp_is_members_component() ) {
     38        if ( bp_is_members_directory() ) {
    3939                bp_update_is_directory( true, 'members' );
    4040
    4141                do_action( 'bp_members_screen_index' );