diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php
index b89a899..4f1336c 100644
|
a
|
b
|
function do_accordion_sections( $screen, $context, $object ) { |
| 1312 | 1312 | * 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using |
| 1313 | 1313 | * add_options_page(); |
| 1314 | 1314 | */ |
| 1315 | | function add_settings_section( $id, $title, $callback, $page ) { |
| | 1315 | function add_settings_section( $id, $title, $callback, $page, $args = array() ) { |
| 1316 | 1316 | global $wp_settings_sections; |
| 1317 | 1317 | |
| | 1318 | $defaults = array( |
| | 1319 | 'id' => $id, |
| | 1320 | 'title' => $title, |
| | 1321 | 'callback' => $callback, |
| | 1322 | 'before_section' => "", |
| | 1323 | 'after_section' => "", |
| | 1324 | 'section_class' => "", |
| | 1325 | ); |
| | 1326 | |
| | 1327 | $section = wp_parse_args( $args, $defaults ); |
| | 1328 | |
| 1318 | 1329 | if ( 'misc' == $page ) { |
| 1319 | 1330 | _deprecated_argument( |
| 1320 | 1331 | __FUNCTION__, '3.0.0', |
| … |
… |
function add_settings_section( $id, $title, $callback, $page ) { |
| 1339 | 1350 | $page = 'reading'; |
| 1340 | 1351 | } |
| 1341 | 1352 | |
| 1342 | | $wp_settings_sections[ $page ][ $id ] = array( |
| 1343 | | 'id' => $id, |
| 1344 | | 'title' => $title, |
| 1345 | | 'callback' => $callback, |
| 1346 | | ); |
| | 1353 | $wp_settings_sections[ $page ][ $id ] = $section; |
| 1347 | 1354 | } |
| 1348 | 1355 | |
| 1349 | 1356 | /** |
| … |
… |
function do_settings_sections( $page ) { |
| 1437 | 1444 | } |
| 1438 | 1445 | |
| 1439 | 1446 | foreach ( (array) $wp_settings_sections[ $page ] as $section ) { |
| | 1447 | if ( '' != $section['before_section'] ) { |
| | 1448 | echo sprintf( $section['before_section'], $section['section_class'] ); |
| | 1449 | } |
| | 1450 | |
| 1440 | 1451 | if ( $section['title'] ) { |
| 1441 | 1452 | echo "<h2>{$section['title']}</h2>\n"; |
| 1442 | 1453 | } |
| … |
… |
function do_settings_sections( $page ) { |
| 1451 | 1462 | echo '<table class="form-table">'; |
| 1452 | 1463 | do_settings_fields( $page, $section['id'] ); |
| 1453 | 1464 | echo '</table>'; |
| | 1465 | |
| | 1466 | if ( '' != $section['after_section'] ) { |
| | 1467 | echo $section['after_section']; |
| | 1468 | } |
| 1454 | 1469 | } |
| 1455 | 1470 | } |
| 1456 | 1471 | |