I am not sure how does this affect WPAdverts BP integration? I read the thread and the changes seem to be for the blog posts only (not custom post types) and only in filters/actions we do not use.
The display of the activity is now different from the code you sent for example In the new buddypress 11.0 the featured images in post activity is now a clickable link while images in ads is not clickable, see image below for the differences.
1. Activity for Post post type – https://ibb.co/fFr78p7
2. Activity for Advert post type – https://ibb.co/DtR6nCt
Thanks
From the threads it looks like the styling is different *only* for the posts, it stays the same for custom post types.
So the best you could do is make the image in the description clickable by changing the line
$content .= sprintf( '<img src="%s" alt="" /> ', adverts_get_main_image( $post_id ) );
or in other words, the bp_activity_add()
function that submits new activity does not seem to have any changes or new params https://codex.buddypress.org/developer/function-examples/bp_activity_add/ that would allow submitting the activity in a different format
Thanks for the feedback
I was hoping for a uniform design with the advert styling to be the same as the new post styling. What do I change the code into to make it clickable
Thanks
I have added a comment hopefully a resolution can be provided https://buddypress.trac.wordpress.org/ticket/8052#comment:24
Once a unified layout for all activities will be implemented in BB it should change automatically.
Until then nothing else can be done since it is unknown if the unified layout will have any changes to the bp_activity_add() function or not.
Hi Greg
For now how can I make the image to be a clickable link. you said this needs to be changed ($content .= sprintf( ‘ ‘, adverts_get_main_image( $post_id ) ); )
but im not good at coding
Thanks
Hi,
you can do that by changing the line
$content .= sprintf( '<img src="%s" alt="" /> ', adverts_get_main_image( $post_id ) );
to
$url_img = adverts_get_main_image( $post_id );
$url_ad = get_permalink( $post_id );
$content .= sprintf( '<a href="%s"><img src="%s" alt="" /></a>', $url_ad, $url_img );
Thank you so much sir, im really grateful