diff --git a/src/class.settings-api.php b/src/class.settings-api.php index 7cfe4b3..16cd23c 100755 --- a/src/class.settings-api.php +++ b/src/class.settings-api.php @@ -521,7 +521,7 @@ function show_navigation() { } /** - * Show the section settings forms + * Show the section settings forms using a custom do_settings_sections() * * This function displays every sections in a different form */ @@ -534,7 +534,7 @@ function show_forms() { do_settings_sections( $form['id'] ); do_action( 'wsa_form_bottom_' . $form['id'], $form ); if ( isset( $this->settings_fields[ $form['id'] ] ) ): ?> @@ -652,6 +652,104 @@ function _style_fix() { '; + $this->do_settings_fields( $page, $section['id'] ); + echo ''; + } + } + + /** + * If there is a type == subsection, just call the call_user_func() instead of creating the tr + * + * @see \do_settings_fields() from template.php + * @param $page + * @param $section + */ + function do_settings_fields( $page, $section ) { + global $wp_settings_fields; + + if ( ! isset( $wp_settings_fields[ $page ][ $section ] ) ) { + return; + } + + foreach ( (array) $wp_settings_fields[ $page ][ $section ] as $field ) { + $class = ''; + + if ( $field['args']['type'] != 'subsection' ) { + if ( ! empty( $field['args']['class'] ) ) { + $class = ' class="' . esc_attr( $field['args']['class'] ) . '"'; + } + + echo "