Skip to:
Content
Pages
Categories
Search
Top
Bottom

Acces to $this outside BP_Component class


  • ad70
    Participant

    @ad70

    I use BuddyForms Members plugin (1.4.15) (WP 5.7, buddyboss 1.5.7.3).
    It allows integration of Buddyforms with member profiles by extending class BP_Component.

    What I need, is that this ‘profile integration’ is conditional to the member type (‘user’, ‘location’, ‘organisation’). Only organisation/location membertypes should get ‘profile integration’.

    So, I end up in buddyboss-platform\bp-core\classes\class-bp-component.php. On line 475 I found:

    do_action( 'bp_' . $this->id . '_setup_actions' );

    I can interact with bp_set_nav by adding code in the class on line 476:

    if ($this->id == 'buddyforms') {
    remove_action( 'bp_setup_nav', array( $this, 'setup_nav' ), 10 );
    }

    But, how do I refer to $this from outside the extended BP_Component class (BuddyForms_Members_Extention)? What doesn’t seem to work from My Plugin function.php:

    add_action( 'bp_buddyforms_setup_actions', 'my_function', 10 );
    
    function my_function() {
    $buddy = buddypress();
    remove_action( 'bp_setup_nav', array( $buddy, 'setup_nav' ), 10 );
    }

    Hopefully I’m at the right place for this question.

Viewing 1 replies (of 1 total)

  • shanebp
    Moderator

    @shanebp

    >Hopefully I’m at the right place for this question.

    No, these are the forums for BuddyPress.
    You should send your question to BuddyBoss or BuddyForms.

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