Replies
- Tosin on May 14, 2022 at 1:22 pm in reply to: [Resolved] Redirect users immediately after profile photo upload #44949
It did not work after photo upload
This is my code
add_action( 'bp_enqueue_scripts', function () { // you can set the url value to anything. $url = site_url( '/refer-friends/' ); ob_start(); ?> bp.Avatar.Attachment.on( 'change:url', function( data ) { if( data.get('object') == 'user' ) { window.location="<?php echo esc_url( $url ); ?>"; } } ); <?php $script = ob_get_clean(); wp_add_inline_script( 'bp-avatar', $script, 'after' ); }, 100 );
- Tosin on May 13, 2022 at 6:00 pm in reply to: [Resolved] Redirect users immediately after profile photo upload #44943
I also tried this but did not work
It also seems that profile photo is uploaded via ajax so would a redirect be possible
function redirect_after_avatar_upload() { if ( ! function_exists( 'buddypress' ) ) { return; } // check for user's last activity. $last_activity = bp_get_user_last_activity( $user->ID ); if ( empty( $last_activity ) ) { $page_url = site_url( '/onboard-invite-friends/' ); bp_core_redirect($page_url); } } add_action('xprofile_avatar_uploaded','redirect_after_avatar_upload' );
- Tosin on May 13, 2022 at 3:53 pm in reply to: [Resolved] Redirect users immediately after profile photo upload #44942
I saw this in a support thread
function redirectAfterAvatarUpload() { $location = '/members/'.bp_core_get_username(bp_loggedin_user_id()).'/profile/edit/group/1/'; bp_core_redirect($location); return; } add_action('xprofile_avatar_uploaded','redirectAfterAvatarUpload' );
I am using legacy template
- Tosin on May 4, 2022 at 6:16 am in reply to: [Resolved] Buddypress confirm action on registration exit #44823
Gentle reminder sir
Thanks Brajesh it worked perfectly
ok thanks this is resolved now
- Tosin on May 2, 2022 at 9:54 am in reply to: [Resolved] Buddypress confirm action on registration exit #44789
Kind reminder
Is it ok to replicate this same code twice and use another field id.
So there will be two similar code with different field id
Thanks
Thank brajesh
The plugin is still missing the ability to hide profile group by member types
Thanks