From 8166540e32dee5e28dd550f42147fc85bd274d10 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 28 Dec 2024 22:10:20 +0000 Subject: [PATCH] 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 --- wp-admin/includes/template.php | 9 ++++----- wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 3bff8bc279..a0d07696d3 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -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 ''; + do_settings_fields( $page, $section['id'] ); + echo ''; } - echo ''; - do_settings_fields( $page, $section['id'] ); - echo ''; if ( '' !== $section['after_section'] ) { echo wp_kses_post( $section['after_section'] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 2463382598..9393470e53 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.