WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#16231 closed enhancement (wontfix)

settings_fields and do_settings_sections should have an echo option

Reported by: AshKyd Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: General Keywords: reporter-feedback
Focuses: Cc:

Description

Neither settings_fields() and do_settings_sections() have the option to supress echoing content to the page. This means the output can't be adjusted, and the functions can't easily be used in higher level situations such as within an actual templating language or in an AJAX call.

I had a peek at the code, and adding a $echo parameter to settings_fields seems quite straightforward, but retaining backward compatibility in do_settings_sections could be difficult.

Attachments (1)

plugin.php.diff (681 bytes) - added by AshKyd 9 years ago.
wp-admin/includes/plugin.php diff from revision 17297.

Download all attachments as: .zip

Change History (5)

@AshKyd
9 years ago

wp-admin/includes/plugin.php diff from revision 17297.

#1 @filosofo
9 years ago

Since this is a small amount of text and an obscure situation, wouldn't it be most easily done with output buffers?

#2 @nacin
9 years ago

  • Keywords reporter-feedback added; settings_fields do_settings_sections plugins settings removed

I'd tend to agree.

#3 @markjaquith
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Thirded. There's no shame in output buffers. Well, only a little. :-)

#4 @AshKyd
9 years ago

Cheers, I'll do that instead. :)

Note: See TracTickets for help on using tickets.