0

I've got a function that I'm trying to fire at wp_signon (grabs data from a remote server and updates accordingly). I'm running the function within a class that is on a secondary file in a plugin (i.e. brought in with a require_once). For the life of me, I cannot get this function to run at all.

add_action( 'wp_signon', array(&$this, 'login_pull_updates'), 40, 3 );

        function login_pull_updates() {
            update_option('ap_login_run', 'YES I DID');
        }

I'm using that now to just test and confirm it's running at all, and it won't fire. Any ideas?

5
  • FWIW, I've tried the same function with wp_login instead of wp_signon and it still didn't work – Norcross Jun 11 '12 at 17:38
  • On what action is the class object created? – fuxia Jun 11 '12 at 17:57
  • add_action init – Norcross Jun 11 '12 at 18:18
  • Are you sure an action 'wp_signon' exists? Could not find it … – fuxia Jun 11 '12 at 18:24
  • I realized I should be using wp_login (got confused) but the problem remains. it appears to be related to the fact that it's in a class, since a stand-alone function works. – Norcross Jun 11 '12 at 18:34
2

wp_signon doesn't exist (at least according to http://codex.wordpress.org/Plugin_API/Action_Reference) but I tried tossing this into a fresh theme and it seems to work:

class TestThing {

    function __construct() {
        add_action( 'wp_login', array($this, 'login_pull_updates') );
    }

    function login_pull_updates($login, &$user) {
        update_option('ap_login_run', 'YES I DID');
    }

}

$test = new TestThing();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.