0

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.

2

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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