Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

stonystratfordwoody on "Extending the Insert Media Dialog for a Custom File Type"

$
0
0

When you want to add an image to a post the process is:
1. Click "Add Media".
2. Select or upload an image.
3. Choose from the attachment display options.
4. Click insert image.
5. Some custom HTML is added to the post.

This is exactly what I want to do but for a custom file type. 1 and 2 are fine (I have registered the custom mime type in functions.php). My questions are:

1. How do I extend the Insert Media dialog with options for my file type? I need to add a field called pagetype which takes the values 1D, 2D or 3D.

2. How do I change the HTML which is added to the post based on the file type selected?

I have read through media-template.php and media.php and found some posts about extending the dialog to support different image sizes, but nothing extra elements for a custom filetype.

Here is a Jing in case the above is not clear: http://screencast.com/t/0TZycT0gkTi

Any help would be very welcome.

Simon


Viewing all articles
Browse latest Browse all 8245

Trending Articles