Skip to:
Content

BuddyPress.org

Opened 5 months ago

Last modified 44 hours ago

#8479 new enhancement

WP User Profile Compatibility

Reported by: vanpop Owned by: slaFFik
Milestone: 10.0.0 Priority: low
Severity: trivial Version: 2.0
Component: Administration Keywords: has-patch
Cc:

Description

Adding a check to see if the WP User Profiles plugin is active allows for creating a new WP User Profile section that adds the BuddyPress Extended Profile tab to the User Profile navigation by using 'bp-profile-edit' for the section/id/slug/name. Happy to explain further if that isn't clear and also happy to hear if what I'm doing is crazy and I should not do it. Thanks! :)

By adding:

    if ( is_plugin_active( 'wp-user-profiles/wp-user-profiles.php' ) ) {
        return;
    } 

after:

    if ( ! bp_current_user_can( 'bp_moderate' ) && empty( $this->is_self_profile ) ) {
        die( '-1' );
    }

at line 999 of class-bp-members-admin.php, the extended profile tab can be added to the WP User Profiles plugin tabbed nav. Happy to explain further if that isn't clear

Attachments (1)

8479.patch (8.6 KB) - added by imath 45 hours ago.

Download all attachments as: .zip

Change History (5)

#1 @imath
5 months ago

  • Keywords 2nd-opinion added
  • Milestone changed from Awaiting Review to Up Next

Hi thanks for your report.

I believe what you suggest should be made in a more generic way eg:

<?php
if ( true === apply_filters( 'bp_admin_profile_override_user_admin', false ) ) {
     return;
}

Then any plugin wishing to deal differently with this part of BuddyPress can do it and not only the WP User Profiles plugin.

#2 @vanpop
5 months ago

Hi @imath, Thanks for your response.

I agree, although I have since realized that the Extended Profile fields are not properly saved when WP User Profiles is active, so I'm hoping/going to try to see if I can find a way to correct that as well.

However, I still think that adding the filter in is harmless/helpful enough if you agree.

Thanks again!

#3 @imath
5 weeks ago

  • Keywords dev-feedback added
  • Milestone changed from Up Next to 10.0.0

Any objection about introducing this new filter?

@imath
45 hours ago

#4 @imath
44 hours ago

  • Keywords has-patch added; 2nd-opinion dev-feedback removed
  • Version set to 2.0

Hi @vanpop

Better later than never! Sorry about the delay. I've just attached a patch about introducing a new filter to disable the BP Admin User's community profile. You just need to include the code below to remove this community profile.

add_filter( 'bp_members_is_community_profile_enabled', '__return_false' );

As I was working into this area, I've also applied WP 3.9 change about the Edit User Screen title

Note: See TracTickets for help on using tickets.