'media_send_to_editor
works fine in WordPress 3.5. I did not test the above code but you don’t need to preg_match
for .pdf when WordPress supports post_mime_type == 'application/pdf;
This should work better: https://gist.github.com/2176359
Just change the HTML parameters to your needs. I also advise to embed it directly as an <iframe>
, native .pdf iframe browser support is better than sending it through docs.google.com.
Related Posts:
- Extra Alignment buttons on media uploader screen
- Moving media files outside of the site directory
- How to delete resized (cropped) image uploads and prevent future resizing?
- Adding more options to the instance of an image. (Attachment Display Settings)
- How can I change Max Embed Size in WordPress 3.5?
- Best approach when modifying the Media Manager
- Different upload directory based on post type in a theme
- Modifying the media-template.php file, the right way?
- Allowing for multiple template views on the Gallery Settings page when using the Visual Editor
- Add control in image detail panel
- Change default tab of media manager
- Post type specific upload folder in 3.5
- Why are image thumbnails cropped proportionally (not per dimensions)?
- Audio Playlist : How to bind events for “track change”, “track end”?
- How do I control video media display sizing with native wordpress player
- Why “Store uploads in this folder” option is not showing in Media Settings in WordPress
- custom image size with New Media Manager in wordpress 3.5
- Why are image thumbnails cropped proportionally (not per dimensions)?
- How to set CORS header?
- Altered media sizes (in dash), not updating to existing images/posts
- wp.media add context
- Resize the WP media Uploader iFrame
- Can I stop wordpress generating media sizes
- Add Small Image Size to Media Settings
- How to add values to media “whitelist_options” in wp-admin/options.php template?
- Display attachments by the ID of the post being edited in the wp.media frame (frontend)
- Suggested image dimensions Gutenberg Hook
- Alter image meta fields in the Media Library
- Media Manager (since 3.5): How to show an empty Media Library when creating a media frame?
- How to add custom meta box under Gallery Settings in the “Edit Gallery” popup
- One step picture upload
- media resize/crop possibilities?
- Is it a good practice to change media settings on theme activation?
- WordPress returns old thumbnail size after changing media settings
- Recommended Media Size for Twenty Fourteen
- How to change format of file link ( Name ) when insert from media uploder
- Thumbnail images chopped off but not cropped to exact dimensions
- Set different max upload size limits based on file type/extension
- WordPress not creating “large” thumbnails
- How to re-house images in uploads/YYYY/MM
- Custom default settings for WP native Gallery Block
- Efficient way to move media folder to another folder
- WordPress append -1 to the image name
- Can’t upload format files on media library
- Attaching more than 1 parent (Post) to a media file
- How to display the maximum upload size in a WordPress single site?
- Post images are not displayed in media library
- How to resize image in wordpress from backend? Seems like bug in wordpress
- How to create different media uploader frames / filter library depending on a custom action
- How to store and retrieve the attachment alignment?
- Extract video content from post to display on front page
- wordpress 3.6 media manager cropping timestamp
- Plugin or script to apply updated media settings to all featured images
- Media Manager 3.5 custom options
- How i can upload images to another folder?
- WP is showing wrong image dimensions
- Changing upload directory and migrating old attachments