WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Terrabus
    Member
    Posted 8 months 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!

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

  2. peterhudec
    Member
    Plugin Author

    Posted 8 months ago #

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

  3. Terrabus
    Member
    Posted 8 months 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.

Reply

You must log in to post.

About this Plugin

About this Topic