Title: Replace image selection for custom posts
Last modified: April 3, 2020

---

# Replace image selection for custom posts

 *  Resolved [jeppe](https://wordpress.org/support/users/jeppeskovsgaard/)
 * (@jeppeskovsgaard)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/replace-image-selection-for-custom-posts/)
 * This probably isn’t related to ACF, but since your plugin is awesome, and I use
   it for everything except custom posts (including WooCommerce products) I’ll leave
   this request here.
 * I would love to be able to add cropping functionality for all custom post types
   including WooCommerce products. You could say, that I could just add an ACF image
   crop field to all posts and hide the standard image feature. If I do so however,
   I’ll miss out on all native image functionality and compatibility with other 
   plugins using the standard image feature.
 * Is there a way to add your image cropping field to all posts, which handles the
   cropping as a middleman, and then passes it on to the native WordPress image 
   functions (or however that works), so that I could still take advantage of native
   functions like get_the_post_thumbnail etc.?
    -  This topic was modified 6 years, 1 month ago by [jeppe](https://wordpress.org/support/users/jeppeskovsgaard/).

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

 *  Plugin Author [joppuyo](https://wordpress.org/support/users/joppuyo/)
 * (@joppuyo)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/replace-image-selection-for-custom-posts/#post-12639659)
 * Hey, I agree it would be useful if you could use this plugin with the standard
   featured image field but it’s unfortunately out of scope for this plugin.
 * If you want to do it on theme level you could try the code I’ve posted [here](https://wordpress.org/support/topic/cant-find-image-cropped-from-article-to-use-it-featured/#post-11964873).
 * Here’s the snippet:
 *     ```
       add_action('acf/save_post', function ($post_id) {
           $value = get_field('my_crop_image_field', $post_id);
           if ($value) {
               if (!is_numeric($value)) {
                   $value = $value['ID'];
               }
               update_post_meta($post_id, '_thumbnail_id', $value);
           } else {
               delete_post_meta($post_id, '_thumbnail_id');
           }
       }, 11);
       ```
   
 *  Thread Starter [jeppe](https://wordpress.org/support/users/jeppeskovsgaard/)
 * (@jeppeskovsgaard)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/replace-image-selection-for-custom-posts/#post-12644564)
 * Thanks a lot! This works like a charm!
    -  This reply was modified 6 years, 1 month ago by [jeppe](https://wordpress.org/support/users/jeppeskovsgaard/).

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

The topic ‘Replace image selection for custom posts’ is closed to new replies.

 * ![](https://ps.w.org/acf-image-aspect-ratio-crop/assets/icon-256x256.png?rev=
   1908145)
 * [Advanced Custom Fields: Image Aspect Ratio Crop Field](https://wordpress.org/plugins/acf-image-aspect-ratio-crop/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/acf-image-aspect-ratio-crop/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/acf-image-aspect-ratio-crop/)
 * [Active Topics](https://wordpress.org/support/plugin/acf-image-aspect-ratio-crop/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/acf-image-aspect-ratio-crop/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/acf-image-aspect-ratio-crop/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [jeppe](https://wordpress.org/support/users/jeppeskovsgaard/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/replace-image-selection-for-custom-posts/#post-12644564)
 * Status: resolved