Multiple Post Thumbnails - Version 1.7

Version Description

Download this release

Release Info

Developer chrisscott
Plugin Icon wp plugin Multiple Post Thumbnails
Version 1.7
Comparing to
See all releases

Code changes from version 1.6.5 to 1.7

languages/multiple-post-thumbnails-pt_BR.mo ADDED
Binary file
languages/multiple-post-thumbnails-pt_BR.po ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Multiple Post Thumbnails v1.3\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2015-11-05 11:39-0300\n"
7
+ "Last-Translator: Rodrigo Primo <rodrigo@hacklab.com.br>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-SourceCharset: UTF-8\n"
14
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
15
+ "X-Poedit-Basepath: ../\n"
16
+ "X-Textdomain-Support: yes\n"
17
+ "Language: pt_BR\n"
18
+ "X-Generator: Poedit 1.7.5\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ # @ multiple-post-thumbnails
22
+ #: multi-post-thumbnails.php:72
23
+ #, php-format
24
+ msgid "The 'label' and 'id' values of the 'args' parameter of '%s::%s()' are required"
25
+ msgstr "Os valores 'label' e 'id' do parâmetro 'args' do '%s::%s()' são obrigatórios"
26
+
27
+ # @ multiple-post-thumbnails
28
+ #: multi-post-thumbnails.php:133
29
+ #, php-format
30
+ msgid "Set as %3$s"
31
+ msgstr "Definir como %3$s"
32
+
33
+ # @ multiple-post-thumbnails
34
+ #: multi-post-thumbnails.php:293
35
+ #, php-format
36
+ msgid "Set %s"
37
+ msgstr "Definir %s"
38
+
39
+ # @ multiple-post-thumbnails
40
+ #: multi-post-thumbnails.php:410
41
+ #, php-format
42
+ msgid "Remove %s"
43
+ msgstr "Remover %s"
multi-post-thumbnails.php CHANGED
@@ -3,12 +3,12 @@
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.5
7
  Author: Chris Scott
8
- Author URI: http://voceplatforms.com/
9
  */
10
 
11
- /* Copyright 2010 Chris Scott (cscott@voceconnect.com)
12
 
13
  This program is free software; you can redistribute it and/or modify
14
  it under the terms of the GNU General Public License, version 2, as
@@ -29,6 +29,14 @@ if (!class_exists('MultiPostThumbnails')) {
29
 
30
  class MultiPostThumbnails {
31
 
 
 
 
 
 
 
 
 
32
  public function __construct($args = array()) {
33
  $this->register($args);
34
  }
@@ -170,6 +178,10 @@ if (!class_exists('MultiPostThumbnails')) {
170
  * @return void
171
  */
172
  public function enqueue_admin_scripts( $hook ) {
 
 
 
 
173
  global $wp_version, $post_ID;
174
 
175
  // only load on select pages
@@ -186,6 +198,8 @@ if (!class_exists('MultiPostThumbnails')) {
186
  }
187
 
188
  wp_enqueue_style( "mpt-admin-css", $this->plugins_url( 'css/multi-post-thumbnails-admin.css', __FILE__ ) );
 
 
189
  }
190
 
