Make WordPress Core

Opened 10 years ago

Last modified 7 years ago

#37355 new enhancement

remove_settings_section() counterpart to add_settings_section()

Reported by: stephenharris Owned by:
Priority: normal Milestone:
Component: Options, Meta APIs Version: 4.6
Severity: normal Keywords: has-unit-tests has-patch
Cc: Focuses:

Description

The settings API allows for settings sections to be added, but not removed.

To remove section you have to do the following

<?php
global $wp_settings_sections;
unset( $wp_settings_sections[$page][$id] )

To avoid accessing globals directly this should be wrapped inside a function.

Attachments (1)

remove-settings-section.diff​ (2.6 KB ) - added by stephenharris 10 years ago.
Introduce remove_settings_section and add tests

Download all attachments as: .zip

Change History (3)

@stephenharris
10 years ago

Introduce remove_settings_section and add tests

#1 @stephenharris
10 years ago

  • Type defect (bug) → enhancement

#2 @sc0ttkclark
10 years ago

  • Keywords has-unit-tests has-patch added

+1 on this

Note: See TracTickets for help on using tickets.