Ticket #17851: #17851.patch
| File #17851.patch, 1.5 KB (added by , 4 years ago) |
|---|
-
template.php
1557 1557 * 'general', 'reading', 'writing', 'discussion', 'media', etc. Create your own using 1558 1558 * add_options_page(); 1559 1559 */ 1560 function add_settings_section( $id, $title, $callback, $page) {1560 function add_settings_section($id, $title, $callback, $page, $args = array()) { 1561 1561 global $wp_settings_sections; 1562 1562 1563 $defaults = array( 1564 'id' => $id, 1565 'title' => $title, 1566 'callback' => $callback, 1567 'before_section' => "", 1568 'after_section' => "", 1569 'section_class' => "", 1570 ); 1571 $section = wp_parse_args( $args, $defaults ); 1572 1563 1573 if ( 'misc' === $page ) { 1564 1574 _deprecated_argument( 1565 1575 __FUNCTION__, … … 1686 1696 } 1687 1697 1688 1698 foreach ( (array) $wp_settings_sections[ $page ] as $section ) { 1699 if ( $section['before_section'] != "" ) { 1700 echo sprintf($section['before_section'], $section['section_class']); 1701 } 1702 1689 1703 if ( $section['title'] ) { 1690 1704 echo "<h2>{$section['title']}</h2>\n"; 1691 1705 } … … 1700 1714 echo '<table class="form-table" role="presentation">'; 1701 1715 do_settings_fields( $page, $section['id'] ); 1702 1716 echo '</table>'; 1717 if ( $section['after_section'] != "" ) { 1718 echo $section['after_section']; 1719 } } 1703 1720 } 1704 1721 } 1705 1722