This is a potential feature request.
It’d be massively useful to add an $args element of this function, so that you can send arguments to the callback function.
Currently you have to create a separate function to sanitize each field with different requirements (eg max 30 characters, only numeric etc) whereas this information could easily be passed by arguments to the function.
Even just sending the option name would be useful, so you could set up an array that stores the sanitize requirements for each option field.
- The topic ‘register setting callback function’ is closed to new replies.