You’re already looking in the right places. (And nowadays WordPress already supports PDF thumbnails through ImageMagick – code.)
To add a new thumbnail generator, you’ll need to:
- write a new WP_Image_Editor class that supports the file type or types you want – you’ll want to extend the base class and override at least
- test()
- load()
- supports_mime_type() – to match the content types of the files you want to preview
- multi_resize() – this is the method called to generate thumbnails
- hook the wp_image_editors filter, and in the hook implementation include your editor class (if you haven’t already) and add the class name to the filtered list, with whatever priority you want.
Related Posts:
- Save image as featured image
- Add version query tag to all images
- Get thumbnails with array sizes parameter
- The URL of images on my website changed after being set as featured image
- Thumbnails for media Library images
- What’s the difference between term_id and term_taxonomy_id
- How are bulk actions handled in custom list table classes?
- How do I programatically insert a new menu item?
- When would I use either function for plugins?
- Test to see if jQuery or Prototype is queued by another plugin?
- Custom Nav Menu items default to ‘menu-item-type’ => ‘custom’. How to make a “page” menu item?
- How to tell if an option has been created vs an empty option?
- jQuery in header or footer
- Notice: _usort_terms_by_ID is deprecated since version 4.7.0! Use wp_list_sort instead
- How to add a new plugin page under desired Options page?
- Plugin screenshots not showing in the repository
- How to make WordPress use non-greedy shortcode parsing?
- Multiple Parameters for a Shortcode
- How to get current page name in my wordpress plugin
- WP Cron doesn’t save or in post body
- Use register_taxonomy() in register_activation_hook()
- Pages 404 in wordpress
- How to properly load text domain of custom mu plugin
- Post from front-end with post types, categories and taxonomies
- product-attribute-slug-is-too-long-28-characters-max
- Calling apply_filters on non-documented hooks
- Multiple entries in get_option results? or why is _multiwidget set to 1?
- Check if I am in the Admin Panel (wp-admin)?
- Fully automated theme install and activation via a plugin
- Using Ajax call in jQuery doesn’t work in widget
- Plugin activation error due to unexpected output
- How to store data for posts/pages built with drag-n-drop builder?
- WP rest api v2 posts filter by ‘search’ & ‘category_name’ not working
- WordPress Admin Post Type Table Class Filter Hook
- Order of Operation for these three hooks
- How to disable “Transform to” option in Gutenberg custom blocks
- save_post hook not triggered in WP v3.6.1
- How to get the ID of the currently logged in user?
- How to create a Tools menu on the Network Admin dashboard from a plugin
- Using a Shortcode to Replace Themes Stylesheet?
- Where should I put “run once” plugin pages?
- Initial help with official “create a block” tutorial
- Update/insert only a column of database table
- Can wp_list_comments output into variable?
- Plugin Development Output
- SMS registration and login [closed]
- How to modify product page for Jigoshop
- Adding Second Plugin Author
- Securing/Escaping Output of file content – reading via fread() in PHP
- Run code once when block is created
- Intermittent database errors when accessing WordPress database
- How to create a “View” page for entry in add_menu_page wordpress admin area (CRUD operation)
- what is the standard ulr for wordpress plugin development?
- Customize WooCommerce my account dashboard through plugin
- Precaching WordPress posts with a ServiceWorker
- Shortcode returning localized HTML part
- Create a custom capability to allow an ‘Editor’ to edit only ‘Subscriber’ users
- global $current_user not current user
- What is the proper way to get logged in user id in a plugin?
- Custom WordPress Plugin will install new and not update
- get_option() will not work without access to wp-config.php
- register_activation_hook on multisite
- Use ‘get’ form action within a WordPress plugin admin page
- Template directory in plugin
- WordPress Admin Login Custom Logo
- Ajax is not working in a loop
- Woocommerce order empty items array
- Bind a function with its own argument to show something dynamically after every content
- Plugin development – loading Javascript and Flash
- Drawing the line between theme & plugin on large scale bespoke projects
- HowTo to add my rewrite rules at the beginning, redirect to the right page and flush the rules on plugin activation?
- Apply styles to blockquote element with the WYSIWYG editor
- Update variable value via add_filter
- Do I need to create an endpoint?
- How to check whether checkbox is checked in WordPress customizer
- How to find list of all functions bind to a particular hook from my plugin?
- How to output CSS to the beginning of the stylesheet in a WordPress Plugin
- Set page to draft on plugin deactivation
- Can one plugin activate another plugin via script?
- Insert and read media from the WordPress library and call in the plugin
- How to create dynamic content with get_post_meta?
- Get value of custom checkbox from Gutenberg sidebar in plugin
- Enable a role named ‘backend_user’ to access my plugin pages
- Hiding class namespace from plugin’s extensions
- How to trigger WooCommerce user profile edit change?
- Return raw image proxy for wordpress plugin
- Stop unauthorised file access
- Changed media upload path for plugin, but generates error & shows wrong url
- How to pass a more variable with page/subpage in Wordprees URL?
- Use a page as a template for a custom post type
- Dynamic sidebar areas not working on the Theme Customizer
- Woo-commerce: Adding additional page sections using a child theme
- Plugin dev: How to multiply instances of a plugin in the same metabox?
- Merge Codes using redux framework
- How to get html tag ids from template?
- Getting Plugin to read all script files
- How to Prove Ownership of plugin [closed]
- get_term_by() returning null on plugin
- Elementor Top-Bar
- Is it possible to add Custom Dashboard Widgets to Custom Admin Menu Page?