BuddyDev

Search

Replies

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: BuddyBlog Pro Posts Layout – 2 #47390

    Hi Brajesh

    Thank you so much for getting back to me on this.

    I’ve now tested and can advise as follows –

    Group Profile – issue seems to be fixed here ie. only the relevant group events are shown.
    Personal Profile – still seem to have a problem here as events tab is showing both personal AND group events of which the user is the author

    In addition to the above, I have a couple of queries as follows –

    Is there any way of screening out past events from the tabs? (Events Manager handles this for their own BuddyPress tabs but presumably we’re now removing that filter so is there a way of adding it back in?)

    Will the code you have provided affect the Events Manager calendar, especially with regard to searches etc?

    With many thanks again… this is definitely a step in the right direction but still not quite there yet.

    Warm regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: BuddyBlog Pro Posts Layout – 2 #47380
    This reply has been marked as private.
  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: BuddyBlog Pro Posts Layout – 2 #47329
    This reply has been marked as private.
  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: BuddyBlog Pro Posts Layout – 2 #47302
    This reply has been marked as private.
  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: BuddyBlog Pro Posts Layout – 2 #47251

    Hi Brajesh

    Thank you again.

    1. I will certainly see if I can get any reply from the EM team but just to make sure I am asking the right questions, can you possibly confirm my understanding that BuddyBlog Pro is creating a custom query and loop but EM is somehow overriding that and what I’m looking for is a way to remove their scope entirely?

    2. If that’s not possible,would an alternative approach be to use either pre_get_posts or possibly em_events_build_sql_conditions filters to add in the necessary conditions required by BuddyBlog Pro or perhaps there is some reason why that’s not a practical/advisable method?

    I really do appreciate your patience with this. It’s a dealbreaker for this project so just have to get it working somehow 😉

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: BuddyBlog Pro Posts Layout – 2 #47247

    Hi again Brajesh

    From further research, it seems that em_content_pre only works for Events Manager’s pre-assigned pages so I thought I’d take a look to see if I could get pre_get_posts to work instead. On that basis, I came up with the following code to exclude group events from appearing on the user profile events tab as follows –

    function my_exclude_groups ( $q ) {
     //   if ( still need to add criteria to make sure we're on the right page ) {
            $meta_query = [
                'relation' => 'or',
                [
                'key'     => '_group_id',
    			'compare' => 'NOT EXISTS',]
            ];
            $q->set('meta_query', $meta_query );
     //   }
    
    }
    
    add_action( 'pre_get_posts', 'my_exclude_groups' ); 

    This feels like a convoluted way of doing things ie. if I’m understanding correctly, Events Manager is overriding the BuddyBlog Pro filter and I’m then needing add that back into the query, but it does seem to be working so far at least. Would you agree this is an appropriate approach?

    With very many thanks in advance.
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: BuddyBlog Pro Groups tabs #47244

    Hi Brajesh

    Further testing, all with new posts.

    Standard post type posts – all activity entries are correct regardless of whether posts are created in the dashboard, from user profile or from group profile.

    Event post type – regardless of whether posts are created in the dashboard, from user profile OR from group profile, I am getting TWO activity entries as follows –

    “Nik added the event My Event Name (to the Group Name – if posted in group)”
    “Nik posted a new post”

    It’s obviously the second entry above that seems to be the issue. It has no link and also refers to the entry as a “post” when it’s actually an “event”.

    Checking in the bp_activity table, shows the following data for the second entry –

    Component: blogs
    Type: new_event
    Action: Nik posted a new post.

    Hope this helps and makes sense.
    Regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: BuddyBlog Pro Posts Layout – 2 #47240

    Hi Brajesh

    Thank you again.

    Based on what you said, I’ve just done a bit of research myself and it looks as if possibly there is a filter ’em_content_pre’ which may work the way you suggest.

    There are some more details here… https://wp-events-plugin.com/tutorials/create-custom-event-information-pages/

    If I’m understanding correctly, I would need to check if the relevant tab is being loaded and then use that to apply a filter accordingly.

    Does that sound as if I’m on the right track?

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: BuddyBlog Pro Posts Layout – 2 #47235

    Hi Brajesh

    Thank you for getting back to me so quickly and I do appreciate it’s not BuddyBlog Pro that is at fault here.

    As you say, you did mention that you might be able to look into the Event Manager code to see if it’s possible to disable the filtering and I’d be hugely grateful if you could possibly find the time to do that as I’ve had a look myself and only seem to be going round in circles.

    Alternatively, if it’s really not possible to disable the Event Manager filtering altogether, is there a way of ADDING another filter to the Buddyblog Pro tabs in which I could override the Event Manager filtering?

    With very many thanks again for any thoughts… I really do appreciate it.
    Regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: BuddyBlog Pro Posts Layout – 2 #47233

    Hi again Brajesh

    Despite the recent updates, the user events tab is still showing ALL events by that user (including group events) and the group events tab is showing ALL events by all users and posted in all groups.

    I’m not sure if you were suggesting the recent update should have fixed this or whether I still need to apply an additional filter somehow and if so, I’d be very grateful if yoou could point me in the right direction as suggested above.

    With very many thanks in advance and sorry for several messages, I just really need to get things working as quickly as possible now.

    Nik