Title: Requesting Hooks
Last modified: May 25, 2018

---

# Requesting Hooks

 *  Resolved [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/)
 * (@howdy_mcgee)
 * [8 years ago](https://wordpress.org/support/topic/requesting-hooks/)
 * Hello!
 * I was wondering if it would be possible to add in some hooks to modify the thumbnails
   generated by attachment ID.
 * Currently, I have a custom site where I’m using `intermediate_image_sizes` hook
   to tell WordPress to only create specific image sizes for specific post types–
   this pretty much prevents WordPress from creating sizes that it won’t need or
   use from the total of registered sizes per post type.
 * Currently, this plugin creates image sizes for all registered sizes. Would it
   be possible to add in hooks that would allow developers to modify the regenerated
   sizes?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [viper007bond](https://wordpress.org/support/users/viper007bond/)
 * (@viper007bond)
 * [8 years ago](https://wordpress.org/support/topic/requesting-hooks/#post-10327810)
 * A filter here should do what you need, right?
 * [https://github.com/Viper007Bond/regenerate-thumbnails/blob/v3.0.2/includes/class-regeneratethumbnails-regenerator.php#L359](https://github.com/Viper007Bond/regenerate-thumbnails/blob/v3.0.2/includes/class-regeneratethumbnails-regenerator.php#L359)
 *  Thread Starter [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/)
 * (@howdy_mcgee)
 * [8 years ago](https://wordpress.org/support/topic/requesting-hooks/#post-10327826)
 * [@viper007bond](https://wordpress.org/support/users/viper007bond/) I’m on mobile
   so it’s difficult to see the whole file. If the attachment ID is also available
   at that point then that would work. Given the attachment ID I can work out the
   parent post type and return sizes back to that filter 😀 !
 *  Thread Starter [Howdy_McGee](https://wordpress.org/support/users/howdy_mcgee/)
 * (@howdy_mcgee)
 * [8 years ago](https://wordpress.org/support/topic/requesting-hooks/#post-10329173)
 * After some testing it looks like that would work. Something like,
 * `return apply_filters( 'regenerate_thumbnails_sizes', $sizes, $fullsize_metadata,
   $this->attachment );`
 * The `$fullsize_metadata` probably isn’t necessary but I figure if you’re adding
   a hook there may as well pass it in. The above only gets run whenever the _skip_
   is checked. I’m currently going through to find the proper place for when it’s
   unchecked.
 *  Plugin Contributor [viper007bond](https://wordpress.org/support/users/viper007bond/)
 * (@viper007bond)
 * [8 years ago](https://wordpress.org/support/topic/requesting-hooks/#post-10368192)
 * It’ll be included in v3.1.0:
 * [https://github.com/Viper007Bond/regenerate-thumbnails/commit/97829a2611c27a94db4805d8ab3166b4783a389c](https://github.com/Viper007Bond/regenerate-thumbnails/commit/97829a2611c27a94db4805d8ab3166b4783a389c)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Requesting Hooks’ is closed to new replies.

 * ![](https://ps.w.org/regenerate-thumbnails/assets/icon-128x128.png?rev=1753390)
 * [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/regenerate-thumbnails/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/regenerate-thumbnails/)
 * [Active Topics](https://wordpress.org/support/plugin/regenerate-thumbnails/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/regenerate-thumbnails/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/regenerate-thumbnails/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [viper007bond](https://wordpress.org/support/users/viper007bond/)
 * Last activity: [8 years ago](https://wordpress.org/support/topic/requesting-hooks/#post-10368192)
 * Status: resolved