wpaccessibility / settings-api-enhanced

An improved WordPress Settings API with default render callbacks and a new accessible layout.
9 stars 0 forks source link

Consider to abstract the description output #13

Open afercia opened 7 years ago

afercia commented 7 years ago

The field description output does basically always the same thing and could be abstracted in a method. If I'm not wrong, it currently does a slightly different thing only in the case of render_settings_field_radio() and render_settings_field_multibox().

felixarntz commented 7 years ago

@afercia I completely agree, and there are more areas that are similar across all of these functions.

I think we should eventually create a base class and then individual classes for each field type. This would provide a much better and more reusable codebase, and would also allow us to set a proper visibility for utility methods such as what you're proposing.

I'd like to leave the code as is for now and not outsource such parts, so that we can focus on the markup/CSS/a11y challenges. Code quality can come after we know what exactly we wanna do and how we wanna do it. :)

afercia commented 7 years ago

Sure, this is a general consideration and not an immediate priority 🙂