Replies
- Ravi on January 7, 2023 at 9:00 am in reply to: [Resolved] Users are able to message blocked and suspended users if you have the direct URL #47860
Hello Nifty,
Sorry for the delayed reply. I have updated the plugin BP Private Message Rate Limiter and BuddyPress Block Users please upgrade and give it a try.
Regards
Ravi - Ravi on January 4, 2023 at 6:58 am in reply to: [Resolved] Users are able to message blocked and suspended users if you have the direct URL #47830
Hello Nifty,
You are right with legacy both blocker and blocked user can start new conversation with each other. I am going to fix this today and will update you soon.
Regards
Ravi - Ravi on January 3, 2023 at 11:49 am in reply to: [Resolved] Users are able to message blocked and suspended users if you have the direct URL #47825
Hello Nifty,
Thank you for sharing the screenshots. I will check it again and will update you soon.
Regards
Ravi - Ravi on January 3, 2023 at 9:48 am in reply to: [Resolved] Users are able to message blocked and suspended users if you have the direct URL #47823
Hello Nifty,
I have tried to create this issue on my development server but I am unable to create this. Can you please share a short video of the issue and how are you creating this so that I can check then fix it.
Regards
Ravi Hello
Welcome to the BuddyDev forums. Please try the following way:
function buddydev_add_custom_buttons( $buttons ) { if ( ! bp_is_user() || bp_is_my_profile() ) { return $buttons; } if ( ! bp_is_active( 'xprofile' ) ) { return $buttons; } // Replace field id with your phone number field id. $phone_number = xprofile_get_field_data( 28, bp_displayed_user_id(), 'string' ); // You can also validate weather phone number valid or not. if ( $phone_number ) { $buttons['contact'] = array( 'id' => 'buddydev_contact', 'component' => 'members', 'must_be_logged_in' => true, 'button_element' => 'a', 'link_text' => __( 'Contact me' ), 'button_attr' => array( 'href' => esc_url( "https://wa.me/{$phone_number}" ), 'title' => __( 'Contact Me' ), ) ); } return $buttons; } add_filter( 'bp_nouveau_get_members_buttons', 'buddydev_add_custom_buttons' );
Please let me know if it helps or not.
Regards
RaviHello Daniel,
I have modified the template on your production site. You can check in your child theme directory under /buddypress/activity/index.php file. You can move the same file to the staging server to debug further.
Regards
Ravi- Ravi on December 28, 2022 at 1:23 pm in reply to: [Resolved] Hide Certain Contents(Pages) From Logged In/Out Users #47784
Hello Emmanuel,
Welcome to the BuddyDev Forums. Please try the following code in your ‘bp-custom.php’ file and let me know if it helps or not
/** * Redirects site members to specific page if trying to access restricted pages. */ function buddydev_redirect_members_from_restricted_pages() { $current_page_id = get_queried_object_id(); if ( ! $current_page_id ) { return; } // Page id you want to redirect logged-in users. Replace with your page id. $redirection_page_id = 2; // Restricted page ids for logged-in users. Replace with your page ids. $restricted_page_ids = array( 5, 32, 6 ); if ( in_array( $current_page_id, $restricted_page_ids ) && ! is_page( $redirection_page_id ) ) { bp_core_redirect( get_permalink( $redirection_page_id ) ); } } /** * Redirects site visitors to login page if trying to access restricted pages. */ function buddydev_redirect_visitors_from_restricted_pages() { $current_page_id = get_queried_object_id(); if ( ! $current_page_id ) { return; } // do not restrict the signup, activation and login pages if ( bp_is_register_page() || bp_is_activation_page() || ( function_exists('is_login') && is_login() ) ) { return; } // Restricted page ids for visitors. Replace with yours page ids. $restricted_page_ids = array( 29, 30 ); if ( in_array( $current_page_id, $restricted_page_ids ) ) { $redirect_url = get_permalink( $current_page_id ); bp_core_redirect( wp_login_url( $redirect_url ) ); } } add_action( 'bp_template_redirect', function () { // assuming that you are trying to protect 'pages' not other content. if ( ! is_page() ) { return; } if ( is_user_logged_in() ) { buddydev_redirect_members_from_restricted_pages(); } else { buddydev_redirect_visitors_from_restricted_pages(); } } );
Note: Replace the page ids with yours
Regards
Ravi - Ravi on December 28, 2022 at 9:59 am in reply to: [Resolved] Send email to user that has been inactive for 2 months (adding a question) #47781
Hello Lefteris,
With that number of users you can use the code. Please let me know if works or not.
Regards
Ravi Hello Daniel,
Thank you, Please let me know how it goes?
Regards
Ravi- Ravi on December 23, 2022 at 10:50 am in reply to: [Resolved] Send email to user that has been inactive for 2 months (adding a question) #47762
Hello Lefteris,
Sorry for the delayed reply. Code seems to be work fine but it is very inefficient with large user base. So, If you want we can provide you an efficient way of doing this just tell how many users you are dealing with.
Regards
Ravi