wp-handler
wp-handler copied to clipboard
Checking argument counts for callbacks
Too many times, I've used addAction or addFilter for a function that needs two or more arguments passed into its scope and forgotten to tell WordPress about that requirement. So, I've modified the isValidCallback method to do so. It will now indicate that a callback is invalid if the number of required parameters for a callback is less than the number of arguments WordPress is going to send it.