0

I've been using Tammy Hart's Reusable Custom MetaBox code for some time now but with the recent 3.8 update the media upload seems to be no longer functioning, and the code is no longer supported.

The console is highlighting this area as being Uncaught TypeError: Object #<Object> has no method 'media'. Which I assume has something to do with a change in how 3.8 handles the media uploader.

Reusable-Custom-WordPress-Meta-Boxes/metaboxes/js/scripts.js

imageFrame = wp.media({
                title: 'Choose Image',
                multiple: false,
                library: { type: 'image'},
                button: { text: 'Use This Image' }
});
  • 1
    Is it officially no longer supported? Original developer really is usual best bet to fix code up for newer WP version. – Rarst Dec 16 '13 at 14:39
  • The developer has stated "No longer supported - please fork to continue development on your own." – Picard102 Dec 16 '13 at 14:49
  • Shucks... Could you maybe provide snippet to easily reproduce the issue? People, unfamiliar with it, are unlikel to go figure it out and build it from scratch to test/confirm/troubleshoot your issue. – Rarst Dec 16 '13 at 14:57
2

I'm an idiot.

The reason the media uploader was not working, was because the post type I was using this on only had the title field set up in post type support. As such wp_enqueue_media() was not included as it normally would have been if the editor was included in post type supports.

To fix this I added

wp_enqueue_media();

to my cpt registration function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.