Opened 2 years ago
Last modified 4 months ago
#15865 new enhancement
Make it easy to disable options / user settings
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | westi-likes settings-api 3.6-early has-patch |
| Cc: | scribu, kparsell-wp@…, trac@…, d@…, me@…, eddie.moya+wptrac@…, unknowndomain, knut@…, pippin@… |
Description
We have a wonderful option white listing system.
The one thing it doesn't support is hiding the ui of core options if you don't want them changed.
We should have a generic way of doing this.
Attachments (4)
Change History (34)
comment:4
ptahdunbar — 2 years ago
- Cc trac@… added
- Cc d@… added
The first thing we need, as mentioned in #18251, is the missing functions:
remove_settings_field() remove_settings_section() remove_settings_error()
comment:10
ctsttom — 22 months ago
- Cc me@… added
If someone would mentor me a little on this I will try and do it and submit the patch, would love to get into core dev work but just a little confused as to where to start... I know kung-fu (PHP) and I have a couple of plugins but the leap seems a little uncomfortable to pitch my fork in.
comment:12
ctsttom — 22 months ago
- Keywords has-patch needs-testing added
Okay so here is my first attempt to add the two functions I suggested, I didn't add remove_settings_error() because I don't really know why you'd want that / I don't under stand that part yet...
I also wrote a dummy plugin to test the code out with (there is a function within it called test_removal() which you can uncomment to test, and var_dump the globals $wp_settings_sections and $wp_settings_fields from /wp-admin/includes/template.php
Files attached...
comment:13
scribu — 22 months ago
Instead of if ( count( $wp_settings_fields[$page] ) == 0 ), you should use empty(), which is faster.
Also, spaces are needed before and after the parameter list:
function remove_settings_section($id, $page) {
comment:14
ctsttom — 22 months ago
I have fixed those two points, funnily enough I was going to put spaces around the parameter list but every other function in that file was missing those so I thought I shouldn't do it.
comment:15
ctsttom — 22 months ago
Would someone review this for inclusion?
comment:16
scribu — 22 months ago
We need to figure out what we're going to do in #18285 first.
comment:17
ctsttom — 22 months ago
@scribu Thanks, I will hold off then.
comment:18
ctsttom — 16 months ago
Where are we at with this, and the Settings API stuff?
comment:19
scribu — 16 months ago
We are nowhere. A winning approach has not been found yet.
comment:20
eddiemoya — 14 months ago
- Cc eddie.moya+wptrac@… added
comment:21
unknowndomain — 9 months ago
- Cc unknowndomain added
Hey folks,
Wanted to notify you of a call to action on this tickets blocking ticket:
http://core.trac.wordpress.org/ticket/18285#comment:76
Thanks
Tom
comment:22
knutsp — 6 months ago
- Cc knut@… added
comment:23
unknowndomain — 6 months ago
- Keywords settings-3.6 added; has-patch needs-testing removed
comment:24
SergeyBiryukov — 5 months ago
- Keywords has-patch added
comment:25
mordauk — 5 months ago
- Cc pippin@… added
comment:26
ctsttom — 5 months ago
- Keywords needs-refresh 3.6 added; has-patch removed
Once 3.5.1 is out of the way I am going to referesh this.
comment:27
SergeyBiryukov — 5 months ago
- Keywords 3.6 removed
comment:28
SergeyBiryukov — 5 months ago
- Keywords 3.6-early added
comment:29
SergeyBiryukov — 5 months ago
- Keywords settings-api added; settings-3.6 removed
comment:30
unknowndomain — 4 months ago
- Keywords has-patch added; needs-refresh removed
I have updated my patch for 3.6 and added remove_settings_error, and some minor changes to my documentation.
Would love a review on this!

Tempted to close this as duplicate of #16413