Make WordPress Core

Opened 6 years ago

Last modified 11 months ago

#43303 new enhancement

Providing hooks for html table markups in do_settings_{sections|fields}

Reported by: aranwer104's profile aranwer104 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Administration Keywords:
Focuses: ui, administration Cc:

Description

I Apologize if this is silly thing but having hooks may enable customization opportunity for opening/closing table markups of do_settings_sections and likewise with fields. while maintaining table markups by default for core & other Settings API pages.

do_settings_sections

echo '<table class="form-table">';
do_settings_fields( $page, $section['id'] );
echo '</table>';

Something like

do_action( 'do_settings_sections_opening_wrapper_{$page}, 'default_handler' );


Change History (4)

#1 @aranwer104
6 years ago

  • Keywords needs-patch added

#2 @aranwer104
6 years ago

  • Keywords needs-patch removed
  • Type changed from feature request to enhancement

#3 @pento
5 years ago

  • Version trunk deleted

#4 @zahardoc
11 months ago

I would vote for this enhancement, and furthermore, add some more filters there, for example:

  • Add filter to change the section title:

echo "<h2>{$section['title']}</h2>\n";

  • Add filter to change the form parameters:

echo '<table class="form-table" role="presentation">';

  • And add action at the end of the function:

do_action( 'do_settings_sections_closing_wrapper_{$page} );

I can make a MR for it.

Note: See TracTickets for help on using tickets.