Options, Meta APIs: Ensure after_section is printed for sections without any fields.

This brings consistency with the `before_section` HTML content, which did get printed in `do_settings_sections()` regardless of whether the settings section has any fields attached.

Follow-up to [8855], [21742], [54247].

Props alpipego, SergeyBiryukov.
Fixes #62746.
Built from https://develop.svn.wordpress.org/trunk@59564


git-svn-id: http://core.svn.wordpress.org/trunk@58950 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-12-28 22:10:20 +00:00
parent 233cf19ea7
commit 8166540e32
2 changed files with 5 additions and 6 deletions

View File

@ -1784,12 +1784,11 @@ function do_settings_sections( $page ) {
call_user_func( $section['callback'], $section );
}
if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
continue;
if ( isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
echo '<table class="form-table" role="presentation">';
do_settings_fields( $page, $section['id'] );
echo '</table>';
}
echo '<table class="form-table" role="presentation">';
do_settings_fields( $page, $section['id'] );
echo '</table>';
if ( '' !== $section['after_section'] ) {
echo wp_kses_post( $section['after_section'] );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59563';
$wp_version = '6.8-alpha-59564';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.