Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter Terrabus

    (@terrabus)

    Thanks Peter. For now I’ve commented out the WordPress hooks in the __construct function to stop the automagic extraction. Instead, the extraction is done in the ‘wp_insert_post’ hook in functions.php:

    function extract_image_metadata($post_id) {
        global $image_metadata_cruncher;
    
        // Only extract when post type 'photo' is saved
        if (get_post_type($post_id) == 'photo') {
            $featured_id = get_post_thumbnail_id($post_id);
            if ($featured_id !== '') $image_metadata_cruncher->crunch($featured_id);
        }
    }
    add_action( 'wp_insert_post', 'extract_image_metadata', 10, 2);

    The above solves my problem. Again, I love the plugin. Hope this helps someone.

Viewing 1 replies (of 1 total)