Meta Box - Version 5.2.7

Version Description

Download this release

Release Info

Developer rilwis
Plugin Icon 128x128 Meta Box
Version 5.2.7
Comparing to
See all releases

Code changes from version 5.2.6 to 5.2.7

Files changed (5) hide show
  1. inc/field.php +8 -2
  2. inc/fields/image.php +4 -1
  3. inc/loader.php +1 -1
  4. meta-box.php +1 -1
  5. readme.txt +1 -1
inc/field.php CHANGED
@@ -327,11 +327,17 @@ abstract class RWMB_Field {
327
  /**
328
  * Normalize parameters for field.
329
  *
330
- * @param array $field Field parameters.
331
- *
332
  * @return array
333
  */
334
  public static function normalize( $field ) {
 
 
 
 
 
 
 
335
  $field = wp_parse_args(
336
  $field,
337
  array(
327
  /**
328
  * Normalize parameters for field.
329
  *
330
+ * @param array|string $field Field settings.
 
331
  * @return array
332
  */
333
  public static function normalize( $field ) {
334
+ // Quick define text fields with "name" attribute only.
335
+ if ( is_string( $field ) ) {
336
+ $field = array(
337
+ 'name' => $field,
338
+ 'id' => sanitize_key( $field ),
339
+ );
340
+ }
341
  $field = wp_parse_args(
342
  $field,
343
  array(
inc/fields/image.php CHANGED
@@ -161,8 +161,11 @@ class RWMB_Image_Field extends RWMB_File_Field {
161
  */
162
  protected static function get_image_meta_data( $attachment_id ) {
163
  $metadata = wp_get_attachment_metadata( $attachment_id );
164
- $dir_url = dirname( wp_get_attachment_url( $attachment_id ) );
 
 
165
 
 
166
  foreach ( $metadata['sizes'] as &$size ) {
167
  $size['url'] = "{$dir_url}/{$size['file']}";
168
  }
161
  */
162
  protected static function get_image_meta_data( $attachment_id ) {
163
  $metadata = wp_get_attachment_metadata( $attachment_id );
164
+ if ( empty( $metadata['sizes'] ) ) {
165
+ return $metadata;
166
+ }
167
 
168
+ $dir_url = dirname( wp_get_attachment_url( $attachment_id ) );
169
  foreach ( $metadata['sizes'] as &$size ) {
170
  $size['url'] = "{$dir_url}/{$size['file']}";
171
  }
inc/loader.php CHANGED
@@ -18,7 +18,7 @@ class RWMB_Loader {
18
  */
19
  protected function constants() {
20
  // Script version, used to add version for scripts and styles.
21
- define( 'RWMB_VER', '5.2.6' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
18
  */
19
  protected function constants() {
20
  // Script version, used to add version for scripts and styles.
21
+ define( 'RWMB_VER', '5.2.7' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
meta-box.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Meta Box
4
  * Plugin URI: https://metabox.io
5
  * Description: Create custom meta boxes and custom fields in WordPress.
6
- * Version: 5.2.6
7
  * Author: MetaBox.io
8
  * Author URI: https://metabox.io
9
  * License: GPL2+
3
  * Plugin Name: Meta Box
4
  * Plugin URI: https://metabox.io
5
  * Description: Create custom meta boxes and custom fields in WordPress.
6
+ * Version: 5.2.7
7
  * Author: MetaBox.io
8
  * Author URI: https://metabox.io
9
  * License: GPL2+
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: meta-box, custom fields, custom field, meta, meta-boxes, admin, advanced,
5
  Requires at least: 4.3
6
  Requires PHP: 5.3
7
  Tested up to: 5.3.2
8
- Stable tag: 5.2.6
9
  License: GPLv2 or later
10
 
11
  Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.
5
  Requires at least: 4.3
6
  Requires PHP: 5.3
7
  Tested up to: 5.3.2
8
+ Stable tag: 5.2.7
9
  License: GPLv2 or later
10
 
11
  Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.