WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 14 months ago

#37355 new enhancement

remove_settings_section() counterpart to add_settings_section()

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

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 4 years ago.
Introduce remove_settings_section and add tests

Download all attachments as: .zip

Change History (3)

@stephenharris
4 years ago

Introduce remove_settings_section and add tests

#1 @stephenharris
4 years ago

  • Type changed from defect (bug) to enhancement

#2 @sc0ttkclark
4 years ago

  • Keywords has-unit-tests has-patch added

+1 on this

Note: See TracTickets for help on using tickets.