Skip to:
Content
Pages
Categories
Search
Top
Bottom

Notice for plugin developers using bp_has_activities filter


  • meg@info
    Participant

    @megainfo

    Hi all,

    I was check many buddypress plugins using the bp_has_activities filter, the returned value for this filter must be a boolean and not an array of activities.

    in case the list of activities is empty, the return value is important (must be false ~~ $activities_template->has_activities() )

    below an example of the correction :

    
    function bp_my_new_activity_filter( $has_activities, $activities ) {
      ... ..
      // here , you can change the value of $has_activities or/and $activites 
      ...
    
     return $has_activities;
    }
    add_action( 'bp_has_activities', 'bp_my_new_activity_filter', 10, 2 );
    

    For more informations, check the buddypress\bp-activity\bp-activity-template.php

    Regards.

  • The topic ‘Notice for plugin developers using bp_has_activities filter’ is closed to new replies.
Skip to toolbar