Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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? –  toscho 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 … –  toscho 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

1 Answer 1

up vote 2 down vote accepted

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();
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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