Sections and tabs DRY – WordPress settings API

Well you could do something like this: Create an associative array for settings, then loop through them to create settings and sections for each field. $settings = array( ‘setting_1_id’ => array( ‘title’=>’First Box Settings’, ‘page’=>’first_box_option’, ‘fields’=> array( array( ‘id’=> ‘box_first_title’, ‘title’=>’Title’, ‘callback’=> ‘text_callback’ ), array( ‘id’=> ‘box_first_desc’, ‘title’=>’Description’, ‘callback’=> ‘textarea_callback’ ), array( ‘id’=> ‘box_first_link’, ‘title’=>’Link’, … Read more