Replies
Hi again Brajesh
The problem: when using BuddyBlog Groups with the Events Manager plugin, both group AND personal events are displayed in the group event tab. Presumably because the EM plugin is overriding BuddyBlog Groups filters.
The issue can be fixed by including
remove_action(‘parse_query’, array(‘EM_Event_Post’,’parse_query’));
in my functions.php however, I am concerned that this might have unexpected results elsewhere in the site so thought it might be safer to edit my posts.php template instead.
I have tried replacing…
`query_posts(
bblgroups_get_posts_query_args(
array(
‘post_type’ => bblpro_get_current_post_type(),
)
)
); `with
`query_posts(
bblgroups_get_posts_query_args(
array(
‘post_type’ => bblpro_get_current_post_type(),
‘meta_query’ => array(‘relation’ => ‘AND’,
array(
‘key’ => ‘_bblgroups_group_id’,
‘compare’ => ‘=’,
‘value’ => bp_get_current_group_id(),
),
)
)
)
); `… but the meta_query doesn’t seem to be being taken into account. Not sure if it’s my code or just the wrong approach but if you do happen to have time to make any suggestions, they would be very much appreciated.
With many thanks in advance.
NikHi Brajesh
For now at least, I have solved this by adding the following to my functions.php –
remove_action(‘parse_query’, array(‘EM_Event_Post’,’parse_query’));
… this seems to work, at least from testing so far but I have yet to fully explore whether it may have an unwanted knock on effect elsewhere. (Note: I would have preferred to run the remove action in the BuddyBlog templates themselves but that didn’t work, presumably because it’s running too late in the process.)
Hope this is of interest and I’ll update if/when I discover anything further.
Regards
NikPS. Once complete, I’d also be more than happy to share the additional steps I’ve taken to integrate the Event Manager plugin with BuddyBlog Pro if it might be of interest. As you’re aware, there are still a few tweaks to address but, thanks to your assistance, it certainly seems to be heading in the right direction now.
- This reply has been marked as private.
- NikB on October 18, 2022 at 9:36 am in reply to: [Resolved] BuddyBlog Pro – Custom field types #47005This reply has been marked as private.
Hi Brajesh
Thank you and yes that makes sense.
I already know the Events Manager plugin was influencing the results as initially it was set to only show “past events” and since I didn’t have any, nothing was showing up at all… having fixed that part (which was simply the matter of a setting in the dashboard), I’ll investigate a bit further and hopefully can find a way to override the EM filter more fully in the template.
Regards
Nik- This reply has been marked as private.
Hi Brajesh
Thank you so much… that must have been about the only combination I didn’t try(!) but I’m pleased to say that part is working now.
It has however highlighted another issue…
Despite the fact that I have enabled “Should tab post lists show only the posts created by BuddyBlog(front end)?”, the events tab on individual profiles is showing ALL events by that user (including events created through the dashboard) and the events tab on group profiles is also showing ALL events by that user (including events created through the dashboard AND non-group events).
I’m using the Events Manager plugin and I’m guessing this is because it is somehow overriding the posts queries. I note that in posts.php, you have a line as follows –
remove_filter( ‘the_content’, ‘bp_replace_the_content’ );
Would I be right in thinking that I somehow need to track down whatever filter the Events Manager plugin is applying and remove that too?
With many thanks in advance for your thoughts.
Nik- NikB on October 15, 2022 at 4:52 pm in reply to: [Resolved] BuddyBlog Pro – Custom field types #46991
Hi Brajesh
So far I have attempted to add a new field type (‘time’) by creating a new file class-bbl-fieldtype-time.php and saving it in the same location as the other field type files (ie. buddyblogpro/src/core/fields). Then edited the source file bbl-field-type-functions.php ie. by adding
use BuddyBlog_Pro\Core\Fields\BBL_Field_Type_Time;
AND
‘time’ => BBL_Field_Type_Time::class (to the function bbl_get_registered_field_type_classes).
Not very surprisingly, this works but clearly editing the source files isn’t the right way and I’m not quite sure how to make it work with a filter as you’ve suggested above ie. where should I be saving my class-bbl-fieldtype-datetime.php file? And is there anything else I need to change in my code in order to make the filter work from within my child theme?
With very many thanks in advance for your thoughts.
Nik - This reply has been marked as private.
- This reply has been marked as private.