Replies
- Ravi on June 3, 2019 at 4:18 am in reply to: [Resolved] Remove 'add friend' button for member type (admins) #23285
Hello Kristian,
Remove all previous code and Try the following code based on user ids.
function buddydev_hide_add_friend_button( $button ) { $user_id = bp_is_user() ? bp_displayed_user_id() : bp_get_member_user_id(); $excluded_user_ids = array( 340 ); // Enter comma separated list of ids you want to exclude. if ( in_array( $user_id, $excluded_user_ids ) ) { $button = ''; } return $button; } add_filter( 'bp_get_add_friend_button', 'buddydev_hide_add_friend_button' );
Regards
Ravi Hello Tosin,
Please the above code and check weather form is submitting to login page created by BuddyPress Branded Login plugin. If not please make sure Login form “action attribute” should be like the followin one:
<form name="bp-login-form" id="bp-login-widget-form" class="standard-form" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
Please check and let me know. Also to make check box checked. Search and replace like following:
Search for
<input name="rememberme" type="checkbox" id="rememberme" value="forever" <?php checked( $remember_me ); ?> />
Replace with
<input name="rememberme" type="checkbox" id="rememberme" value="forever" checked/>
Regards
Ravi- This reply was modified 6 years, 1 month ago by
Ravi.
- This reply was modified 6 years, 1 month ago by
- Ravi on May 30, 2019 at 12:51 pm in reply to: Posting image on Activity Stream page not working [BP + Mediapress] #23254This reply has been marked as private.
Hello Tosin,
Please update the plugin.
1. To make normal flow for logout. just trashed that page associated with logout directory if you have assign any in BuddyPress setting page section.
2. For point 2,3 overide the plguin template “login.php” by placing it under “blogin” directory of active theme and make changes accordingly.
3. All login form with action defined as “site_url( ‘wp-login.php’, ‘login_post’ )” will be redirected to login page and show errors there if any.You can download the latest plugin version form the following url:
https://buddydev.com/plugins/bp-branded-login/Please check and let me know.
Regards
Ravi- Ravi on May 30, 2019 at 4:56 am in reply to: [Resolved] Remove 'add friend' button for member type (admins) #23251
Hello Kristian,
Thank you for the acknowledgement. It seems you are looking for a solution to site admins. If it is the case use the following code to hide “Add Friend” button for site admins.
function buddydev_hide_add_friend_button( $button ) { $user_id = bp_is_user() ? bp_displayed_user_id() : bp_get_member_user_id(); if ( is_super_admin( $user_id ) ) { $button = ''; } return $button; } add_filter( 'bp_get_add_friend_button', 'buddydev_hide_add_friend_button' );
Please let me know if it works or not. If not please do let me know what is “admin” in your case.
Regards
Ravi - Ravi on May 29, 2019 at 11:55 am in reply to: [Resolved] Redirect to a custom url when i visited a user profile (logged in) #23233
Hello Jenifer,
Thank you for sharing the details. Please try the following code and let me know if works for you or not.
function buddydev_redirect_to_reviews() { if ( bp_is_user() && ! bp_is_my_profile() && ! bp_is_current_component( 'reviews' ) ) { $user_domain = bp_core_get_user_domain( bp_displayed_user_id() ); $review_url = trailingslashit( $user_domain ) . 'reviews'; bp_core_redirect( $review_url ); } } add_action( 'bp_template_redirect', 'buddydev_redirect_to_reviews' );
Regards
Ravi - Ravi on May 29, 2019 at 5:53 am in reply to: [Resolved] Remove 'add friend' button for member type (admins) #23224
Hello Kristian,
Thank you for posting. Please try the following code. It will allows certain member types to be excluded from sending friendship.
function buddydev_filter_add_friend_button( $button ) { $user_id = bp_is_user() ? bp_displayed_user_id() : bp_get_member_user_id(); $member_types = bp_get_member_type( $user_id, false ); if ( ! $member_types ) { return $button; } // Comma separated list of member types to be excluded. $excluded_member_types = array( 'business', 'admin' ); $has_excluded_member_type = array_intersect( $excluded_member_types, $member_types ); if ( ! empty( $has_excluded_member_type ) ) { return ''; } return $button; } add_filter( 'bp_get_add_friend_button', 'buddydev_filter_add_friend_button' );
Please let me know if it works or not.
Regards
Ravi - Ravi on May 29, 2019 at 5:26 am in reply to: [Resolved] Redirect to a custom url when i visited a user profile (logged in) #23223
Hello Jennifer,
Thank you for posting. Please clear me out for the following points.
1. Is ‘reviews’ is custom WordPress page or user profile tab?.
2. Do you want to redirect user for all tabs of user profile or certain tabs?.
3. Is there any need to remove activity nav item?.Please let me know.
Regards
Ravi Hello Jack,
Thank you for sharing the details. I have checked the scenario on my development system and it seems to be working fine. In your case either any custom code, plugin or theme modifying the order. Please install fresh default theme with all other plugins de-active except MediaPress and let me know if it is working or not.
Regrads
Ravi- Ravi on May 27, 2019 at 7:41 am in reply to: How can I add an external hyperlink to the thumbnail and image/video? #23196
Hello Jack,
Thank you for sharing the details. Sorry, But still not getting it. You can try this following code in your bp-custom.php (more info: https://codex.buddypress.org/themes/bp-custom-php/).
https://gist.github.com/raviousprime/c14532a281f478e2bef1148fc6865946
Also you need to override related gallery template in the active theme. To add some actions before and afer thumbnail.
The above code provide functionality to add a new custom link text field in gallery edit media screen. You can put custom link to media over there. It will navigate to the media thumbnail.
Please give a shot and let me know. If works for you or not.
Regards
Ravi