WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 5 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:
PR Number:

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

Download all attachments as: .zip

Change History (3)

@stephenharris
3 years ago

Introduce remove_settings_section and add tests

#1 @stephenharris
3 years ago

  • Type changed from defect (bug) to enhancement

#2 @sc0ttkclark
3 years ago

  • Keywords has-unit-tests has-patch added

+1 on this

Note: See TracTickets for help on using tickets.