Image Metadata Cruncher
Compatibility with plugin: Gravity Forms + Custom Post Types (3 posts)

  1. Terrabus
    Posted 2 years ago #

    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!


  2. peterhudec
    Plugin Author

    Posted 2 years ago #

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

  3. Terrabus
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Image Metadata Cruncher
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic