Version Description
Download this release
Release Info
Developer | chrisscott |
Plugin | Multiple Post Thumbnails |
Version | 1.6.1 |
Comparing to | |
See all releases |
Code changes from version 1.5 to 1.6.1
- js/media-modal.js +64 -0
- js/multi-post-thumbnails-admin.js +1 -1
- multi-post-thumbnails.php +62 -19
- readme.txt +12 -94
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
js/media-modal.js
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*global window,jQuery,wp */
|
2 |
+
var MediaModal = function (options) {
|
3 |
+
'use strict';
|
4 |
+
this.settings = {
|
5 |
+
calling_selector: false,
|
6 |
+
cb: function (attachment) {}
|
7 |
+
};
|
8 |
+
var that = this,
|
9 |
+
frame = wp.media.frames.file_frame;
|
10 |
+
|
11 |
+
this.attachEvents = function attachEvents() {
|
12 |
+
jQuery(this.settings.calling_selector).on('click', this.openFrame);
|
13 |
+
};
|
14 |
+
|
15 |
+
this.openFrame = function openFrame(e) {
|
16 |
+
e.preventDefault();
|
17 |
+
|
18 |
+
// Create the media frame.
|
19 |
+
frame = wp.media.frames.file_frame = wp.media({
|
20 |
+
title: jQuery(this).data('uploader_title'),
|
21 |
+
button: {
|
22 |
+
text: jQuery(this).data('uploader_button_text')
|
23 |
+
},
|
24 |
+
library : {
|
25 |
+
type : 'image'
|
26 |
+
}
|
27 |
+
});
|
28 |
+
|
29 |
+
// Set filterable state to uploaded to get select to show (setting this
|
30 |
+
// when creating the frame doesn't work)
|
31 |
+
frame.on('toolbar:create:select', function(){
|
32 |
+
frame.state().set('filterable', 'uploaded');
|
33 |
+
});
|
34 |
+
|
35 |
+
// When an image is selected, run the callback.
|
36 |
+
frame.on('select', function () {
|
37 |
+
// We set multiple to false so only get one image from the uploader
|
38 |
+
var attachment = frame.state().get('selection').first().toJSON();
|
39 |
+
that.settings.cb(attachment);
|
40 |
+
});
|
41 |
+
|
42 |
+
frame.on('open activate', function() {
|
43 |
+
// Get the link/button/etc that called us
|
44 |
+
var $caller = jQuery(that.settings.calling_selector);
|
45 |
+
|
46 |
+
// Select the thumbnail if we have one
|
47 |
+
if ($caller.data('thumbnail_id')) {
|
48 |
+
var Attachment = wp.media.model.Attachment;
|
49 |
+
var selection = frame.state().get('selection');
|
50 |
+
selection.add(Attachment.get($caller.data('thumbnail_id')));
|
51 |
+
}
|
52 |
+
});
|
53 |
+
|
54 |
+
frame.open();
|
55 |
+
};
|
56 |
+
|
57 |
+
this.init = function init() {
|
58 |
+
this.settings = jQuery.extend(this.settings, options);
|
59 |
+
this.attachEvents();
|
60 |
+
};
|
61 |
+
this.init();
|
62 |
+
|
63 |
+
return this;
|
64 |
+
};
|
js/multi-post-thumbnails-admin.js
CHANGED
@@ -27,7 +27,7 @@ window.MultiPostThumbnails = {
|
|
27 |
|
28 |
setAsThumbnail: function(thumb_id, id, post_type, nonce){
|
29 |
var $link = jQuery('a#' + post_type + '-' + id + '-thumbnail-' + thumb_id);
|
30 |
-
|
31 |
$link.text( setPostThumbnailL10n.saving );
|
32 |
jQuery.post(ajaxurl, {
|
33 |
action:'set-' + post_type + '-' + id + '-thumbnail', post_id: post_id, thumbnail_id: thumb_id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie)
|
27 |
|
28 |
setAsThumbnail: function(thumb_id, id, post_type, nonce){
|
29 |
var $link = jQuery('a#' + post_type + '-' + id + '-thumbnail-' + thumb_id);
|
30 |
+
$link.data('thumbnail_id', thumb_id);
|
31 |
$link.text( setPostThumbnailL10n.saving );
|
32 |
jQuery.post(ajaxurl, {
|
33 |
action:'set-' + post_type + '-' + id + '-thumbnail', post_id: post_id, thumbnail_id: thumb_id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie)
|
multi-post-thumbnails.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Multiple Post Thumbnails
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/multiple-post-thumbnails/
|
5 |
Description: Adds the ability to add multiple post thumbnails to a post type.
|
6 |
-
Version: 1.
|
7 |
Author: Chris Scott
|
8 |
Author URI: http://voceplatforms.com/
|
9 |
*/
|
@@ -54,6 +54,8 @@ if (!class_exists('MultiPostThumbnails')) {
|
|
54 |
* @return void
|
55 |
*/
|
56 |
public function register($args = array()) {
|
|
|
|
|
57 |
$defaults = array(
|
58 |
'label' => null,
|
59 |
'id' => null,
|
@@ -83,10 +85,12 @@ if (!class_exists('MultiPostThumbnails')) {
|
|
83 |
}
|
84 |
|
85 |
add_action('add_meta_boxes', array($this, 'add_metabox'));
|
86 |
-
|
|
|
|
|
87 |
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
88 |
-
add_action('
|
89 |
-
add_action('
|
90 |
add_action("wp_ajax_set-{$this->post_type}-{$this->id}-thumbnail", array($this, 'set_thumbnail'));
|
91 |
add_action('delete_attachment', array($this, 'action_delete_attachment'));
|
92 |
add_filter('is_protected_meta', array($this, 'filter_is_protected_meta'), 20, 2);
|
@@ -117,8 +121,9 @@ if (!class_exists('MultiPostThumbnails')) {
|
|
117 |
*/
|
118 |
public function thumbnail_meta_box() {
|
119 |
global $post;
|
|
|
120 |
$thumbnail_id = get_post_meta($post->ID, $this->get_meta_key(), true);
|
121 |
-
echo $this->post_thumbnail_html($thumbnail_id);
|
122 |
}
|
123 |
|
124 |
/**
|
@@ -165,16 +170,25 @@ if (!class_exists('MultiPostThumbnails')) {
|
|
165 |
* @return void
|
166 |
*/
|
167 |
public function enqueue_admin_scripts( $hook ) {
|
|
|
|
|
168 |
// only load on select pages
|
169 |
if ( ! in_array( $hook, array( 'post-new.php', 'post.php', 'media-upload-popup' ) ) )
|
170 |
return;
|
171 |
|
172 |
-
|
173 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
}
|
175 |
|
176 |
-
public function
|
177 |
-
|
|
|
178 |
}
|
179 |
|
180 |
/**
|
@@ -209,6 +223,13 @@ if (!class_exists('MultiPostThumbnails')) {
|
|
209 |
return $protected;
|
210 |
}
|
211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
private function plugins_url($relative_path, $plugin_path) {
|
213 |
$template_dir = get_template_directory();
|
214 |
|
@@ -342,15 +363,34 @@ if (!class_exists('MultiPostThumbnails')) {
|
|
342 |
* @return string HTML
|
343 |
*/
|
344 |
private function post_thumbnail_html($thumbnail_id = null) {
|
345 |
-
global $content_width, $_wp_additional_image_sizes, $post_ID;
|
346 |
-
|
347 |
-
|
348 |
-
$
|
349 |
-
|
350 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
351 |
$content = sprintf( $set_thumbnail_link, sprintf( esc_html__( "Set %s", 'multiple-post-thumbnails' ), $this->label ) );
|
352 |
|
353 |
-
|
354 |
if ($thumbnail_id && get_post($thumbnail_id)) {
|
355 |
$old_content_width = $content_width;
|
356 |
$content_width = 266;
|
@@ -359,14 +399,17 @@ if (!class_exists('MultiPostThumbnails')) {
|
|
359 |
else
|
360 |
$thumbnail_html = wp_get_attachment_image($thumbnail_id, "{$this->post_type}-{$this->id}-thumbnail");
|
361 |
if (!empty($thumbnail_html)) {
|
362 |
-
$ajax_nonce = wp_create_nonce("set_post_thumbnail-{$this->post_type}-{$this->id}-{$post_ID}");
|
363 |
$content = sprintf($set_thumbnail_link, $thumbnail_html);
|
364 |
$format_string = '<p class="hide-if-no-js"><a href="#" id="remove-%1$s-%2$s-thumbnail" onclick="MultiPostThumbnails.removeThumbnail(\'%2$s\', \'%1$s\', \'%4$s\');return false;">%3$s</a></p>';
|
365 |
$content .= sprintf( $format_string, $this->post_type, $this->id, sprintf( esc_html__( "Remove %s", 'multiple-post-thumbnails' ), $this->label ), $ajax_nonce );
|
366 |
}
|
367 |
$content_width = $old_content_width;
|
368 |
}
|
369 |
-
|
|
|
|
|
|
|
|
|
370 |
return $content;
|
371 |
}
|
372 |
|
@@ -416,5 +459,5 @@ if (!class_exists('MultiPostThumbnails')) {
|
|
416 |
}
|
417 |
|
418 |
if ( is_admin() )
|
419 |
-
load_plugin_textdomain( 'multiple-post-thumbnails', FALSE, '
|
420 |
}
|
3 |
Plugin Name: Multiple Post Thumbnails
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/multiple-post-thumbnails/
|
5 |
Description: Adds the ability to add multiple post thumbnails to a post type.
|
6 |
+
Version: 1.6.1
|
7 |
Author: Chris Scott
|
8 |
Author URI: http://voceplatforms.com/
|
9 |
*/
|
54 |
* @return void
|
55 |
*/
|
56 |
public function register($args = array()) {
|
57 |
+
global $wp_version;
|
58 |
+
|
59 |
$defaults = array(
|
60 |
'label' => null,
|
61 |
'id' => null,
|
85 |
}
|
86 |
|
87 |
add_action('add_meta_boxes', array($this, 'add_metabox'));
|
88 |
+
if (version_compare($wp_version, '3.5', '<')) {
|
89 |
+
add_filter('attachment_fields_to_edit', array($this, 'add_attachment_field'), 20, 2);
|
90 |
+
}
|
91 |
add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'));
|
92 |
+
add_action('admin_print_scripts-post.php', array($this, 'admin_header_scripts'));
|
93 |
+
add_action('admin_print_scripts-post-new.php', array($this, 'admin_header_scripts'));
|
94 |
add_action("wp_ajax_set-{$this->post_type}-{$this->id}-thumbnail", array($this, 'set_thumbnail'));
|
95 |
add_action('delete_attachment', array($this, 'action_delete_attachment'));
|
96 |
add_filter('is_protected_meta', array($this, 'filter_is_protected_meta'), 20, 2);
|
121 |
*/
|
122 |
public function thumbnail_meta_box() {
|
123 |
global $post;
|
124 |
+
|
125 |
$thumbnail_id = get_post_meta($post->ID, $this->get_meta_key(), true);
|
126 |
+
echo $this->post_thumbnail_html($thumbnail_id);
|
127 |
}
|
128 |
|
129 |
/**
|
170 |
* @return void
|
171 |
*/
|
172 |
public function enqueue_admin_scripts( $hook ) {
|
173 |
+
global $wp_version;
|
174 |
+
|
175 |
// only load on select pages
|
176 |
if ( ! in_array( $hook, array( 'post-new.php', 'post.php', 'media-upload-popup' ) ) )
|
177 |
return;
|
178 |
|
179 |
+
if (version_compare($wp_version, '3.5', '<')) {
|
180 |
+
add_thickbox();
|
181 |
+
wp_enqueue_script( "mpt-featured-image", $this->plugins_url( 'js/multi-post-thumbnails-admin.js', __FILE__ ), array( 'jquery', 'media-upload' ) );
|
182 |
+
} else { // 3.5+ media modal
|
183 |
+
wp_enqueue_media();
|
184 |
+
wp_enqueue_script( "mpt-featured-image", $this->plugins_url( 'js/multi-post-thumbnails-admin.js', __FILE__ ), array( 'jquery', 'set-post-thumbnail' ) );
|
185 |
+
wp_enqueue_script( "mpt-featured-image-modal", $this->plugins_url( 'js/media-modal.js', __FILE__ ), array( 'jquery', 'media-models' ) );
|
186 |
+
}
|
187 |
}
|
188 |
|
189 |
+
public function admin_header_scripts() {
|
190 |
+
$post_id = get_the_ID();
|
191 |
+
echo "<script>var post_id = $post_id;</script>";
|
192 |
}
|
193 |
|
194 |
/**
|
223 |
return $protected;
|
224 |
}
|
225 |
|
226 |
+
/**
|
227 |
+
* allow the plugin to be in the plugins directory or the theme directory
|
228 |
+
*
|
229 |
+
* @param string $relative_path Relative file path to the plugin file to get the URL of
|
230 |
+
* @param string $plugin_path Absolute file path to the plugin base directory
|
231 |
+
* @return string the URL of the plugin file
|
232 |
+
*/
|
233 |
private function plugins_url($relative_path, $plugin_path) {
|
234 |
$template_dir = get_template_directory();
|
235 |
|
363 |
* @return string HTML
|
364 |
*/
|
365 |
private function post_thumbnail_html($thumbnail_id = null) {
|
366 |
+
global $content_width, $_wp_additional_image_sizes, $post_ID, $wp_version;
|
367 |
+
|
368 |
+
$url_class = "";
|
369 |
+
$ajax_nonce = wp_create_nonce("set_post_thumbnail-{$this->post_type}-{$this->id}-{$post_ID}");
|
370 |
+
|
371 |
+
if (version_compare($wp_version, '3.5', '<')) {
|
372 |
+
// Use the old thickbox for versions prior to 3.5
|
373 |
+
$image_library_url = get_upload_iframe_src('image');
|
374 |
+
// if TB_iframe is not moved to end of query string, thickbox will remove all query args after it.
|
375 |
+
$image_library_url = add_query_arg( array( 'context' => $this->id, 'TB_iframe' => 1 ), remove_query_arg( 'TB_iframe', $image_library_url ) );
|
376 |
+
$url_class = "thickbox";
|
377 |
+
} else {
|
378 |
+
// Use the media modal for 3.5 and up
|
379 |
+
$image_library_url = "#";
|
380 |
+
$modal_js = sprintf(
|
381 |
+
'var mm_%3$s = new MediaModal({
|
382 |
+
calling_selector : "#set-%1$s-%2$s-thumbnail",
|
383 |
+
cb : function(attachment){
|
384 |
+
MultiPostThumbnails.setAsThumbnail(attachment.id, "%2$s", "%1$s", "%4$s");
|
385 |
+
}
|
386 |
+
});',
|
387 |
+
$this->post_type, $this->id, md5($this->id), $ajax_nonce
|
388 |
+
);
|
389 |
+
}
|
390 |
+
$format_string = '<p class="hide-if-no-js"><a title="%1$s" href="%2$s" id="set-%3$s-%4$s-thumbnail" class="%5$s" data-thumbnail_id="%7$s" data-uploader_title="%1$s" data-uploader_button_text="%1$s">%%s</a></p>';
|
391 |
+
$set_thumbnail_link = sprintf( $format_string, sprintf( esc_attr__( "Set %s" , 'multiple-post-thumbnails' ), $this->label ), $image_library_url, $this->post_type, $this->id, $url_class, $this->label, $thumbnail_id );
|
392 |
$content = sprintf( $set_thumbnail_link, sprintf( esc_html__( "Set %s", 'multiple-post-thumbnails' ), $this->label ) );
|
393 |
|
|
|
394 |
if ($thumbnail_id && get_post($thumbnail_id)) {
|
395 |
$old_content_width = $content_width;
|
396 |
$content_width = 266;
|
399 |
else
|
400 |
$thumbnail_html = wp_get_attachment_image($thumbnail_id, "{$this->post_type}-{$this->id}-thumbnail");
|
401 |
if (!empty($thumbnail_html)) {
|
|
|
402 |
$content = sprintf($set_thumbnail_link, $thumbnail_html);
|
403 |
$format_string = '<p class="hide-if-no-js"><a href="#" id="remove-%1$s-%2$s-thumbnail" onclick="MultiPostThumbnails.removeThumbnail(\'%2$s\', \'%1$s\', \'%4$s\');return false;">%3$s</a></p>';
|
404 |
$content .= sprintf( $format_string, $this->post_type, $this->id, sprintf( esc_html__( "Remove %s", 'multiple-post-thumbnails' ), $this->label ), $ajax_nonce );
|
405 |
}
|
406 |
$content_width = $old_content_width;
|
407 |
}
|
408 |
+
|
409 |
+
if (version_compare($wp_version, '3.5', '>=')) {
|
410 |
+
$content .= sprintf('<script>%s</script>', $modal_js);
|
411 |
+
}
|
412 |
+
|
413 |
return $content;
|
414 |
}
|
415 |
|
459 |
}
|
460 |
|
461 |
if ( is_admin() )
|
462 |
+
load_plugin_textdomain( 'multiple-post-thumbnails', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
|
463 |
}
|
readme.txt
CHANGED
@@ -2,119 +2,37 @@
|
|
2 |
Contributors: chrisscott, voceplatforms
|
3 |
Tags: thumbnails, image, featured image
|
4 |
Requires at least: 2.9.2
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 1.
|
|
|
|
|
7 |
|
8 |
Adds multiple post thumbnails to a post type. If you've ever wanted more than one Featured Image on a post, this plugin is for you.
|
9 |
|
10 |
== Installation ==
|
11 |
|
12 |
-
|
13 |
-
2. Activate the plugin through the 'Plugins' menu in WordPress
|
14 |
-
3. In your theme's `functions.php` register a new thumbnail for the post type you want it active for. If `post_type` is not set it defaults to `post`.
|
15 |
-
|
16 |
-
if (class_exists('MultiPostThumbnails')) {
|
17 |
-
new MultiPostThumbnails(
|
18 |
-
array(
|
19 |
-
'label' => 'Secondary Image',
|
20 |
-
'id' => 'secondary-image',
|
21 |
-
'post_type' => 'post'
|
22 |
-
)
|
23 |
-
);
|
24 |
-
}
|
25 |
-
4. Display the thumbnail in your theme. e.g. for loop templates (outside of the loop, the first argument to `MultiPostThumbnails::the_post_thumbnail()` will need to be the post type):
|
26 |
-
|
27 |
-
<?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image'); endif; ?>
|
28 |
|
29 |
== Frequently Asked Questions ==
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
This is caused by using the example in previous readmes that didn't do a check for the `MultiPostThumbnails` class existing first. This has been corrected in the Installation section.
|
34 |
-
|
35 |
-
= How do I register the same thumbnail for multiple post types? =
|
36 |
-
|
37 |
-
You can loop through an array of the post types:
|
38 |
-
|
39 |
-
if (class_exists('MultiPostThumbnails')) {
|
40 |
-
$types = array('post', 'page', 'my_post_type');
|
41 |
-
foreach($types as $type) {
|
42 |
-
new MultiPostThumbnails(array(
|
43 |
-
'label' => 'Secondary Image',
|
44 |
-
'id' => 'secondary-image',
|
45 |
-
'post_type' => $type
|
46 |
-
)
|
47 |
-
);
|
48 |
-
}
|
49 |
-
}
|
50 |
-
|
51 |
-
= How do I use a custom thumbnail size in my theme? =
|
52 |
-
|
53 |
-
After you have registered a new post thumbnail, register a new image size for it. e.g if your post thumbnail `id` is `secondary-image` and it is for a `post`, it probably makes sense to use something like:
|
54 |
-
|
55 |
-
add_image_size('post-secondary-image-thumbnail', 250, 150);
|
56 |
-
|
57 |
-
This will register a new image size of 250x150 px. Then, when you display the thumbnail in your theme, update the call to `MultiPostThumbnails::the_post_thumbnail()` to pass in the image size:
|
58 |
-
|
59 |
-
MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'secondary-image', NULL, 'post-secondary-image-thumbnail');
|
60 |
-
|
61 |
-
You can register multiple image sizes for a given thumbnail if desired.
|
62 |
-
|
63 |
-
= How can I get the thumbnail without automatically echoing it? =
|
64 |
-
|
65 |
-
Use `MultiPostThumbnails::get_the_post_thumbnail()` in place of `MultiPostThumbnails::the_post_thumbnail()`.
|
66 |
-
|
67 |
-
= How do I get just the URL of a thumbnail without the wrapping HTML? =
|
68 |
|
69 |
-
|
70 |
|
71 |
-
|
72 |
-
* `$id` - the ID used to register the thumbnail (not the post ID)
|
73 |
-
* `$post_id` - optional and only needs to be passed in when outside the loop but should be passed in if available when called
|
74 |
-
|
75 |
-
For example, for a thumbnail registered with an `id` of `secondary-image` and `post_type` of `post` the following would retrieve the thumbnail URL:
|
76 |
-
|
77 |
-
MultiPostThumbnails::get_post_thumbnail_url(get_post_type(), 'secondary-image');
|
78 |
-
|
79 |
-
= When I use the sample code the thumbnail doesn't show up. What's wrong? =
|
80 |
-
|
81 |
-
* Make sure you are using the same ID you registered the thumbnail with as the second argument to `MultiPostThumbnails::the_post_thumbnail()`.
|
82 |
-
* If you are trying to get the thumbnail outside of the loop or a single template, you will need to replace `get_post_type()` with the post type you are trying to get the thumbnail for. This is common when trying to use the code in headers/footers/sidebars.
|
83 |
-
|
84 |
-
= I see the meta box in the admin when editing a post but when I click on 'Set as [label] image' in the media manager, nothing happens and I get a JavaScript console error =
|
85 |
-
|
86 |
-
If you are using a symlink to include the plugin directory in your project, the admin js file will not load and cause this. Unfortunately, the solution is to not use symlinks due to the behavior of PHP's `__FILE__`
|
87 |
-
|
88 |
-
= Is there a way to show the post meta where the thumbnail IDs are stored in the Custom Fields metabox?
|
89 |
-
|
90 |
-
Since version 1.5 these are hidden by default. To unhide them, add `add_filter('mpt_unprotect_meta', '__return_true');` to your theme's `functions.php`
|
91 |
-
|
92 |
-
= Is there a github repo? I love me some submodules! =
|
93 |
-
|
94 |
-
Yes. https://github.com/voceconnect/multi-post-thumbnails
|
95 |
-
|
96 |
-
= Pancakes or waffles? =
|
97 |
-
|
98 |
-
Pancakes.
|
99 |
|
100 |
== Screenshots ==
|
101 |
|
102 |
1. Admin meta box showing a new thumbnail named 'Secondary Image'.
|
103 |
-
2. Media
|
104 |
3. Admin meta box with the 'Secondary Image' selected.
|
105 |
|
106 |
== Changelog ==
|
107 |
|
108 |
-
|
109 |
-
|
110 |
-
* Add a `size` parameter to `MultiPostThumbnails::get_post_thumbnail_url` to allow getting any registered size.
|
111 |
-
* Add `context` option to the args accepted when instantiating a new `MultiPostThumbnails` to specify the metabox context. Defaults to `side` (which it was previously hard coded to).
|
112 |
-
* Filter `is_protected_meta` to hide meta from the Custom Fields metabox by default (props willroy). To unhide them, add `add_filter('mpt_unprotect_meta', '__return_true');` to your theme's `functions.php`.
|
113 |
-
* il8n courtesy Horttcore
|
114 |
-
|
115 |
-
= 1.4 =
|
116 |
|
117 |
-
|
118 |
|
119 |
= 1.3 =
|
120 |
|
2 |
Contributors: chrisscott, voceplatforms
|
3 |
Tags: thumbnails, image, featured image
|
4 |
Requires at least: 2.9.2
|
5 |
+
Tested up to: 3.9.1
|
6 |
+
Stable tag: 1.6.1
|
7 |
+
License: GPLv2 or later
|
8 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
|
10 |
Adds multiple post thumbnails to a post type. If you've ever wanted more than one Featured Image on a post, this plugin is for you.
|
11 |
|
12 |
== Installation ==
|
13 |
|
14 |
+
Please refer to full documentation at https://github.com/voceconnect/multi-post-thumbnails/wiki
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
== Frequently Asked Questions ==
|
17 |
|
18 |
+
If you have any issues with this plugin, please log them at the Github repo for this plugin.
|
19 |
+
This is done to centralize our issues and make sure nothing goes unnoticed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
The URL to log an issue is https://github.com/voceconnect/multi-post-thumbnails/issues
|
22 |
|
23 |
+
See Frequently Asked Questions at https://github.com/voceconnect/multi-post-thumbnails/wiki/Frequently-Asked-Questions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
== Screenshots ==
|
26 |
|
27 |
1. Admin meta box showing a new thumbnail named 'Secondary Image'.
|
28 |
+
2. Media modal showing images attached to the post and a 'Secondary Image' selected.
|
29 |
3. Admin meta box with the 'Secondary Image' selected.
|
30 |
|
31 |
== Changelog ==
|
32 |
|
33 |
+
After version 1.3, releases were tracked in github: https://github.com/voceconnect/multi-post-thumbnails/releases
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
+
Historical releases are below:
|
36 |
|
37 |
= 1.3 =
|
38 |
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|