Make WordPress Core


Ignore:
Timestamp:
12/28/2024 10:08:19 PM (23 months ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/template.php

    r59224 r59564  
    17851785                }
    17861786
    1787                 if ( ! isset( $wp_settings_fields ) || ! isset( $wp_settings_fields[ $page ] ) || ! isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
    1788                         continue;
    1789                 }
    1790                 echo '<table class="form-table" role="presentation">';
    1791                 do_settings_fields( $page, $section['id'] );
    1792                 echo '</table>';
     1787                if ( isset( $wp_settings_fields[ $page ][ $section['id'] ] ) ) {
     1788                        echo '<table class="form-table" role="presentation">';
     1789                        do_settings_fields( $page, $section['id'] );
     1790                        echo '</table>';
     1791                }
    17931792
    17941793                if ( '' !== $section['after_section'] ) {
Note: See TracChangeset for help on using the changeset viewer.