Opened 16 years ago
Last modified 3 years ago
#15865 reopened enhancement
Make it easy to disable options / user settings
| Reported by: | westi | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Options, Meta APIs | Version: | |
| Severity: | normal | Keywords: | needs-refresh needs-testing |
| Cc: | Focuses: | administration |
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
@
15 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
@
15 years ago
- Cc 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
@
15 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
@
15 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
@
15 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
@
14 years ago
- Cc 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
@
14 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
@
14 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
@
13 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
@
13 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
@
11 years ago
- Keywords needs-refresh needs-testing added; westi-likes settings-api removed
- Milestone Future Release → 4.4
- Owner changed from to
- Status new → assigned
I'm going to take a look at this as part of #32396
#34
@
11 years ago
- Keywords has-patch removed
- Milestone 4.4
- Resolution → duplicate
- Status assigned → closed
Duplicate of #28754.
#39
@
8 years ago
- Component Administration → Options, Meta APIs
- Focuses administration added
- Milestone → Awaiting Review
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Tempted to close this as duplicate of #16413