AI Assistant
Notifications
Clear all

[Closed] Flush cache when profile pic is updated

4 Posts
2 Users
0 Reactions
1,307 Views
Posts: 460
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@danniee)
Honorable Member
Joined: 7 years ago
[#18904]

Hi,

I use a plugin called comment widget plus. Whenever I change my profile pic it's updated fine everywhere except in that widget. I think I need to make that plugin flush cache when a new profile picture is uploaded. I have found the following code in the plugin:

// Flush cache
add_action('comment_post', array($this, 'flush_widget_cache'));
add_action('edit_comment', array($this, 'flush_widget_cache'));
add_action('transition_comment_status', array($this, 'flush_widget_cache'))

And I tried adding Wordpress actions, but that did not help:

add_action('edit_user_profile_update', array($this, 'flush_widget_cache'));
add_action('personal_options_update', array($this, 'flush_widget_cache'));

So I figured maybe wpforo uses its own actions that I need to add instead to make it work?


3 Replies
Chris
Posts: 3610
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@chris)
Famed Member
Joined: 5 years ago

Hi @danniee,

Use this code 

do_action( 'wpforo_update_profile_after', $user );

Posts: 460
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@danniee)
Honorable Member
Joined: 7 years ago

I really thought that would work but it didn't :/

Seems like it's more complex than this. I use Redis, so I suspect I need to exclude that plugin from being cached by Redis.


1 Reply
Chris
(@chris)
Joined: 5 years ago

Famed Member
Posts: 3610
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@danniee,

If you're using caching plugin, also exclude wpForo to get reed of further problems.


Share: