Dynamic Featured Image - Version 3.6.2

Version Description

Download this release

Release Info

Developer ankitpokhrel
Plugin Icon wp plugin Dynamic Featured Image
Version 3.6.2
Comparing to
See all releases

Code changes from version 3.6.1 to 3.6.2

dynamic-featured-image.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Dynamic Featured Image
4
  * Plugin URI: http://wordpress.org/plugins/dynamic-featured-image/
5
  * Description: Dynamically adds multiple featured image or post thumbnail functionality to your posts, pages and custom post types.
6
- * Version: 3.6.1
7
  * Author: Ankit Pokhrel
8
  * Author URI: https://ankitpokhrel.com
9
  * License: GPL2 or later
@@ -49,7 +49,7 @@ class Dynamic_Featured_Image {
49
  *
50
  * @since 3.0.0
51
  */
52
- const VERSION = '3.6.1';
53
 
54
  /**
55
  * Text domain.
@@ -169,7 +169,7 @@ class Dynamic_Featured_Image {
169
  * @since 1.0.0
170
  * @access public
171
  *
172
- * @see wp_enque_style()
173
  * @see wp_register_script()
174
  * @see wp_enqueue_script()
175
  *
@@ -241,7 +241,7 @@ class Dynamic_Featured_Image {
241
  $this->metabox_title = apply_filters( 'dfi_set_metabox_title', __( 'Featured Image', self::TEXT_DOMAIN ) );
242
 
243
  $featured_data = get_post_meta( $post->ID, 'dfiFeatured', true );
244
- $total_featured = count( $featured_data );
245
 
246
  $default_filter = array( 'attachment', 'revision', 'nav_menu_item' );
247
  $this->user_filter = apply_filters( 'dfi_post_type_user_filter', $this->user_filter );
@@ -297,8 +297,8 @@ class Dynamic_Featured_Image {
297
  __( $this->metabox_title, self::TEXT_DOMAIN ) . ' ' . $this->get_number_translation( $i ),
298
  array( $this, 'featured_meta_box' ),
299
  $type,
300
- 'side',
301
- 'low',
302
  array( $featured, $i + 1 )
303
  );
304
 
@@ -311,8 +311,8 @@ class Dynamic_Featured_Image {
311
  __( $this->metabox_title, self::TEXT_DOMAIN ) . ' ' . __( 2, self::TEXT_DOMAIN ),
312
  array( $this, 'featured_meta_box' ),
313
  $type,
314
- 'side',
315
- 'low',
316
  array( null, null )
317
  );
318
 
@@ -695,6 +695,7 @@ class Dynamic_Featured_Image {
695
  // and try to get the attachment id.
696
  $image_url = str_replace( $this->upload_url . '/', '', $image_url );
697
  $row = $this->execute_query( $this->db->prepare( 'SELECT post_id FROM ' . $this->db->postmeta . ' WHERE meta_value = %s', $image_url ) );
 
698
  if ( ! is_null( $row ) ) {
699
  $attachment_id = $row;
700
  }
3
  * Plugin Name: Dynamic Featured Image
4
  * Plugin URI: http://wordpress.org/plugins/dynamic-featured-image/
5
  * Description: Dynamically adds multiple featured image or post thumbnail functionality to your posts, pages and custom post types.
6
+ * Version: 3.6.5
7
  * Author: Ankit Pokhrel
8
  * Author URI: https://ankitpokhrel.com
9
  * License: GPL2 or later
49
  *
50
  * @since 3.0.0
51
  */
52
+ const VERSION = '3.6.5';
53
 
54
  /**
55
  * Text domain.
169
  * @since 1.0.0
170
  * @access public
171
  *
172
+ * @see wp_enqueue_style()
173
  * @see wp_register_script()
174
  * @see wp_enqueue_script()
175
  *
241
  $this->metabox_title = apply_filters( 'dfi_set_metabox_title', __( 'Featured Image', self::TEXT_DOMAIN ) );
242
 
243
  $featured_data = get_post_meta( $post->ID, 'dfiFeatured', true );
244
+ $total_featured = is_array( $featured_data ) ? count( $featured_data ) : 0;
245
 
246
  $default_filter = array( 'attachment', 'revision', 'nav_menu_item' );
247
  $this->user_filter = apply_filters( 'dfi_post_type_user_filter', $this->user_filter );
297
  __( $this->metabox_title, self::TEXT_DOMAIN ) . ' ' . $this->get_number_translation( $i ),
298
  array( $this, 'featured_meta_box' ),
299
  $type,
300
+ apply_filters( 'dfi_metabox_context', 'side' ),
301
+ apply_filters( 'dfi_metabox_priority', 'low' ),
302
  array( $featured, $i + 1 )
303
  );
304
 
311
  __( $this->metabox_title, self::TEXT_DOMAIN ) . ' ' . __( 2, self::TEXT_DOMAIN ),
312
  array( $this, 'featured_meta_box' ),
313
  $type,
314
+ apply_filters( 'dfi_metabox_context', 'side' ),
315
+ apply_filters( 'dfi_metabox_priority', 'low' ),
316
  array( null, null )
317
  );
318
 
695
  // and try to get the attachment id.
696
  $image_url = str_replace( $this->upload_url . '/', '', $image_url );
697
  $row = $this->execute_query( $this->db->prepare( 'SELECT post_id FROM ' . $this->db->postmeta . ' WHERE meta_value = %s', $image_url ) );
698
+
699
  if ( ! is_null( $row ) ) {
700
  $attachment_id = $row;
701
  }
js/script-dfi.js CHANGED
@@ -91,6 +91,9 @@ jQuery( document ).ready( function ( $ ) {
91
  text: DFI_SPECIFIC.mediaSelector_buttonText
92
  },
93
  multiple: false,
 
 
 
94
  } ).on( 'select', function () {
95
  var attachment = dfi_uploader.state().get( 'selection' ).first().toJSON(),
96
  fullSize = attachment.url,
91
  text: DFI_SPECIFIC.mediaSelector_buttonText
92
  },
93
  multiple: false,
94
+ library: {
95
+ type: [ 'image' ]
96
+ }
97
  } ).on( 'select', function () {
98
  var attachment = dfi_uploader.state().get( 'selection' ).first().toJSON(),
99
  fullSize = attachment.url,
languages/dynamic-featured-image-th_TH.mo ADDED
Binary file
languages/dynamic-featured-image-th_TH.po ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: dynamic-featured-image\n"
4
+ "POT-Creation-Date: 2017-10-21 16:43+0545\n"
5
+ "PO-Revision-Date: 2017-10-21 14:35+0700\n"
6
+ "Language-Team: Noppadol Mututanon <noppadol.mututanon@gmail.com>\n"
7
+ "MIME-Version: 1.0\n"
8
+ "Content-Type: text/plain; charset=UTF-8\n"
9
+ "Content-Transfer-Encoding: 8bit\n"
10
+ "X-Generator: Poedit 2.0.4\n"
11
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
12
+ "X-Poedit-Basepath: .\n"
13
+ "Last-Translator: \n"
14
+ "Plural-Forms: nplurals=1; plural=0;\n"
15
+ "Language: th\n"
16
+
17
+ msgid "Featured Image "
18
+ msgstr "รูปภาพเด่น "
19
+
20
+ msgid "Dynamic Featured Image - Media Selector"
21
+ msgstr "รูปภาพเด่นแบบไดนามิก - ตัวเลือกรุปภาพ"
22
+
23
+ msgid "Set Featured Image"
24
+ msgstr "ตั้งค่ารูปภาพเด่น"
25
+
26
+ msgid "Add New"
27
+ msgstr "เพิ่มใหม่"
28
+
29
+ msgid "Remove"
30
+ msgstr "ลบ"
31
+
32
+ msgid ""
33
+ "ATTENTION! Please read the <a href=\"https://github.com/ankitpokhrel/Dynamic-"
34
+ "Featured-Image/wiki\" target=\"_blank\">DOCUMENTATION</a> properly before "
35
+ "update."
36
+ msgstr ""
37
+ "โปรดทราบ!! กรุณาอ่าน <a href=\"https://github.com/ankitpokhrel/Dynamic-"
38
+ "Featured-Image/wiki\" target=\"_blank\">เอกสาร</a> ให้ถี่ถ้วนก่อนทำการอัพเดท."
39
+
40
+ msgid "0"
41
+ msgstr "0"
42
+
43
+ msgid "1"
44
+ msgstr "1"
45
+
46
+ msgid "2"
47
+ msgstr "2"
48
+
49
+ msgid "3"
50
+ msgstr "3"
51
+
52
+ msgid "4"
53
+ msgstr "4"
54
+
55
+ msgid "5"
56
+ msgstr "5"
57
+
58
+ msgid "6"
59
+ msgstr "6"
60
+
61
+ msgid "7"
62
+ msgstr "7"
63
+
64
+ msgid "8"
65
+ msgstr "8"
66
+
67
+ msgid "9"
68
+ msgstr "9"
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: ankitpokhrel, cfoellmann
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J9FVY3ESPPD58
4
  Tags: dynamic featured image, featured image, post thumbnail, dynamic post thumbnail, multiple featured image, multiple post thumbnail
5
  Requires at least: 3.8
6
- Tested up to: 4.8.1
7
- Stable tag: 3.6.1
8
  Requires PHP: 5.3
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -117,6 +117,12 @@ Please feel free to report any bug found at https://github.com/ankitpokhrel/Dyna
117
  3. Add new featured image box.
118
 
119
  == Changelog ==
 
 
 
 
 
 
120
  = 3.6.1 =
121
  * Remove short array syntax to support php <= 5.4.
122
 
@@ -222,6 +228,9 @@ Please feel free to report any bug found at https://github.com/ankitpokhrel/Dyna
222
  * Fixed some minor issues.
223
 
224
  == Upgrade Notice ==
 
 
 
225
  = 3.6.1 =
226
  * Remove short array syntax to support php <= 5.4.
227
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J9FVY3ESPPD58
4
  Tags: dynamic featured image, featured image, post thumbnail, dynamic post thumbnail, multiple featured image, multiple post thumbnail
5
  Requires at least: 3.8
6
+ Tested up to: 4.9.2
7
+ Stable tag: 3.6.5
8
  Requires PHP: 5.3
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
117
  3. Add new featured image box.
118
 
119
  == Changelog ==
120
+ = 3.6.5 =
121
+ * Add Thai translations (#63, Thanks @isudnop)
122
+ * Fix warning when counting empty string in PHP 7.2 (#66, Thanks @zsmartin)
123
+ * Show only images in media selector (#67, Thanks @zsmartin)
124
+ * Add filters for metabox context and priority (#68, Thanks @zsmartin)
125
+
126
  = 3.6.1 =
127
  * Remove short array syntax to support php <= 5.4.
128
 
228
  * Fixed some minor issues.
229
 
230
  == Upgrade Notice ==
231
+ = 3.6.5 =
232
+ * Some enhancements, feature and bug fixes.
233
+
234
  = 3.6.1 =
235
  * Remove short array syntax to support php <= 5.4.
236