Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am building a wordpress plugin that needs to allow the admin to upload CSS documents, and attach thumbnails.

I want to know if there are any methods within wordpress that would be useful in assisting me in building an admin page that allows upload and deletion of css documents and images.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

You can use the file uploader that come with Wordpress, using this guide to insert it in your meta-box:

http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/

You can create some custom fields and use it to upload thumbnails or CSS to your server.

share|improve this answer

Alternatively, you can treat your CSS uploads just like any other attachments and use the attachment manager for that. For instance, introduce a custom post type called 'Stylesheets' and replace the thumbnail image metabox with a more generic file upload metabox on those.

Then you have not only an uploader, but complete management of your stylesheets including metadata, and you can easily reference them via post records wherever you want to further process them.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.