1

I've been trying to import some posts trough a cron action. The problem is my last step. Everything is going well, except for the execution of the cron. It is only passing trough the first argument.

Which would (clearly) point at the following code

add_action( 'import_videos_recurring', 'import_recurring', 10, 3 );

But if I execute the following code for testing purposes (simplified code). It will still pass me only one argument.

function import_recurring_3( $args ) {

    var_dump( $args );

}


function add_timething() {
    wp_schedule_event( time(), 'minutly', 'import_videos_recurring_3', array(
        'user' => 'testding',
        'value' =>'testwaarde',
        'break' => true
    ) );
}

add_action('init', 'add_timething');

add_action( 'import_videos_recurring_3', 'import_recurring_3', 10, 3 );

I've read a couple of questions & answers on the exchange here. But can't find why the following code is not working.

4
  • 2
    With "one argument" you mean the whole array? Or...?
    – kaiser
    Apr 15, 2015 at 15:46
  • Nope, it only passes trough the first argument in the array. Apr 16, 2015 at 7:21
  • Try using an associative array and use proper keys.
    – kaiser
    Apr 16, 2015 at 9:19
  • even if i do this (see edited question) nothing changes. Apr 21, 2015 at 13:59

1 Answer 1

0

I tried:

function import_recurring_3( $args, $args2, $args3 ) {
    var_dump( $args );
    var_dump( $args2 );
    var_dump( $args3 );
} 

And it worked. Just bizar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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