WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Featured Images
WordPress 3.5-style featured image box (3 posts)

  1. Marcus Downing
    Member
    Posted 1 year ago #

    WordPress 3.5 introduced a nice new interface for selecting featured images. It would be nice if this plugin used the same or similar interface.

    http://wordpress.org/extend/plugins/multiple-featured-images/

  2. grosbouff
    Member
    Posted 1 year ago #

    +1 !
    That would be great.
    I dig a little into the WP code and it's a mess for doing such a thing...
    Hope they'll clear the code for this !

  3. Mevludin
    Member
    Posted 1 year ago #

    I've done it, it's really easy to do. I have my own "slideshow" shortcode in post.php which almost exactly behaves like "gallery" shortcode. Here is a very simplified version of what you need to do.
    First you need to call a function which will include all the media for you(but since we are in posts, it's already been done). Either way, it's
    wp_enqueue_media();
    Then create the media frame.

    var function_which_handles_update = function (selection) {
     //do stuff with selection, look at wp.media.gallery and others for examples
    }
    var frame = wp.media({
    	id:         'my-frame',
    	frame:      'post',
    	state:      'insert',
    	editing:    true,
    	multiple:   false
    });
    frame.on( 'update', 'function_which_handles_update');
    //other "ons" exist such as: open, close, select...etc
    something.onclick = frame.open(); //pseudo

    Tutorials:
    https://github.com/thomasgriffin/New-Media-Image-Uploader
    http://shibashake.com/wordpress-theme/how-to-add-the-wordpress-3-5-media-manager-interface
    http://shibashake.com/wordpress-theme/how-to-add-the-wordpress-3-5-media-manager-interface-part-2

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.