Make WordPress Core

Opened 13 years ago

Closed 11 years ago

#25154 closed enhancement (wontfix)

add args argument to add_settings_section

Reported by: cfoellmann Owned by:
Priority: normal Milestone:
Component: Plugins Version:
Severity: normal Keywords: has-patch
Cc: Focuses: administration

Description

Added an $args array to the function

add_settings_section( $id, $title, $callback, $page )

which results in

add_settings_section( $id, $title, $callback, $page, $args = array() )

Example functions:

function register_some_settings() {
	add_settings_section( 
		'some_id', // $id
		'Some Title', // $title
		'generate_section', // $callback
		'some_page', // $page
		array(
			"desc" => "some text for the section description"
		)
	);
	
	// add some fields ...
	
	add_settings_section( 
		'some_other_id', // $id
		'Another Title', // $title
		'generate_section', // $callback
		'some_page', // $page
		array(
			"desc" => "A DIFFERENT text for the second section's description"
		)
	);
}

function generate_section( $args ) {
	echo '<p>' . $args['desc'] . '</p>';
}

Attachments (1)

add_args_to_settings_section_callback.patch (1.6 KB ) - added by cfoellmann 13 years ago.
hand over args to add_settings_section callback function

Download all attachments as: .zip

Change History (5)

@cfoellmann
13 years ago

hand over args to add_settings_section callback function

#1 @nacin
13 years ago

  • Component GeneralPlugins

#2 @nacin
13 years ago

  • Component PluginsAdmin APIs
  • Focuses administration added

#3 @nacin
13 years ago

  • Component Admin APIsPlugins

Sorry for the noise.

#4 @DrewAPicture
11 years ago

  • Milestone Awaiting Review
  • Resolutionwontfix
  • Status newclosed

No activity or further interest in almost 2 years. Closing as wontfix.

Note: See TracTickets for help on using tickets.