WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 5 years ago

#25154 closed enhancement (wontfix)

add args argument to add_settings_section

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

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 7 years ago.
hand over args to add_settings_section callback function

Download all attachments as: .zip

Change History (5)

@cfoellmann
7 years ago

hand over args to add_settings_section callback function

#1 @nacin
7 years ago

  • Component changed from General to Plugins

#2 @nacin
7 years ago

  • Component changed from Plugins to Admin APIs
  • Focuses administration added

#3 @nacin
7 years ago

  • Component changed from Admin APIs to Plugins

Sorry for the noise.

#4 @DrewAPicture
5 years ago

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

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

Note: See TracTickets for help on using tickets.