Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corelistener - pre_clear_scheduled_hook: Wrong number of arguments #19

Closed
JanThiel opened this issue Sep 7, 2021 · 3 comments · Fixed by #22
Closed

Corelistener - pre_clear_scheduled_hook: Wrong number of arguments #19

JanThiel opened this issue Sep 7, 2021 · 3 comments · Fixed by #22
Assignees
Labels
bug Something isn't working

Comments

@JanThiel
Copy link
Contributor

JanThiel commented Sep 7, 2021

Describe the bug

add_filter( 'pre_clear_scheduled_hook', [ $this, 'pre_clear_scheduled_hook' ], PHP_INT_MAX, 5 );

5 parameters configured, API only offers 4:
https://developer.wordpress.org/reference/functions/wp_clear_scheduled_hook/

    $pre = apply_filters( 'pre_clear_scheduled_hook', null, $hook, $args, $wp_error );

Environment (please complete the following information):

  • PHP version: 7.4.23
  • WordPress version and flavour MU 5.8

Best,
Jan

@JanThiel JanThiel added the bug Something isn't working label Sep 7, 2021
@Pierre-Lannoy
Copy link
Owner

Hi Jan!
Thanks for the hint. You're right, the signature I used is wrong. In fact, it is not even 4, but 3 parameters... OMG How did I let this go by?
Never mind, it will be fixed in the next release, of course...

@JanThiel
Copy link
Contributor Author

JanThiel commented Sep 9, 2021

You are very welcome :-) Things happen ;-) And this one doesn't really matter from a functional perspective.

But 4 parameter it is: $pre, $hook, $args, $wp_error.
Don't be confused by the 'null' in the apply_filters call.

Best,
Jan

@Pierre-Lannoy
Copy link
Owner

Thanks a lot, @JanThiel !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants