[wp-hackers] Proposal: standardize plugin-data path
otto at ottodestruct.com
Fri Sep 26 13:35:20 GMT 2008
Pardon me, using wp_upload_dir() is a bad idea due to the year/month
thing. Use WP_CONTENT_DIR . '/uploads/your_plugin_name' instead.
On Fri, Sep 26, 2008 at 8:34 AM, Otto <otto at ottodestruct.com> wrote:
> Seems to me that the safest place to do this would be
> wp_upload_dir().'/your_plugin_name' . The upload directory doesn't
> have to be limited to uploaded files. The tinyMCE stuff already puts
> it's cached JS files there too.
> On Thu, Sep 25, 2008 at 4:58 PM, Stephen Rider
> <wp-hackers at striderweb.com> wrote:
>> Hi --
>> There are a number of plugins that themselves have user-changeable files.
>> I'm not talking about ones where you edit the file to set options, but
>> things like Spam Karma that have plugins of their own, or my own Pull-Quotes
>> plugin that allows you to customize the style files, or caching and backup
>> plugins that create files of their own.
>> We also now have an established auto-update system which, upon update, blows
>> away anything in a plugin's folder, including any files that may have been
>> added or changed.
>> I propose we establish an official location (changeable via CONSTANT of
>> course) for plugins to put their custom data that should _not_ be so easily
>> wiped out on update. The default we set could be as simple as
>> /wp-content/plugin-data. Thus myplugin would use
>> I know plugin authors can just set that directory to anything they like, but
>> I generally think it's a good idea to standardize such things. Makes things
>> a bit easier for plugin authors to establish an alternative location for
>> things if there's a set standard.
>> What say ye all?
>> P.S. -- This came up in the course of wanting to allow users of the
>> aforementioned pull-quotes plugin to set a custom directory for the
>> pull-quote styles. It would be great to have something like
>> WP_PLUGIN_DATA_DIR and WP_PLUGIN_DATA_URL, or even just WP_CONTENT_DIR .
>> Stephen Rider
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
More information about the wp-hackers