hlashbrooke / WordPress-Plugin-Template

A robust code template for creating a standards-compliant WordPress plugin.
https://hughlashbrooke.com/
GNU General Public License v2.0
1.03k stars 329 forks source link

Register Setting validation not working. #100

Open devanddhiraj opened 2 years ago

devanddhiraj commented 2 years ago

register_setting validation not working (validation function does not called) register_setting( $this->parent->_token . '_settings', $option_name, $validation);

rafasashi commented 1 year ago

Good point!

There is no such thing as $validation parameter in the first place.

According to the doc it should be passed into $args['sanitize_callback']:

https://developer.wordpress.org/reference/functions/register_setting/