Run action when a plugins options are updated (2 posts)

  1. GerryBot
    Posted 4 years ago #

    I'm writing an experimental plugin that retrieves social media stats from Twitter and Facebook and displays them in a box on the blog.

    The problem I'm having is that the user must enter their Twitter ID/Facebook page URL in order for the service to work. I've created an options page for this, but when the user saves the audience, I want the plugin to immediately go off and retrieve the follower counts for each service.

    All the functions are in place and working - I just need to trigger the function executing whenever the user updates the plugin options. Can anybody point me in the right direction?

  2. GerryBot
    Posted 4 years ago #

    As a crude hack, I've set the refresh function to run whenever the settings page is loaded. This seems to do the trick for now, but I'm sure there's a more elegant way to code this...

Topic Closed

This topic has been closed to new replies.

About this Topic