Meta Box - Version 4.9.1

Version Description

  • Fix: Quick fix for rwmb_meta() to be better backward compatible
Download this release

Release Info

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

Code changes from version 4.9 to 4.9.1

Files changed (4) hide show
  1. inc/functions.php +9 -7
  2. inc/loader.php +1 -1
  3. meta-box.php +1 -1
  4. readme.txt +4 -1
inc/functions.php CHANGED
@@ -17,13 +17,17 @@ if ( ! function_exists( 'rwmb_meta' ) )
17
  function rwmb_meta( $key, $args = array(), $post_id = null )
18
  {
19
  $args = wp_parse_args( $args );
20
- /**
21
  * If meta boxes is registered in the backend only, we can't get field's params
22
  * This is for backward compatibility with version < 4.8.0
23
  */
24
  $field = RWMB_Helper::find_field( $key, $post_id );
25
 
26
- if ( false === $field && isset( $args['type'] ) )
 
 
 
 
27
  {
28
  return apply_filters( 'rwmb_meta', RWMB_Helper::meta( $key, $args, $post_id ) );
29
  }
@@ -54,7 +58,7 @@ if ( ! function_exists( 'rwmb_get_value' ) )
54
  // Get field value
55
  $value = $field ? RWMB_Field::call( 'get_value', $field, $args, $post_id ) : false;
56
 
57
- /**
58
  * Allow developers to change the returned value of field
59
  * For version < 4.8.2, the filter name was 'rwmb_get_field'
60
  *
@@ -91,7 +95,7 @@ if ( ! function_exists( 'rwmb_the_value' ) )
91
 
92
  $output = RWMB_Field::call( 'the_value', $field, $args, $post_id );
93
 
94
- /**
95
  * Allow developers to change the returned value of field
96
  * For version < 4.8.2, the filter name was 'rwmb_get_field'
97
  *
@@ -114,9 +118,7 @@ if ( ! function_exists( 'rwmb_meta_shortcode' ) )
114
  /**
115
  * Shortcode to display meta value
116
  *
117
- * @param array $atts Shortcode attributes, same as meta() function, but has more "meta_key" parameter
118
- *
119
- * @see meta() function below
120
  *
121
  * @return string
122
  */
17
  function rwmb_meta( $key, $args = array(), $post_id = null )
18
  {
19
  $args = wp_parse_args( $args );
20
+ /*
21
  * If meta boxes is registered in the backend only, we can't get field's params
22
  * This is for backward compatibility with version < 4.8.0
23
  */
24
  $field = RWMB_Helper::find_field( $key, $post_id );
25
 
26
+ /*
27
+ * If field is not found, which can caused by registering meta boxes for the backend only or conditional registration
28
+ * Then fallback to the old method to retrieve meta (which uses get_post_meta() as the latest fallback)
29
+ */
30
+ if ( false === $field )
31
  {
32
  return apply_filters( 'rwmb_meta', RWMB_Helper::meta( $key, $args, $post_id ) );
33
  }
58
  // Get field value
59
  $value = $field ? RWMB_Field::call( 'get_value', $field, $args, $post_id ) : false;
60
 
61
+ /*
62
  * Allow developers to change the returned value of field
63
  * For version < 4.8.2, the filter name was 'rwmb_get_field'
64
  *
95
 
96
  $output = RWMB_Field::call( 'the_value', $field, $args, $post_id );
97
 
98
+ /*
99
  * Allow developers to change the returned value of field
100
  * For version < 4.8.2, the filter name was 'rwmb_get_field'
101
  *
118
  /**
119
  * Shortcode to display meta value
120
  *
121
+ * @param array $atts Shortcode attributes, same as rwmb_meta() function, but has more "meta_key" parameter
 
 
122
  *
123
  * @return string
124
  */
inc/loader.php CHANGED
@@ -18,7 +18,7 @@ class RWMB_Loader
18
  protected function constants()
19
  {
20
  // Script version, used to add version for scripts and styles
21
- define( 'RWMB_VER', '4.9' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
18
  protected function constants()
19
  {
20
  // Script version, used to add version for scripts and styles
21
+ define( 'RWMB_VER', '4.9.1' );
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 for any post type in WordPress.
6
- * Version: 4.9
7
  * Author: Rilwis
8
  * Author URI: http://www.deluxeblogtips.com
9
  * License: GPL2+
3
  * Plugin Name: Meta Box
4
  * Plugin URI: https://metabox.io
5
  * Description: Create custom meta boxes and custom fields for any post type in WordPress.
6
+ * Version: 4.9.1
7
  * Author: Rilwis
8
  * Author URI: http://www.deluxeblogtips.com
9
  * License: GPL2+
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.deluxeblogtips.com/donate
4
  Tags: meta-box, custom fields, custom field, meta, meta-boxes, admin, advanced, custom, edit, field, file, image, magic fields, matrix, more fields, Post, repeater, simple fields, text, textarea, type, cms, fields post
5
  Requires at least: 4.1
6
  Tested up to: 4.6.1
7
- Stable tag: 4.9
8
  License: GPLv2 or later
9
 
10
  Meta Box plugin is a powerful, professional solution to create custom meta boxes and custom fields for WordPress websites.
@@ -80,6 +80,9 @@ To getting started with the plugin API, please read [this tutorial](https://meta
80
 
81
  == Changelog ==
82
 
 
 
 
83
  = 4.9 =
84
  * Improvement: Update Chinese language. Add Chinese Taiwan.
85
  * Improvement: Add support for Google Maps API key. Default API key is added, however users should replace it with their own key.
4
  Tags: meta-box, custom fields, custom field, meta, meta-boxes, admin, advanced, custom, edit, field, file, image, magic fields, matrix, more fields, Post, repeater, simple fields, text, textarea, type, cms, fields post
5
  Requires at least: 4.1
6
  Tested up to: 4.6.1
7
+ Stable tag: 4.9.1
8
  License: GPLv2 or later
9
 
10
  Meta Box plugin is a powerful, professional solution to create custom meta boxes and custom fields for WordPress websites.
80
 
81
  == Changelog ==
82
 
83
+ = 4.9.1 =
84
+ * Fix: Quick fix for `rwmb_meta()` to be better backward compatible
85
+
86
  = 4.9 =
87
  * Improvement: Update Chinese language. Add Chinese Taiwan.
88
  * Improvement: Add support for Google Maps API key. Default API key is added, however users should replace it with their own key.