diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php
index 8e22630d6a..9e6eacd1d8 100644
|
a
|
b
|
function add_settings_section( $id, $title, $callback, $page ) { |
| 1627 | 1627 | * @type string $class CSS Class to be added to the `<tr>` element when the |
| 1628 | 1628 | * field is output. |
| 1629 | 1629 | * } |
| | 1630 | * |
| | 1631 | * @param int $position The position in the settings order this item should appear. |
| 1630 | 1632 | */ |
| 1631 | | function add_settings_field( $id, $title, $callback, $page, $section = 'default', $args = array() ) { |
| | 1633 | function add_settings_field( $id, $title, $callback, $page, $section = 'default', $args = array(), $position = null ) { |
| 1632 | 1634 | global $wp_settings_fields; |
| 1633 | 1635 | |
| 1634 | 1636 | if ( 'misc' === $page ) { |
| … |
… |
function add_settings_field( $id, $title, $callback, $page, $section = 'default' |
| 1662 | 1664 | 'title' => $title, |
| 1663 | 1665 | 'callback' => $callback, |
| 1664 | 1666 | 'args' => $args, |
| | 1667 | 'position' => $position, |
| 1665 | 1668 | ); |
| 1666 | 1669 | } |
| 1667 | 1670 | |
| … |
… |
function do_settings_fields( $page, $section ) { |
| 1724 | 1727 | return; |
| 1725 | 1728 | } |
| 1726 | 1729 | |
| 1727 | | foreach ( (array) $wp_settings_fields[ $page ][ $section ] as $field ) { |
| | 1730 | $fields = (array) $wp_settings_fields[ $page ][ $section ]; |
| | 1731 | |
| | 1732 | usort( $fields, function( $a, $b ) { |
| | 1733 | return $a['position'] - $b['position']; |
| | 1734 | } ); |
| | 1735 | |
| | 1736 | foreach ( $fields as $field ) { |
| 1728 | 1737 | $class = ''; |
| 1729 | 1738 | |
| 1730 | 1739 | if ( ! empty( $field['args']['class'] ) ) { |
diff --git a/src/wp-content/themes/twentytwentyone/functions.php b/src/wp-content/themes/twentytwentyone/functions.php
index 1139c3b659..bc51fc218f 100644
|
a
|
b
|
function twentytwentyone_add_ie_class() { |
| 627 | 627 | <?php |
| 628 | 628 | } |
| 629 | 629 | add_action( 'wp_footer', 'twentytwentyone_add_ie_class' ); |
| | 630 | |
| | 631 | |
| | 632 | add_action( 'admin_init', 'wpse_57647_register_settings' ); |
| | 633 | |
| | 634 | function wpse_57647_register_settings() |
| | 635 | { |
| | 636 | add_settings_field( |
| | 637 | 'add_position2_in_settings_api', |
| | 638 | 'How Will Position Work 2', |
| | 639 | 'print_settings_text', |
| | 640 | 'general', |
| | 641 | 'default', |
| | 642 | array(), |
| | 643 | 10 |
| | 644 | ); |
| | 645 | |
| | 646 | add_settings_field( |
| | 647 | 'add_position1_in_settings_api', |
| | 648 | 'How Will Position Work 1', |
| | 649 | 'print_settings_text', |
| | 650 | 'general', |
| | 651 | 'default', |
| | 652 | array(), |
| | 653 | 9 |
| | 654 | ); |
| | 655 | } |
| | 656 | |
| | 657 | function print_settings_text() |
| | 658 | { |
| | 659 | echo 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Explicabo repellat dicta, natus quaerat odio facere debitis, asperiores libero quidem aut praesentium autem, inventore sequi veniam sunt totam ipsam quos facilis?'; |
| | 660 | } |
| | 661 | No newline at end of file |