Skip to:
Content
Pages
Categories
Search
Top
Bottom

xprofile_screen_edit_profile redefinition


  • mehanic321
    Participant

    @mehanic321

    What I do:
    I create the ability to edit the profile of a specific user by another specific user

    What I’ve done:
    Added filter for bp_core_can_edit_settings which returns true

    but i also need to be able to edit custom fields

    Question: how to redefine this line, because it requires bp_moderate, which I don’t want to give normal users even for a while

    if ( ! bp_is_my_profile() && ! bp_current_user_can( 'bp_moderate' ) ) {
    return false;
    }

    This line is in the file “plugins\buddypress\bp-xprofile\screens\edit.php”

Viewing 4 replies - 1 through 4 (of 4 total)

  • shanebp
    Moderator

    @shanebp

    You can filter bp_current_user_can.
    See the function in buddypress\bp-core\bp-core-caps.php.


    mehanic321
    Participant

    @mehanic321

    @shanebp And if I wanted to rewrite this function, how could I do it?


    shanebp
    Moderator

    @shanebp

    You can’t – unless you hack a core file and redo it every time BP is updated.


    mehanic321
    Participant

    @mehanic321

    @shanebp Thanks for the answers, it would be great if in the future there would be before_action at the beginning of this function before_xprofile_screen_edit_profile

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar