Support » Plugin: Image Metadata Cruncher » Compatibility with plugin: Gravity Forms Custom Post Types

  • I’m getting some errors when uploading a image through a form with Gravity Forms + Custom Post Types. It’s giving me these warnings and not grabbing the info:
    Warning: array_change_key_case() expects parameter 1 to be array, null given in .../plugins/image-metadata-cruncher/image-metadata-cruncher.php on line 332

    It’s operating flawlessly through admin. So I’m thinking it could be that the other plugins aren’t implementing something properly? Any thoughts? Completely understand that you don’t support other’s plugins.

    I’m loving the plugin and I’d love to contribute if I can. Thanks!

    http://wordpress.org/plugins/image-metadata-cruncher/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author peterhudec

    (@peterhudec)

    Thanks for the info.
    I’ll take a look at it and let you know.

    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 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compatibility with plugin: Gravity Forms Custom Post Types’ is closed to new replies.