Closed timiwahalahti closed 8 years ago
How do you propose handling controls with multiple settings?
I'm not against the idea of a built-in wrapper function for single-control + single-setting groups.
Something like:
$manager->register_field(
$name,
$control_args, // Calls `register_control()` internally.
$setting_args // Calls `register_setting()` internally.
);
That'd probably work when a control is only tied to a single setting. It's something I've thought about, but I want to get the base functionality down first.
I see that you added this wrapper function in latest commit, thanks!
Is there any reason why
register_control
could not callregister_setting
internally? It feels little annoying that i need to call both functions for registering one field, when it would be possible to just addsanitize_callback
argument toregister_control
function.In my opinion, calling
register_setting
makes code tangled and unnecessarily long especially when there is many fields.