wp-shortcake / shortcake-bakery

A fine selection of shortcodes for WordPress
42 stars 16 forks source link

Add UI for selecting locally uploaded PDF attachment #205

Closed goldenapples closed 7 years ago

goldenapples commented 7 years ago

Adds an attachment field to the PDF shortcode UI, which allows uploading a local attachment or selecting from already uploaded PDF attachments.

Adds a new option to the "type" dropdown in the media library for "application/pdf" documents.

See #192

goldenapples commented 7 years ago

I think unless we could hook into the insertion to place a shortcode instead of PDF link, maybe we should consider leaving the filter out at this point.

Well, the filter on post_mime_types was only there so that I could have our attachment picker in the shortcode UI pull up a view with only PDFs - since I couldn't figure out a way to add a mime type filter for the media frame in Shortcake without adding it globally.

But you bring up a good point. I added a filter on media_send_to_editor, so that any PDFs added through this method get inserted as the [pdf] shortcode, rather than the link which WP sends by default.

davisshaver commented 7 years ago

Sweet! This is a nice addition.