191
  public function admin_header_scripts() {
@@ -233,14 +247,15 @@ if (!class_exists('MultiPostThumbnails')) {
233
  * @return string the URL of the plugin file
234
  */
235
  private function plugins_url($relative_path, $plugin_path) {
236
- $template_dir = get_template_directory();
237
 
238
  foreach ( array('template_dir', 'plugin_path') as $var ) {
239
  $$var = str_replace('\\' ,'/', $$var); // sanitize for Win32 installs
240
  $$var = preg_replace('|/+|', '/', $$var);
241
  }
 
242
  if(0 === strpos($plugin_path, $template_dir)) {
243
- $url = get_template_directory_uri();
244
  $folder = str_replace($template_dir, '', dirname($plugin_path));
245
  if ( '.' != $folder ) {
246
  $url .= '/' . ltrim($folder, '/');
@@ -390,7 +405,7 @@ if (!class_exists('MultiPostThumbnails')) {
390
  );
391
  }
392
  $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>';
393
- $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 );
394
  $content = sprintf( $set_thumbnail_link, sprintf( esc_html__( "Set %s", 'multiple-post-thumbnails' ), $this->label ) );
395
 
396
  if ($thumbnail_id && get_post($thumbnail_id)) {
@@ -464,6 +479,11 @@ if (!class_exists('MultiPostThumbnails')) {
464
 
465
  }
466
 
467
- if ( is_admin() )
468
- load_plugin_textdomain( 'multiple-post-thumbnails', FALSE, basename( dirname( __FILE__ ) ) . '/languages/' );
 
 
 
 
 
469
  }
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
7
  Author: Chris Scott
8
+ Author URI: http://iamzed.com/
9
  */
10
 
11
+ /* Copyright 2010 Chris Scott (chris@iamzed.com)
12
 
13
  This program is free software; you can redistribute it and/or modify
14
  it under the terms of the GNU General Public License, version 2, as
29
 
30
  class MultiPostThumbnails {
31
 
32
+ /**
33
+ * Records if the scripts and styles have been enqueued so that we only
34
+ * do so once.
35
+ *
36
+ * @var boolean
37
+ */
38
+ protected static $statics_enqueued = false;
39
+
40
  public function __construct($args = array()) {
41
  $this->register($args);
42
  }
178
  * @return void
179
  */
180
  public function enqueue_admin_scripts( $hook ) {
181
+ if ( self::$statics_enqueued ) {
182
+ return;
183
+ }
184
+
185
  global $wp_version, $post_ID;
186
 
187
  // only load on select pages
198
  }
199
 
200
  wp_enqueue_style( "mpt-admin-css", $this->plugins_url( 'css/multi-post-thumbnails-admin.css', __FILE__ ) );
201
+
202
+ self::$statics_enqueued = true;
203
  }
204
 
205
  public function admin_header_scripts() {
247
  * @return string the URL of the plugin file
248
  */
249
  private function plugins_url($relative_path, $plugin_path) {
250
+ $template_dir = get_stylesheet_directory();
251
 
252
  foreach ( array('template_dir', 'plugin_path') as $var ) {
253
  $$var = str_replace('\\' ,'/', $$var); // sanitize for Win32 installs
254
  $$var = preg_replace('|/+|', '/', $$var);
255
  }
256
+
257
  if(0 === strpos($plugin_path, $template_dir)) {
258
+ $url = get_stylesheet_directory_uri();
259
  $folder = str_replace($template_dir, '', dirname($plugin_path));
260
  if ( '.' != $folder ) {
261
  $url .= '/' . ltrim($folder, '/');
405
  );
406
  }
407
  $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>';
408
+ $set_thumbnail_link = sprintf( $format_string, sprintf( esc_attr__( "Set %s" , 'multiple-post-thumbnails' ), $this->label ), esc_url($image_library_url), $this->post_type, $this->id, $url_class, $this->label, $thumbnail_id );
409
  $content = sprintf( $set_thumbnail_link, sprintf( esc_html__( "Set %s", 'multiple-post-thumbnails' ), $this->label ) );
410
 
411
  if ($thumbnail_id && get_post($thumbnail_id)) {
479
 
480
  }
481
 
482
+ if ( is_admin() ) {
483
+ $domain = 'multiple-post-thumbnails';
484
+ $locale = apply_filters('plugin_locale', get_locale(), $domain);
485
+ $mofile = $domain . '-' . $locale . '.mo';
486
+
487
+ load_textdomain( $domain, dirname( __FILE__ ) . '/languages/' . $mofile );
488
+ }
489
  }
readme.txt CHANGED
@@ -1,9 +1,10 @@
1
- === Plugin Name ===
2
  Contributors: chrisscott, voceplatforms
3
  Tags: thumbnails, image, featured image
4
  Requires at least: 2.9.2
5
- Tested up to: 4.1.1
6
- Stable tag: 1.6.5
 
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
1
+ === Multiple Post Thumbnails ===
2
  Contributors: chrisscott, voceplatforms
3
  Tags: thumbnails, image, featured image
4
  Requires at least: 2.9.2
5
+ Tested up to: 4.9.5
6
+ Stable tag: 1.7
7
+ Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10