Opened 14 years ago
Last modified 15 months ago
#15865 reopened enhancement
Make it easy to disable options / user settings
Reported by: | westi | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Options, Meta APIs | Keywords: | needs-refresh needs-testing |
Focuses: | administration | Cc: |
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 (6)
Change History (47)
#9
@
13 years ago
The first thing we need, as mentioned in #18251, is the missing functions:
remove_settings_field() remove_settings_section() remove_settings_error()
#10
@
13 years 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.
#12
@
13 years 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...
#13
@
13 years 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) {
#14
@
13 years 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.
#21
@
12 years 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
#26
@
12 years 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.
#30
@
12 years 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!
#31
@
11 years ago
- Keywords 3.6-early removed
I am looking at this again, just wondering if people think it would be best to just wrap the existing code in settings api stuff for now, and @helen is going to be looking at #16413 in 3.8 anyways.
#32
@
11 years ago
I have been playing about and you can see this might be one way of implementing the settings api to these files, I haven't done even one whole file as it is time consuming, but perhaps people could provide feedback on my patch and how it might work?
#33
@
9 years ago
- Keywords needs-refresh needs-testing added; westi-likes settings-api removed
- Milestone changed from Future Release to 4.4
- Owner changed from westi to chriscct7
- Status changed from new to assigned
I'm going to take a look at this as part of #32396
#34
@
9 years ago
- Keywords has-patch removed
- Milestone 4.4 deleted
- Resolution set to duplicate
- Status changed from assigned to closed
Duplicate of #28754.
#37
@
9 years ago
- Resolution set to duplicate
- Status changed from assigned to closed
Duplicate of #28754.
#38
@
7 years ago
- Resolution duplicate deleted
- Status changed from closed to reopened
I can't see how this is a dupe.
#39
@
7 years ago
- Component changed from Administration to Options, Meta APIs
- Focuses administration added
- Milestone set to Awaiting Review
Tempted to close this as duplicate of #16413