BuddyDev

Search

[Resolved] BP Force Profile Photo – red notification message remains

  • Participant
    Level: Initiated
    Posts: 3
    Petra on #4295

    Hi,
    thanks for the great plugin. I am using BP Force Profile Photo on my dating site and it works well ( not letting users to use any aspect of the site before uploading a photo ). The only problem is, that once the user upload the photo, the message “Please upload your profile photo to start using this site” remains until the user refresh the site or visit other parts of the site. It is unfortunately very confusing as the user might think, that it didn’t work and that they still can’t use the site even though they have uploaded the photo. Is there a way we can get this message to disappear straight after the photo is uploaded withouth the need of manually refreshing the site?
    Thanks a lot!

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2909
    Ravi on #4298

    Hi Petra,

    Thank You for posting. Please use the following code in your current theme ‘functions.php’

    
    
    function buddydev_remove_upload_avatar_error_message() {
    
    	if( ! function_exists( 'buddypress' ) || ! bp_is_user_change_avatar() ) {
    		return ;
    	}
    
    	?>
    
    	<script type="text/javascript">
    
    		jQuery(document).ready( function() {
    
    			if( typeof bp == 'undefined' || typeof bp.Avatar =='undefined' ) {
    
    				return;
    
    			}
    
    			bp.Avatar.Attachment.on("change:url", function (data) {
    
    				jQuery("#message").remove();
    
    			});
    		});
    
    	</script>
    
    	<?php
    }
    add_action( 'wp_footer', 'buddydev_remove_upload_avatar_error_message' );
    
    

    Let me know. If it works or not.

    Thank You
    Ravi

  • Participant
    Level: Initiated
    Posts: 3
    Petra on #4305

    What a magic! The code works like a charm!
    Thanks a lot!

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2909
    Ravi on #4306

    Hi Petra,

    Thank You for this acknowledgement. I am glad that I could help.

You must be logged in to reply to this topic.

This topic is: resolved