bbp_admin_get_settings_fields_for_section( string $section_id = '' )

Get settings fields by section.


Description Description


Parameters Parameters

$section_id

(Optional) ID of the section to get fields for

Default value: ''


Top ↑

Return Return

(mixed) False if section is invalid, array of fields otherwise.


Top ↑

Source Source

File: includes/admin/settings.php

function bbp_admin_get_settings_fields_for_section( $section_id = '' ) {
	static $fields = array();

	// Default return value
	$retval = array();

	// Bail if section is empty
	if ( empty( $section_id ) ) {
		return false;
	}

	// Get all of the fields (so we can snag one section of them)
	if ( empty( $fields ) ) {
		$fields = bbp_admin_get_settings_fields();
	}

	// Get the field by section
	if ( isset( $fields[ $section_id ] ) ) {
		$retval = $fields[ $section_id ];
	}

	// Filter & return
	return (array) apply_filters( 'bbp_admin_get_settings_fields_for_section', $retval, $section_id );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.