Viewing 12 replies - 1 through 12 (of 12 total)
  • Hi,

    just a heads up. I had a problem with getting error;

    Uncaught TypeError: Cannot call method ‘on’ of undefined media-modal.js:28
    openFrame media-modal.js:28
    v.event.dispatch load-scripts.php:2
    o.handle.u load-scripts.php:2

    This was caused by not setting thumbnail support on the custom post type. As I didn’t want the regular ‘Featured image’ to show up, I activated the support and removed the ‘Featured image metabox’ using;

    // Remove unused metaboxes in admin
    function remove_metaboxes() {
      remove_meta_box( 'postimagediv', 'my_cpt', 'side' );
    }
    add_action( 'do_meta_boxes' , 'remove_metaboxes' );

    in functions.php.

    Could be a nice feature to check for support and include the related files if support is not set? Great plugin!

    Regards,
    Kristofer

    Hi,

    new version of your plugin is nice and it speeds up uploading. There is one suggestion – and I need this option- that uploader must default to “uploaded to this post” tab.

    Currently, with the help of an online available filter, I was able to default it to “upload file” but there is no option to select “Uploaded to this post”. It would be nice if you default it here.

    Thanks

    Hi Chris thanks for the original plugin and now the updated code!

    I have this working for a custom post type that has 3 featured images without issue.

    However I have two other custom post types in this theme that have only one featured image and I get an error in the firebug console when I try to set the image;

    TypeError: frame is undefined
    openFrame()media-...r=3.5.1 (line 28)
    e = Object { originalEvent=Event click, type="click", timeStamp=591203322
    
    , more...}
    a()load-s...r=3.5.1 (line 2)
    n = Object { originalEvent=Event click, type="click", timeStamp=591203322, more...}
    a()load-s...r=3.5.1 (line 2)
    e = click clientX=1654, clientY=420
    [Break On This Error] 	
    
    frame.on('select', function () {
    
    media-...r=3.5.1 (line 28)

    I have no idea why, this all worked well with the old version of your plugin for all post types.

    Any ideas?

    @gyroscopic – Check so thumbnail support is activated in the two non-working CPTs. Thumbnail support is apparently required for the new code.

    Hi KristoferN

    Thanks for the reply. I already have add_theme_support( ‘post-thumbnails’ ); at the start of my functions.php which should globaly add support to all post type etc and, as I said, this all worked fine with the previous version.

    However, I then added;

    'supports' => array(
    			'thumbnail',
                             ),

    to the custom post type registration and it suddenly works! Not sure why as the global declaration should do the job – but for some reason I need to declare support twice, globally and individually. Is this a wp bug or a problem with the plugin code?

    Also now I get the Featured Image meta box appearing which I dont want as I already have one from the multi-post-thumbnails code, and that one is correctly named etc!

    I have tried using remove_meta_box( ‘postimagediv’ , ‘my-custom-post-tpye’ , ‘side’); but nothing is removed.

    PS – Just to be clear, I have not and dont need to add the support thumbnail code to the CPT registration that has 3 featured images, this already works without alteration.

    Plugin Author Chris Scott

    (@chrisscott)

    This is now fixed on master. Media scripts are now enqueued so post types w/out ‘thumbnail’ support will now work. Download latest version.

    Thanks Chris!

    Many thanks Chris, will test it now.

    Is there going to be support for $post->ID reference at any point? so we can call the secondary image from anywhere ?

    Plugin Author Chris Scott

    (@chrisscott)

    @frumph both get_the_post_thumbnail and get_post_thumbnail_url support passing in the post ID so you can use them anywhere already.

    Plugin Author Chris Scott

    (@chrisscott)

    For anyone wanting to test the latest version which supports filtering and narrows attachments to only images, you can download it from github. Feedback appreciated.

    Plugin Author Chris Scott

    (@chrisscott)

    Version 1.6 is now live and uses the media modal with the above fixes incorporated.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Testers for version 1.6 needed (3.5 Media Modal)’ is closed to new replies.