Version Description
- Improvement: Add ability to use multiple post types for
post
field - Fix: Duplicated description for
checkbox
field - Fix: Blank gallery for image fields
Download this release
Release Info
Developer | rilwis |
Plugin | Meta Box |
Version | 4.5.1 |
Comparing to | |
See all releases |
Code changes from version 4.5 to 4.5.1
- inc/field.php +1 -1
- inc/fields/checkbox.php +2 -4
- inc/fields/file.php +0 -16
- inc/fields/post.php +15 -4
- lang/es_ES.mo +0 -0
- lang/es_ES.po +127 -0
- meta-box.php +2 -2
- readme.txt +6 -2
inc/field.php
CHANGED
@@ -271,7 +271,7 @@ if ( ! class_exists( 'RWMB_Field ' ) )
|
|
271 |
// Make sure meta value is an array for clonable and multiple fields
|
272 |
if ( $field['clone'] || $field['multiple'] )
|
273 |
{
|
274 |
-
$meta = (
|
275 |
}
|
276 |
|
277 |
return $meta;
|
271 |
// Make sure meta value is an array for clonable and multiple fields
|
272 |
if ( $field['clone'] || $field['multiple'] )
|
273 |
{
|
274 |
+
$meta = is_array( $meta ) ? $meta : array();
|
275 |
}
|
276 |
|
277 |
return $meta;
|
inc/fields/checkbox.php
CHANGED
@@ -26,13 +26,11 @@ if ( ! class_exists( 'RWMB_Checkbox_Field' ) )
|
|
26 |
*/
|
27 |
static function html( $meta, $field )
|
28 |
{
|
29 |
-
$desc = $field['desc'] ? "<span id='{$field['id']}_description' class='description'>{$field['desc']}</span>" : '';
|
30 |
return sprintf(
|
31 |
-
'<
|
32 |
$field['field_name'],
|
33 |
$field['id'],
|
34 |
-
checked( ! empty( $meta ), 1, false )
|
35 |
-
$desc
|
36 |
);
|
37 |
}
|
38 |
|
26 |
*/
|
27 |
static function html( $meta, $field )
|
28 |
{
|
|
|
29 |
return sprintf(
|
30 |
+
'<input type="checkbox" class="rwmb-checkbox" name="%s" id="%s" value="1" %s>',
|
31 |
$field['field_name'],
|
32 |
$field['id'],
|
33 |
+
checked( ! empty( $meta ), 1, false )
|
|
|
34 |
);
|
35 |
}
|
36 |
|
inc/fields/file.php
CHANGED
@@ -289,22 +289,6 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
|
|
289 |
return $field;
|
290 |
}
|
291 |
|
292 |
-
/**
|
293 |
-
* Standard meta retrieval
|
294 |
-
*
|
295 |
-
* @param int $post_id
|
296 |
-
* @param array $field
|
297 |
-
* @param bool $saved
|
298 |
-
*
|
299 |
-
* @return mixed
|
300 |
-
*/
|
301 |
-
static function meta( $post_id, $saved, $field )
|
302 |
-
{
|
303 |
-
$meta = parent::meta( $post_id, $saved, $field );
|
304 |
-
|
305 |
-
return empty( $meta ) ? array() : (array) $meta;
|
306 |
-
}
|
307 |
-
|
308 |
/**
|
309 |
* Get the field value
|
310 |
* The difference between this function and 'meta' function is 'meta' function always returns the escaped value
|
289 |
return $field;
|
290 |
}
|
291 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
/**
|
293 |
* Get the field value
|
294 |
* The difference between this function and 'meta' function is 'meta' function always returns the escaped value
|
inc/fields/post.php
CHANGED
@@ -46,10 +46,21 @@ if ( ! class_exists( 'RWMB_Post_Field' ) )
|
|
46 |
'query_args' => array(),
|
47 |
) );
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
if ( $field['parent'] )
|
55 |
{
|
46 |
'query_args' => array(),
|
47 |
) );
|
48 |
|
49 |
+
/**
|
50 |
+
* Set default placeholder
|
51 |
+
* - If multiple post types: show 'Select a post'
|
52 |
+
* - If single post type: show 'Select a %post_type_name%'
|
53 |
+
*/
|
54 |
+
if ( empty( $field['placeholder'] ) )
|
55 |
+
{
|
56 |
+
$label = __( 'Select a post', 'meta-box' );
|
57 |
+
if ( is_string( $field['post_type'] ) )
|
58 |
+
{
|
59 |
+
$post_type_object = get_post_type_object( $field['post_type'] );
|
60 |
+
$label = sprintf( __( 'Select a %s', 'meta-box' ), $post_type_object->labels->singular_name );
|
61 |
+
}
|
62 |
+
$field['placeholder'] = $label;
|
63 |
+
}
|
64 |
|
65 |
if ( $field['parent'] )
|
66 |
{
|
lang/es_ES.mo
ADDED
Binary file
|
lang/es_ES.po
ADDED
@@ -0,0 +1,127 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Meta Box Script For WordPress\n"
|
4 |
+
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2012-06-03 15:09+0700\n"
|
6 |
+
"PO-Revision-Date: 2015-04-28 18:18+0100\n"
|
7 |
+
"Last-Translator: David <david@closemarketing.es>\n"
|
8 |
+
"Language-Team: Adel Qalieh <aqalieh95@gmail.com>\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Poedit-KeywordsList: __;_e;_x:2c,1;_n:1,2;_n_noop:1,2;_nx:1,2;"
|
13 |
+
"_nx_noop:1,2\n"
|
14 |
+
"X-Poedit-Basepath: .\n"
|
15 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
17 |
+
"X-Language: es\n"
|
18 |
+
"X-Source-Language: en\n"
|
19 |
+
"Language: es\n"
|
20 |
+
"X-Generator: Poedit 1.7.6\n"
|
21 |
+
"X-Poedit-SearchPath-0: ..\n"
|
22 |
+
"X-Poedit-SearchPath-1: ../inc/fields\n"
|
23 |
+
|
24 |
+
#: ../meta-box.php:79
|
25 |
+
msgid "RW_Meta_Box Debug:"
|
26 |
+
msgstr "RW_Meta_Box Debug:"
|
27 |
+
|
28 |
+
#: ../inc/classes/meta-box.php:316
|
29 |
+
msgid "+"
|
30 |
+
msgstr "+"
|
31 |
+
|
32 |
+
#: ../inc/classes/meta-box.php:340
|
33 |
+
msgid "–"
|
34 |
+
msgstr "–"
|
35 |
+
|
36 |
+
#: ../inc/fields/file.php:69
|
37 |
+
msgid "Error: Cannot delete file"
|
38 |
+
msgstr "Error: No se puede eliminar el archivo"
|
39 |
+
|
40 |
+
#: ../inc/fields/file.php:83
|
41 |
+
msgctxt "file upload"
|
42 |
+
msgid "Uploaded files"
|
43 |
+
msgstr "Archivos subidos"
|
44 |
+
|
45 |
+
#: ../inc/fields/file.php:84
|
46 |
+
msgctxt "file upload"
|
47 |
+
msgid "Delete this file"
|
48 |
+
msgstr "Eliminar este archivo"
|
49 |
+
|
50 |
+
#: ../inc/fields/file.php:85
|
51 |
+
msgctxt "file upload"
|
52 |
+
msgid "Delete"
|
53 |
+
msgstr "Eliminar"
|
54 |
+
|
55 |
+
#: ../inc/fields/file.php:86
|
56 |
+
msgctxt "file upload"
|
57 |
+
msgid "Upload files"
|
58 |
+
msgstr "Subir archivos"
|
59 |
+
|
60 |
+
#: ../inc/fields/file.php:87
|
61 |
+
msgctxt "file upload"
|
62 |
+
msgid "+ Add new file"
|
63 |
+
msgstr "+ Añadir un archivo nuevo"
|
64 |
+
|
65 |
+
#: ../inc/fields/image.php:75
|
66 |
+
msgid "Order saved"
|
67 |
+
msgstr "El orden guardado"
|
68 |
+
|
69 |
+
#: ../inc/fields/image.php:91
|
70 |
+
#: ../inc/fields/plupload-image.php:156
|
71 |
+
msgctxt "image upload"
|
72 |
+
msgid "Uploaded files"
|
73 |
+
msgstr "Archivos subidos"
|
74 |
+
|
75 |
+
#: ../inc/fields/image.php:92
|
76 |
+
#: ../inc/fields/plupload-image.php:112
|
77 |
+
msgctxt "image upload"
|
78 |
+
msgid "Delete this file"
|
79 |
+
msgstr "Eliminar este archivo"
|
80 |
+
|
81 |
+
#: ../inc/fields/image.php:93
|
82 |
+
#: ../inc/fields/plupload-image.php:113
|
83 |
+
msgctxt "image upload"
|
84 |
+
msgid "Delete"
|
85 |
+
msgstr "Eliminar"
|
86 |
+
|
87 |
+
#: ../inc/fields/image.php:94
|
88 |
+
#: ../inc/fields/plupload-image.php:114
|
89 |
+
msgctxt "image upload"
|
90 |
+
msgid "Edit"
|
91 |
+
msgstr "Editar"
|
92 |
+
|
93 |
+
#: ../inc/fields/image.php:95
|
94 |
+
#: ../inc/fields/plupload-image.php:157
|
95 |
+
msgctxt "image upload"
|
96 |
+
msgid "Upload files"
|
97 |
+
msgstr "Subir archivos"
|
98 |
+
|
99 |
+
#: ../inc/fields/image.php:96
|
100 |
+
msgctxt "image upload"
|
101 |
+
msgid "+ Add new image"
|
102 |
+
msgstr "+ Añadir un archivo nuevo"
|
103 |
+
|
104 |
+
#: ../inc/fields/plupload-image.php:95
|
105 |
+
msgctxt "image upload"
|
106 |
+
msgid "Allowed Image Files"
|
107 |
+
msgstr "Archivos de imágenes permitidos"
|
108 |
+
|
109 |
+
#: ../inc/fields/plupload-image.php:160
|
110 |
+
msgctxt "image upload"
|
111 |
+
msgid "Drop images here"
|
112 |
+
msgstr "Soltar imágenes aquí"
|
113 |
+
|
114 |
+
#: ../inc/fields/plupload-image.php:161
|
115 |
+
msgctxt "image upload"
|
116 |
+
msgid "or"
|
117 |
+
msgstr "o"
|
118 |
+
|
119 |
+
#: ../inc/fields/plupload-image.php:162
|
120 |
+
msgctxt "image upload"
|
121 |
+
msgid "Select Files"
|
122 |
+
msgstr "Seleccionar Archivos"
|
123 |
+
|
124 |
+
#: ../inc/fields/thickbox-image.php:45
|
125 |
+
msgctxt "image upload"
|
126 |
+
msgid "Upload image"
|
127 |
+
msgstr "Subir imágenes"
|
meta-box.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Meta Box
|
4 |
Plugin URI: http://metabox.io
|
5 |
Description: Create meta box for editing pages in WordPress. Compatible with custom post types since WP 3.0
|
6 |
-
Version: 4.5
|
7 |
Author: Rilwis
|
8 |
Author URI: http://www.deluxeblogtips.com
|
9 |
License: GPL2+
|
@@ -13,7 +13,7 @@ License: GPL2+
|
|
13 |
defined( 'ABSPATH' ) || exit;
|
14 |
|
15 |
// Script version, used to add version for scripts and styles
|
16 |
-
define( 'RWMB_VER', '4.5' );
|
17 |
|
18 |
// Define plugin URLs, for fast enqueuing scripts and styles
|
19 |
if ( ! defined( 'RWMB_URL' ) )
|
3 |
Plugin Name: Meta Box
|
4 |
Plugin URI: http://metabox.io
|
5 |
Description: Create meta box for editing pages in WordPress. Compatible with custom post types since WP 3.0
|
6 |
+
Version: 4.5.1
|
7 |
Author: Rilwis
|
8 |
Author URI: http://www.deluxeblogtips.com
|
9 |
License: GPL2+
|
13 |
defined( 'ABSPATH' ) || exit;
|
14 |
|
15 |
// Script version, used to add version for scripts and styles
|
16 |
+
define( 'RWMB_VER', '4.5.1' );
|
17 |
|
18 |
// Define plugin URLs, for fast enqueuing scripts and styles
|
19 |
if ( ! defined( 'RWMB_URL' ) )
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: rilwis, fitwp, f-j-kaiser, Omnicia, funkedgeek, PerWiklander, ruan
|
|
3 |
Donate link: http://www.deluxeblogtips.com/donate
|
4 |
Tags: meta-box, custom-fields, custom-field, meta, meta-boxes
|
5 |
Requires at least: 3.5
|
6 |
-
Tested up to: 4.2
|
7 |
-
Stable tag: 4.5
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Meta Box plugin is a complete tool to create meta box and custom fields in WordPress: lightweight, powerful and easy-to-use.
|
@@ -69,6 +69,10 @@ To getting started with the plugin API, please read [this tutorial](http://metab
|
|
69 |
|
70 |
== Changelog ==
|
71 |
|
|
|
|
|
|
|
|
|
72 |
|
73 |
= 4.5 =
|
74 |
* Improvement: Separate `esc_meta` method
|
3 |
Donate link: http://www.deluxeblogtips.com/donate
|
4 |
Tags: meta-box, custom-fields, custom-field, meta, meta-boxes
|
5 |
Requires at least: 3.5
|
6 |
+
Tested up to: 4.2.1
|
7 |
+
Stable tag: 4.5.1
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Meta Box plugin is a complete tool to create meta box and custom fields in WordPress: lightweight, powerful and easy-to-use.
|
69 |
|
70 |
== Changelog ==
|
71 |
|
72 |
+
= 4.5.1 =
|
73 |
+
* Improvement: Add ability to use multiple post types for `post` field
|
74 |
+
* Fix: Duplicated description for `checkbox` field
|
75 |
+
* Fix: Blank gallery for image fields
|
76 |
|
77 |
= 4.5 =
|
78 |
* Improvement: Separate `esc_meta` method
|