Hi Tosin,
You can usebp_is_user_change_avatar()
for that purpose.
@danieleherat
Thank you.You can put it in wp-contet/plugins/bp-custom.php
Regards
BrajeshHi Brajesh,
Sorry I’m not a php programmer, could you please just tell me how to put my url please? I have pasted your code below again, I want that the redirect will be to https://www.mywebsite/members/me
/** * Redirect user on successful php upload and crop. */ add_action( 'bp_enqueue_scripts', function () { // you can set the url value to anything. $url = trailingslashit( trailingslashit( bp_get_members_directory_permalink() ) . 'me/' . bp_get_members_invitations_slug() ); 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 );
Thank you!
Regards
DanielRegards
DanielHello Daniel,
Please replace the following line:
$url = trailingslashit( trailingslashit( bp_get_members_directory_permalink() ) . 'me/' . bp_get_members_invitations_slug() );
with
$url = trailingslashit( bp_loggedin_user_domain() );
Give it a try.
Regards
Ravi
You must be logged in to reply to this topic.
This topic is: resolved