Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to update Change-Avatar Page after changing the avatar?


  • y.ryslan
    Participant

    @yryslan

    Hello. Help me friends. (Sorry for my English).
    I use WP 4.1 + BuddyPress 2.1.1 + WP Super Cache 1.4.2 with option “Clear all cache files when a post or page is published or updated.” But when the user changes their avatar, the cache is not updated. I do not include option “Don’t cache pages for known users” because of the fact that the site will contain mostly registered users. Thus, the cache is updated after update the page.
    Q: how to automatically update Change-Avatar page after changing the avatar?
    Or if there is some direct way to clear all cache files after changing the avatar?

Viewing 1 replies (of 1 total)

  • modemlooper
    Moderator

    @modemlooper

    You would need to hook into the avatar save with something like xprofile_avatar_uploaded. Then from the cache docs wp_cache_post_change( $post_id )

    function uncache_bp(){
    
    	$page_array = get_option('bp-pages');
    
    	wp_cache_post_change( $page_array['members'] );
    
    }
    add_action('xprofile_avatar_uploaded', 'uncache_bp');

    Not sure this will work as not tested

Viewing 1 replies (of 1 total)
  • The topic ‘How to update Change-Avatar Page after changing the avatar?’ is closed to new replies.
Skip to toolbar