Replies
- Ravi on June 20, 2022 at 2:11 pm in reply to: [Resolved] Pay Per Post by selling access with WooCommerce #45451This reply has been marked as private.
Hello Christian,
Try the following code:
add_action( 'bp_directory_members_actions', function () { $member_id = bp_get_member_user_id(); if ( ! $member_id || ! bp_is_members_directory() ) { return; } $user_domain = bp_core_get_user_domain( $member_id ); if ( bp_is_active( 'xprofile' ) ) { $profile_link = $user_domain . bp_get_profile_slug(); echo sprintf( '<div class="generic-button"><a href="%s">%s</a></div>', esc_url( $profile_link ), esc_html__( 'View Profile' ) ); } echo sprintf( '<div class="generic-button"><a href="%s">%s</a></div>', esc_url( $user_domain ), esc_html__( 'Contact' ) ); } );
Regards
Ravi- Ravi on June 20, 2022 at 11:48 am in reply to: [Resolved] Pay Per Post by selling access with WooCommerce #45446
Hello Tosin,
I am looking at this and will update you soon.
Regards
Ravi Hello Abhist,
Thank you for posting. BuddyPress does provide a custom file for tweaking BuddyPress functionality i.e. ‘bp-custom.php’ file.
For more info you can refer to the following URL:
https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/Please do let me know what you want to achieve with the code so that I can help you.
Please do let me know if you still face the issue.
Regards
RaviHello Christian,
Thank you for posting. Please let me know which theme and BuddyPress template pack you are using so that I can help.
Regards
Ravi- Ravi on June 20, 2022 at 11:35 am in reply to: [Resolved] Create Gallery – Extend entry in activity #45442
Hello Maurice,
Thank you for the acknowledgement. Please use the following code with the above code:
add_filter( 'bp_get_activity_content_body', function ( $content, $activity ) { if ( ! function_exists( 'mediapress' ) || empty( $activity ) || empty( $activity->id ) ) { return $content; } $activity_type = bp_activity_get_meta( $activity->id, '_mpp_activity_type', true ); $gallery_id = bp_activity_get_meta( $activity->id, '_mpp_gallery_id', true ); if ( ! $activity_type || ! $gallery_id || 'create_gallery' != $activity_type ) { return $content; } $gallery_permalink = mpp_get_gallery_permalink( $gallery_id ); $new_content = ''; if ( mpp_gallery_has_cover_image( $gallery_id ) ) { $new_content = sprintf( '<a href="%s"><img src="%s" /></a>', esc_url( $gallery_permalink ), esc_url( mpp_get_gallery_cover_src( 'thumbnail', $gallery_id ) ) ); $new_content .= sprintf( '<a href="%s">%s</a>', esc_url( $gallery_permalink ), mpp_get_gallery_title( $gallery_id ) ); } return $new_content ? $new_content : $content; }, 10, 2 );
Please check and let me know if it works.
Regards
Ravi- This reply was modified 2 years, 7 months ago by Ravi.
- Ravi on June 16, 2022 at 1:46 pm in reply to: [Resolved] BuddyPress Member Types in bbPress Forums #45410
Hello Darbii,
Thank you for the acknowledgement. I am glad that I could help.
Regards
Ravi - Ravi on June 16, 2022 at 1:44 pm in reply to: [Resolved] Allow group activity only disable non group activity #45409
Hello Abhist,
Thank you for posting. But sorry I am not able to understand your requirement. Please help me understand it more clearly.
Regards
Ravi - Ravi on June 16, 2022 at 12:07 pm in reply to: [Resolved] BuddyPress Member Types in bbPress Forums #45406
Hello Darbii,
Thank you for the acknowledgement. It seems your theme uses the topic author role as well. Please try the following code and let me know if it helps or not.
/** * Replace author role with member type * * @param string $author_role Author role. * @param array $r Args. * * @return string */ function buddydev_bbp_replace_author_role_with_member_type( $author_role, $r ) { if ( ! function_exists( 'bp_get_member_type' ) ) { return $author_role; } $author_id = 0; if ( ! empty( $r['reply_id'] ) ) { $author_id = bbp_get_reply_author_id( $r['reply_id'] ); } elseif ( ! empty( $r['topic_id'] ) ) { $author_id = bbp_get_topic_author_id( $r['topic_id'] ); } if ( ! $author_id ) { return $author_role; } $member_type = bp_get_member_type( $author_id ); $member_type = $member_type ? bp_get_member_type_object( $member_type )->labels['singular_name'] : ''; // Backwards compatibility with old 'class' argument. if ( ! empty( $r['class'] ) ) { $author_role = sprintf( '%1$s<div class="%2$s">%3$s</div>%4$s', $r['before'], esc_attr( $r['class'] ), esc_html( $member_type ), $r['after'] ); } else { $author_role = $r['before'] . $member_type . $r['after']; } return $author_role; } add_filter( 'bbp_get_reply_author_role', 'buddydev_bbp_replace_author_role_with_member_type', 10, 2 ); add_filter( 'bbp_get_topic_author_role', 'buddydev_bbp_replace_author_role_with_member_type', 10, 2 );
Regards
Ravi Hi,
You are welcome.
I am sorry, I lack the time to assist you further with custom code.
Please take a look at this page, especially the bottom links to see how to create BuddyPress Notifications.
https://codex.buddypress.org/administrator-guide/notifications/
Regards
Ravi