Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 50449)
+++ wp-admin/includes/template.php	(working copy)
@@ -1667,13 +1667,12 @@
  * add_settings_section() and add_settings_field()
  *
  * @global array $wp_settings_sections Storage array of all settings sections added to admin pages.
- * @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections.
  * @since 2.7.0
  *
  * @param string $page The slug name of the page whose settings sections you want to output.
  */
 function do_settings_sections( $page ) {
-	global $wp_settings_sections, $wp_settings_fields;
+	global $wp_settings_sections;
 
 	if ( ! isset( $wp_settings_sections[ $page ] ) ) {
 		return;
@@ -1680,24 +1679,78 @@
 	}
 
 	foreach ( (array) $wp_settings_sections[ $page ] as $section ) {
-		if ( $section['title'] ) {
-			echo "<h2>{$section['title']}</h2>\n";
-		}
+		render_settings_section( $page, $section );
+	}
+}
 
-		if ( $section['callback'] ) {
-			call_user_func( $section['callback'], $section );
-		}
+/**
+ * Prints out a particular settings section added to a particular settings page
+ *
+ * Part of the Settings API. Use this in a settings page callback function
+ * to output all the fields that were added into the $section_to_find for that $page with
+ * add_settings_section() and add_settings_field()
+ *
+ * @global array $wp_settings_sections Storage array of all settings sections added to admin pages.
+ *
+ * @param string $page The slug name of the page whose settings sections you want to output.
+ * @param string $section_to_find The id of the section on $page you want to output.
+ */
+function do_settings_section( $page, $section_to_find ) {
+	global $wp_settings_sections;
 
-		if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
-			continue;
+	if ( ! isset( $wp_settings_sections[ $page ] ) ) {
+		return;
+	}
+
+	$found_section = false;
+	foreach ( (array) $wp_settings_sections[ $page ] as $section ) {
+		if ( $section['id'] == $section_to_find ) {
+			$found_section = true;
+			break;
 		}
-		echo '<table class="form-table" role="presentation">';
-		do_settings_fields( $page, $section['id'] );
-		echo '</table>';
 	}
+
+	if ( ! $found_section ) {
+		return;
+	}
+
+	render_settings_section( $page, $section );
 }
 
 /**
+ * Prints out a particular settings section added to a particular settings page
+ *
+ * Used by do_settings_sections() and do_settings_section() but not intended for public use
+ *
+ * @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections.
+ *
+ * @param string $page The slug name of the page whose settings sections you want to output.
+ * @param array $section The section array from $wp_settings_sections to be output.
+ */
+function render_settings_section( $page, $section ) {
+	global $wp_settings_fields;
+
+	if ( ! is_array( $section ) || ! isset( $section['id'] ) ) {
+		return;
+	}
+
+	if ( $section['title'] ) {
+		echo "<h2>{$section['title']}</h2>\n";
+	}
+
+	if ( $section['callback'] ) {
+		call_user_func( $section['callback'], $section );
+	}
+
+	if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
+		return;
+	}
+	echo '<table class="form-table" role="presentation">';
+	do_settings_fields( $page, $section['id'] );
+	echo '</table>';
+}
+
+/**
  * Print out the settings fields for a particular settings section.
  *
  * Part of the Settings API. Use this in a settings page to output
