Skip to:
Content

bbPress.org


Ignore:
Timestamp:
02/26/2017 07:25:15 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Engagements: Allow engagements to be toggled on/off, for forums that have not run the upgrade routine yet.

Also missed a spot in the BuddyPress integration.

See #3068.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/extend/buddypress/members.php

    r6250 r6321  
    115115            } elseif ( bbp_is_subscriptions_active() && bp_is_current_action( bbp_get_user_subscriptions_slug() ) ) {
    116116                $profile_url = $this->get_subscriptions_permalink( '', $user_id );
     117
     118            // 'engagements' action
     119            } elseif ( bbp_is_engagements_active() && bp_is_current_action( bbp_get_user_engagements_slug() ) ) {
     120                $profile_url = $this->get_subscriptions_permalink( '', $user_id );
    117121            }
    118122
     
    168172
    169173    /**
     174     * Override bbPress engagements URL with BuddyPress profile URL
     175     *
     176     * @since 2.6.0 bbPress (r6320)
     177     *
     178     * @param string $url
     179     * @param int $user_id
     180     * @return string
     181     */
     182    public function get_engagements_permalink( $url, $user_id ) {
     183
     184        // Do not filter if not on BuddyPress root blog
     185        if ( ! bp_is_root_blog() ) {
     186            return false;
     187        }
     188
     189        $component_slug = bbpress()->extend->buddypress->slug;
     190        $url            = trailingslashit( bp_core_get_user_domain( $user_id ) . $component_slug . '/' . bbp_get_user_engagements_slug() );
     191        return $url;
     192    }
     193
     194    /**
    170195     * Set favorites and subscriptions query variables if viewing member profile
    171196     * pages.
Note: See TracChangeset for help on using the changeset viewer.