Opened 12 years ago
Closed 7 years ago
#21403 closed enhancement (maybelater)
Introduce wp_scandir, remove opendir / closedir code
Reported by: | wonderboymusic | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Filesystem API | Keywords: | needs-refresh dev-feedback |
Focuses: | Cc: |
Description
There is @opendir
code all over the place that is not standardized. On top of that, there is plenty of code that is duplicated and could be condensed into one handy function. Plus, in all of the places we are using opendir()
, we really want to be using scandir()
.
I have created a master function in load.php
called wp_scandir()
that does the basics:
- scans a directory for files / subdirectories
- filters list by extension(s)
- optionally returns ONLY files
This cleans up code in many places.
Attachments (1)
Change History (7)
Note: See
TracTickets for help on using
tickets.
Wouldn't glob() be more appropriate?