[wp-trac] [WordPress Trac] #44083: Add action to wp_mkdir_p() when directory is created successfully

WordPress Trac noreply at wordpress.org
Tue May 15 00:14:25 UTC 2018


#44083: Add action to wp_mkdir_p() when directory is created successfully
----------------------------------------+------------------------------
 Reporter:  johnjamesjacoby             |       Owner:  (none)
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  Filesystem API              |     Version:  2.0.1
 Severity:  normal                      |  Resolution:
 Keywords:  needs-patch good-first-bug  |     Focuses:
----------------------------------------+------------------------------
Description changed by johnjamesjacoby:

Old description:

> It would be nice if the `wp_mkdir_p()` function contained a hook for
> plugins to interact with when a directory gets created.
>
> The use-case I have currently is that some plugins (like Easy Digital
> Downloads, for example) create `.htaccess` files and empty `index.php`
> files in its own `uploads/edd` directory, as one way of protecting those
> empty directories from being publicly browsable.
>
> Because there is no action hook here, EDD uses a daily transient, which
> leaves new directories potentially open until the transient expires.

New description:

 It would be nice if the `wp_mkdir_p()` function contained a hook for
 plugins to interact with when a directory gets created.

 The use-case I have currently is that Easy Digital Downloads (for example)
 creates `.htaccess` files and empty `index.php` files in its own
 `uploads/edd` directory, and each directory inside it, as one way of
 protecting those empty directories from being publicly browsable.

 Because there is no action hook here, EDD uses a daily transient, which
 leaves new directories potentially open until the transient expires.

 An action hook on directory creation would allow for EDD to create those
 files immediately.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44083#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list