save_post hook triggered on frontend
-
Hi, in my functions.php file I put this line:
add_action( 'save_post', ['MyTransient', 'clear'] );
Triggering
save_post
hook I want call clear function inMyTransient
class that clear the transients.When I save a post it seems working fine but when I take a look in frontend I can see that
save_post
is triggered again.
I noticed that because I echo a test string in clear function.
The strange thing is that hook is triggered only the first time I visit frontend page.
Save_post hook should not be triggered on frontend.
How it is possible? Someone had got the same problem before?Thank you
- The topic ‘save_post hook triggered on frontend’ is closed to new replies.