Replies
- Ravi on May 6, 2017 at 7:50 am in reply to: [Resolved] Hide "Add friend" Button after rejecting the friendship (only at the sender end #9015
You are welcome. I am glad that you resolved by your own.
Regards
Ravi - Ravi on May 5, 2017 at 11:45 am in reply to: [Resolved] Hide "Add friend" Button after rejecting the friendship (only at the sender end #9010
Hello Swati,
Try the following code in your bp-custom.php file and let me know if it works or not
function buddydev_custom_send_notification_on_friendship_rejection( $friendship_id, BP_Friends_Friendship $friendship ) { add_user_meta( $friendship->initiator_user_id, '_rejected_by', $friendship->friend_user_id ); } add_action( 'friends_friendship_rejected', 'buddydev_custom_send_notification_on_friendship_rejection', 10, 2 ); function buddydev_hide_add_friend_button( $button ) { $displayed_user_id = bp_displayed_user_id(); $user_id = ( $displayed_user_id ) ? $displayed_user_id : bp_get_member_user_id(); $rejected_by = get_user_meta( bp_loggedin_user_id(), '_rejected_by' ); if ( in_array( $user_id, $rejected_by ) ) { return ''; } return $button; } add_filter('bp_get_add_friend_button', 'buddydev_hide_add_friend_button');
Thank You
Ravi You are welcome.
Regards
RaviHello
Welcome to buddydev. Please use the following code in your functions.php file and remove or comment the old code. Please me know if it works or not.
function buddydev_get_search_form() { ?> <form method="post"> <label> <input name="bd-search-media" type="text" placeholder="search media"> </label> <input type="submit" value="Search"> </form> <?php } add_shortcode('wpbsearch', 'buddydev_get_search_form'); function mpp_custom_use_search_args( $atts ) { //assuming your search form has input element 'search-terms' if ( isset( $_REQUEST['bd-search-media'] ) ) { $atts['search_terms'] = $_REQUEST['bd-search-media']; } return $atts; } add_filter( 'mpp_shortcode_list_media_query_args', 'mpp_custom_use_search_args' );
Thank You
Ravi- Ravi on May 3, 2017 at 3:18 pm in reply to: [Resolved] Member names on site wide gallery titles #8952
Hello Ryan,
It seems we are inserting link into another link that is why we have gotten a broken html. Try the following code in your bp-custom.php file
function mpp_custom_add_owner_name_gallery_title( ) { $gallery = mpp_get_gallery(); printf("<br><span>%s</span>", mpp_get_user_link( $gallery->user_id) ); } add_action( 'mpp_before_gallery_actions', 'mpp_custom_add_owner_name_gallery_title');
Thank You
Ravi - Ravi on May 3, 2017 at 1:08 pm in reply to: [Resolved] Member names on site wide gallery titles #8951This reply has been marked as private.
- Ravi on May 3, 2017 at 12:46 pm in reply to: [Resolved] Hide some profile field from Register Form #8947
Hello Kalpesh,
Thank you for posting here. Please use the following code in your bp-custom.php file to hide fields on register page.
function buddydev_filter_register_fields( $r ) { if ( bp_is_register_page() ) { $r['exclude_fields'] = 2; // Comma-separated list of profile field IDs to exclude. } return $r; } add_filter('bp_after_has_profile_parse_args','buddydev_filter_register_fields' );
Thank You
Ravi - Ravi on May 3, 2017 at 12:30 pm in reply to: [Resolved] Member names on site wide gallery titles #8946
Hello Ryan,
Thank you for posting, Please try the following code for broken html. It will print the additional title info in a new line.
function buddydev_custom_add_owner_name_gallery_title( $title, $id ) { $gallery = mpp_get_gallery( $id ); if ( ! $gallery ) { return $title ; } //do you want to only filter for certain component? uncomment the below lines /* if ( 'sitewide' !== $gallery->component ) { return $title; } */ return $title . sprintf( '<br><span class="gallery-owner-user"> by: %s</span>', mpp_get_user_link( $gallery->user_id ) ); } add_action( 'mpp_get_gallery_title', 'buddydev_custom_add_owner_name_gallery_title', 10, 2 );
The url you have provided is not reachable for me. But gallery user name still displaying even if user is not logged in.
Thank You
Ravi Hello Randlel,
Please visit dashboard MediaPress setting and make sure to enable some of the allowed media types
Currently, no type is enabled and that is causing the problem.Thank You
RaviHello James,
Welcome to BuddyDev. In WordPress dashboard there is sub-menu name “buddypress” in Settings menu. When you open buddypress page there is three tabs “components, pages and options” and You can find settings for Buddypress Private Message Rate Limiter in options tab.
Thank You
Ravi