Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to overwrite a core buddypress function?

  • Avatar of Design Cloud
    Design Cloud
    Participant

    @designcloud

    First question is
    1) Should this be done by building a plugin or using bp-custom.php?

    My main concern is that im trying to overwrite a function in bp-core.php using a plugin file.

    The function is:

    `function bp_core_get_username( $user_id, $user_nicename = false, $user_login = false )`

    For some reason the arguments passed in this function are not being picked up in the custom function which I called:

    `function bp_core_get_username_custom( $user_id, $user_nicename = false, $user_login = false )`

    I used the following add action:

    `add_action( ‘bp_core_get_username’, ‘bp_core_get_username_custom’, 1,3 );`

    Am I doing something obviously wrong or does anyone think there is a deeper problem with my code?

Viewing 2 replies - 1 through 2 (of 2 total)
  • there is no action to trigger on (though that wouldn’t allow you to overwrite a function – i don’t believe any “pluggable” functions exists in bp. action is just a hook point)

    there is a filter on the return of that function though bp_core_get_username but passes the determined username

    Yeah, there are not any ‘plugable’ functions in BP.

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

You must be logged in to reply to this topic.