Skip to:
Content
Pages
Categories
Search
Top
Bottom

Refresh Page after uploading a Cover Image or Avatar – Still looking in 2020….


  • jcfromkc
    Participant

    @jcfromkc

    BuddyPress does not refresh the page after you’ve uploaded a Cover Image or Avatar. I found an article that used the following incomplete code.

    $(document).ajaxComplete( function( event, xhr, settings ) {
      if ( settings.action === "avatar ajax action" ) {
        // reload page code
      }
    });

    Has anyone figured this out yet? Can you please share your solution?

    Using the incomplete code posted above, does anyone know what we should be replacing //reload page code with? I’ve tried all of the standard JS refresh commands with no luck.

    Thanks

Viewing 1 replies (of 1 total)

  • jcfromkc
    Participant

    @jcfromkc

    I found the solution.

    I created a new file called refresh-page.js and used the following code.

    jQuery(window).load(function() {
                   bp.CoverImage.Attachment.on( 'change:url', function( data ) {
                    window.location.replace("http://mywebsite.com/me/profile/change-cover-image/");
                   } );
                   });
    

    This refreshes the Cover Image page after uploading a new image!!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar