Version Description
Download this release
Release Info
Developer | rilwis |
Plugin | Meta Box |
Version | 4.13.0 |
Comparing to | |
See all releases |
Code changes from version 4.12.6 to 4.13.0
- css/background.css +17 -0
- css/button-group.css +67 -0
- css/style.css +19 -0
- css/switch.css +93 -0
- inc/about/sections/getting-started.php +1 -1
- inc/core.php +31 -0
- inc/fields/background.php +174 -0
- inc/fields/button-group.php +80 -0
- inc/fields/color.php +11 -8
- inc/fields/file-input.php +1 -1
- inc/fields/input-list.php +1 -1
- inc/fields/media.php +1 -1
- inc/fields/post.php +1 -6
- inc/fields/single-image.php +84 -0
- inc/fields/switch.php +94 -0
- inc/fields/wysiwyg.php +1 -1
- inc/loader.php +1 -1
- inc/meta-box-registry.php +22 -0
- inc/meta-box.php +11 -3
- inc/walkers/select.php +1 -1
- js/button-group.js +39 -0
- js/clone.js +9 -6
- js/date.js +4 -0
- js/image-advanced.js +11 -4
- js/media.js +8 -2
- js/script.js +4 -0
- languages/meta-box-it_IT.mo +0 -0
- languages/meta-box-it_IT.po +282 -90
- meta-box.php +1 -1
- readme.txt +1 -1
css/background.css
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.rwmb-background-row {
|
2 |
+
margin-bottom: 5px;
|
3 |
+
}
|
4 |
+
.rwmb-background-wrapper .wp-picker-container {
|
5 |
+
position: relative;
|
6 |
+
display: inline-block;
|
7 |
+
vertical-align: top;
|
8 |
+
}
|
9 |
+
.rwmb-background-wrapper .wp-picker-holder {
|
10 |
+
position: absolute;
|
11 |
+
z-index: 9;
|
12 |
+
min-width: 255px;
|
13 |
+
}
|
14 |
+
.rwmb-background-image {
|
15 |
+
display: inline-block;
|
16 |
+
vertical-align: top;
|
17 |
+
}
|
css/button-group.css
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.rwmb-button-input-list li {
|
2 |
+
margin-bottom: 0;
|
3 |
+
}
|
4 |
+
.rwmb-button-input-list .rwmb-button_group {
|
5 |
+
display: none;
|
6 |
+
}
|
7 |
+
.rwmb-button-input-list li label {
|
8 |
+
display: inline-block;
|
9 |
+
border: #ccc solid 1px;
|
10 |
+
position: relative;
|
11 |
+
z-index: 1;
|
12 |
+
padding: 5px 10px;
|
13 |
+
background: #fff;
|
14 |
+
}
|
15 |
+
.rwmb-button-input-list li label.selected {
|
16 |
+
border-color: #0073aa;
|
17 |
+
background: #0073aa;
|
18 |
+
color: #fff;
|
19 |
+
z-index: 2;
|
20 |
+
}
|
21 |
+
/* layout not inline
|
22 |
+
-------------------------------------------------*/
|
23 |
+
.rwmb-button-input-list:not(.inline) li label {
|
24 |
+
border-top-width: 0px;
|
25 |
+
}
|
26 |
+
.rwmb-button-input-list:not(.inline) li:first-child label {
|
27 |
+
border-top-width: 1px;
|
28 |
+
}
|
29 |
+
.rwmb-button-input-list:not(.inline) li label.selected {
|
30 |
+
border-bottom: 1px solid #fff;
|
31 |
+
}
|
32 |
+
.rwmb-button-input-list:not(.inline) li:last-child label.selected {
|
33 |
+
border-bottom-color: #0073aa;
|
34 |
+
}
|
35 |
+
.rwmb-button-input-list:not(.inline) > li:first-child:not(:last-child) label {
|
36 |
+
border-top-left-radius: 3px;
|
37 |
+
border-top-right-radius: 3px;
|
38 |
+
}
|
39 |
+
.rwmb-button-input-list:not(.inline) > li:last-child:not(:first-child) label {
|
40 |
+
border-bottom-right-radius: 3px;
|
41 |
+
border-bottom-left-radius: 3px;
|
42 |
+
}
|
43 |
+
/* Layout inline
|
44 |
+
---------------------------------------------*/
|
45 |
+
.rwmb-button-input-list.inline li {
|
46 |
+
display: inline-block;
|
47 |
+
}
|
48 |
+
.rwmb-button-input-list.inline li label {
|
49 |
+
border-left-width: 0;
|
50 |
+
}
|
51 |
+
.rwmb-button-input-list.inline li:first-child label {
|
52 |
+
border-left-width: 1px;
|
53 |
+
}
|
54 |
+
.rwmb-button-input-list.inline li label.selected {
|
55 |
+
border-right-color: rgb(255, 255, 255);
|
56 |
+
}
|
57 |
+
.rwmb-button-input-list.inline li:last-child label.selected {
|
58 |
+
border-right-color: #0073aa;
|
59 |
+
}
|
60 |
+
.rwmb-button-input-list.inline > li:first-child:not(:last-child) label {
|
61 |
+
border-top-left-radius: 3px;
|
62 |
+
border-bottom-left-radius: 3px;
|
63 |
+
}
|
64 |
+
.rwmb-button-input-list.inline > li:last-child:not(:first-child) label {
|
65 |
+
border-top-right-radius: 3px;
|
66 |
+
border-bottom-right-radius: 3px;
|
67 |
+
}
|
css/style.css
CHANGED
@@ -122,3 +122,22 @@ select.rwmb-error {
|
|
122 |
#side-sortables .rwmb-input {
|
123 |
width: 100%;
|
124 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
#side-sortables .rwmb-input {
|
123 |
width: 100%;
|
124 |
}
|
125 |
+
|
126 |
+
/* Seamless style
|
127 |
+
--------------------------------------------------------------*/
|
128 |
+
.rwmb-seamless {
|
129 |
+
background: none;
|
130 |
+
border: none;
|
131 |
+
box-shadow: none;
|
132 |
+
}
|
133 |
+
.rwmb-seamless .inside {
|
134 |
+
padding-left: 0;
|
135 |
+
padding-right: 0;
|
136 |
+
}
|
137 |
+
.postbox.rwmb-seamless .hndle,
|
138 |
+
.postbox.rwmb-seamless .handlediv {
|
139 |
+
display: none;
|
140 |
+
}
|
141 |
+
.rwmb-seamless .rwmb-clone {
|
142 |
+
background: none;
|
143 |
+
}
|
css/switch.css
ADDED
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* style switch
|
2 |
+
-----------------------------*/
|
3 |
+
.rwmb-switch-label {
|
4 |
+
position: relative;
|
5 |
+
display: inline-block;
|
6 |
+
background-color: #ccc;
|
7 |
+
padding: 2px;
|
8 |
+
border-radius: 3px;
|
9 |
+
min-width: 36px;
|
10 |
+
min-height: 18px;
|
11 |
+
}
|
12 |
+
|
13 |
+
input.rwmb-switch {
|
14 |
+
display: none;
|
15 |
+
}
|
16 |
+
|
17 |
+
.rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider {
|
18 |
+
background-color: #0073aa;
|
19 |
+
box-shadow: 0 0 1px #0073aa;
|
20 |
+
}
|
21 |
+
|
22 |
+
.rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider:before {
|
23 |
+
left: calc(100% - 20px);
|
24 |
+
}
|
25 |
+
|
26 |
+
.rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-off {
|
27 |
+
visibility: hidden;
|
28 |
+
display: none;
|
29 |
+
}
|
30 |
+
|
31 |
+
.rwmb-switch:not(:checked) + .rwmb-switch-status .rwmb-switch-on {
|
32 |
+
visibility: hidden;
|
33 |
+
display: none;
|
34 |
+
}
|
35 |
+
|
36 |
+
.rwmb-switch-slider {
|
37 |
+
position: absolute;
|
38 |
+
cursor: pointer;
|
39 |
+
top: 0;
|
40 |
+
left: 0;
|
41 |
+
right: 0;
|
42 |
+
bottom: 0;
|
43 |
+
z-index: 15;
|
44 |
+
-webkit-transition: .4s;
|
45 |
+
transition: .4s;
|
46 |
+
}
|
47 |
+
|
48 |
+
.rwmb-switch-slider:before {
|
49 |
+
position: absolute;
|
50 |
+
content: attr(title-before) "";
|
51 |
+
height: 18px;
|
52 |
+
width: 18px;
|
53 |
+
left: 2px;
|
54 |
+
bottom: 2px;
|
55 |
+
z-index: 99;
|
56 |
+
background-color: white;
|
57 |
+
-webkit-transition: .4s;
|
58 |
+
transition: .4s;
|
59 |
+
border-radius: 2px;
|
60 |
+
}
|
61 |
+
|
62 |
+
.rwmb-switch-label--square .rwmb-switch-slider {
|
63 |
+
border-radius: 3px;
|
64 |
+
}
|
65 |
+
|
66 |
+
.rwmb-switch-label--rounded,
|
67 |
+
.rwmb-switch-label--rounded .rwmb-switch-slider {
|
68 |
+
border-radius: 34px;
|
69 |
+
}
|
70 |
+
|
71 |
+
.rwmb-switch-label--rounded .rwmb-switch-slider:before {
|
72 |
+
border-radius: 50%;
|
73 |
+
}
|
74 |
+
|
75 |
+
.rwmb-switch-on,
|
76 |
+
.rwmb-switch-off {
|
77 |
+
display: inline-block;
|
78 |
+
float: left;
|
79 |
+
margin: 0 4px;
|
80 |
+
color: #fff;
|
81 |
+
text-transform: uppercase;
|
82 |
+
font-size: 11px;
|
83 |
+
position: relative;
|
84 |
+
z-index: 20;
|
85 |
+
}
|
86 |
+
|
87 |
+
.rwmb-switch-on {
|
88 |
+
padding-right: 20px;
|
89 |
+
}
|
90 |
+
|
91 |
+
.rwmb-switch-off {
|
92 |
+
padding-left: 20px;
|
93 |
+
}
|
inc/about/sections/getting-started.php
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
<p><a href="<?php echo esc_url( 'https://docs.metabox.io/quick-start/?utm_source=plugin_about_page&utm_medium=button_docs&utm_campaign=meta_box_about_page' ); ?>" class="button button-primary"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a></p>
|
25 |
|
26 |
<h3><?php esc_html_e( 'Extensions', 'meta-box' ); ?></h3>
|
27 |
-
<p><?php esc_html_e( 'Wanna more features that transform your WordPress website into a powerful CMS? Check out some extensions below:', 'meta-box' ); ?><p>
|
28 |
<ul>
|
29 |
<li><a target="_blank" href="https://metabox.io/plugins/meta-box-group/?utm_source=plugin_about_page&utm_medium=link_group&utm_campaign=meta_box_about_page"><span class="dashicons dashicons-welcome-widgets-menus"></span> <?php esc_html_e( 'Meta Box Group', 'meta-box' ); ?></a></li>
|
30 |
<li><a target="_blank" href="https://metabox.io/plugins/meta-box-conditional-logic/?utm_source=plugin_about_page&utm_medium=link_conditional&utm_campaign=meta_box_about_page"><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Meta Box Conditional Logic', 'meta-box' ); ?></a></li>
|
24 |
<p><a href="<?php echo esc_url( 'https://docs.metabox.io/quick-start/?utm_source=plugin_about_page&utm_medium=button_docs&utm_campaign=meta_box_about_page' ); ?>" class="button button-primary"><?php esc_html_e( 'Learn More', 'meta-box' ); ?></a></p>
|
25 |
|
26 |
<h3><?php esc_html_e( 'Extensions', 'meta-box' ); ?></h3>
|
27 |
+
<p><?php esc_html_e( 'Wanna see more features that transform your WordPress website into a powerful CMS? Check out some extensions below:', 'meta-box' ); ?><p>
|
28 |
<ul>
|
29 |
<li><a target="_blank" href="https://metabox.io/plugins/meta-box-group/?utm_source=plugin_about_page&utm_medium=link_group&utm_campaign=meta_box_about_page"><span class="dashicons dashicons-welcome-widgets-menus"></span> <?php esc_html_e( 'Meta Box Group', 'meta-box' ); ?></a></li>
|
30 |
<li><a target="_blank" href="https://metabox.io/plugins/meta-box-conditional-logic/?utm_source=plugin_about_page&utm_medium=link_conditional&utm_campaign=meta_box_about_page"><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Meta Box Conditional Logic', 'meta-box' ); ?></a></li>
|
inc/core.php
CHANGED
@@ -22,13 +22,16 @@ class RWMB_Core {
|
|
22 |
// Uses priority 20 to support custom port types registered using the default priority.
|
23 |
add_action( 'init', array( $this, 'register_meta_boxes' ), 20 );
|
24 |
add_action( 'edit_page_form', array( $this, 'fix_page_template' ) );
|
|
|
25 |
}
|
26 |
|
27 |
/**
|
28 |
* Add links to Documentation and Extensions in plugin's list of action links.
|
29 |
*
|
30 |
* @since 4.3.11
|
|
|
31 |
* @param array $links Array of plugin links.
|
|
|
32 |
* @return array
|
33 |
*/
|
34 |
public function plugin_links( $links ) {
|
@@ -60,6 +63,7 @@ class RWMB_Core {
|
|
60 |
* Unset the page template if the page does not exist to allow the post to save.
|
61 |
*
|
62 |
* @param WP_Post $post Post object.
|
|
|
63 |
* @since 4.3.10
|
64 |
*/
|
65 |
public function fix_page_template( WP_Post $post ) {
|
@@ -83,4 +87,31 @@ class RWMB_Core {
|
|
83 |
$meta_boxes = rwmb_get_registry( 'meta_box' )->all();
|
84 |
return wp_list_pluck( $meta_boxes, 'meta_box' );
|
85 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
22 |
// Uses priority 20 to support custom port types registered using the default priority.
|
23 |
add_action( 'init', array( $this, 'register_meta_boxes' ), 20 );
|
24 |
add_action( 'edit_page_form', array( $this, 'fix_page_template' ) );
|
25 |
+
$this->add_context_hooks();
|
26 |
}
|
27 |
|
28 |
/**
|
29 |
* Add links to Documentation and Extensions in plugin's list of action links.
|
30 |
*
|
31 |
* @since 4.3.11
|
32 |
+
*
|
33 |
* @param array $links Array of plugin links.
|
34 |
+
*
|
35 |
* @return array
|
36 |
*/
|
37 |
public function plugin_links( $links ) {
|
63 |
* Unset the page template if the page does not exist to allow the post to save.
|
64 |
*
|
65 |
* @param WP_Post $post Post object.
|
66 |
+
*
|
67 |
* @since 4.3.10
|
68 |
*/
|
69 |
public function fix_page_template( WP_Post $post ) {
|
87 |
$meta_boxes = rwmb_get_registry( 'meta_box' )->all();
|
88 |
return wp_list_pluck( $meta_boxes, 'meta_box' );
|
89 |
}
|
90 |
+
|
91 |
+
/**
|
92 |
+
* Add hooks for extra contexts.
|
93 |
+
*/
|
94 |
+
public function add_context_hooks() {
|
95 |
+
$hooks = array(
|
96 |
+
'edit_form_top',
|
97 |
+
'edit_form_after_title',
|
98 |
+
'edit_form_after_editor',
|
99 |
+
'edit_form_before_permalink',
|
100 |
+
);
|
101 |
+
|
102 |
+
foreach ( $hooks as $hook ) {
|
103 |
+
add_action( $hook, array( $this, 'add_context' ) );
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Add new meta box context.
|
109 |
+
*
|
110 |
+
* @param WP_Post $post The current post object.
|
111 |
+
*/
|
112 |
+
public function add_context( WP_Post $post ) {
|
113 |
+
$hook = current_filter();
|
114 |
+
$context = 'edit_form_top' === $hook ? 'form_top' : substr( $hook, 10 );
|
115 |
+
do_meta_boxes( null, $context, $post );
|
116 |
+
}
|
117 |
}
|
inc/fields/background.php
ADDED
@@ -0,0 +1,174 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The background field.
|
4 |
+
*
|
5 |
+
* @package Meta Box.
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* The Background field.
|
10 |
+
*/
|
11 |
+
class RWMB_Background_Field extends RWMB_Field {
|
12 |
+
/**
|
13 |
+
* Enqueue scripts and styles.
|
14 |
+
*/
|
15 |
+
public static function admin_enqueue_scripts() {
|
16 |
+
wp_enqueue_style( 'rwmb-background', RWMB_CSS_URL . 'background.css', '', RWMB_VER );
|
17 |
+
|
18 |
+
RWMB_Color_Field::admin_enqueue_scripts();
|
19 |
+
RWMB_File_Input_Field::admin_enqueue_scripts();
|
20 |
+
}
|
21 |
+
|
22 |
+
/**
|
23 |
+
* Get field HTML.
|
24 |
+
*
|
25 |
+
* @param mixed $meta Meta value.
|
26 |
+
* @param array $field Field settings.
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
public static function html( $meta, $field ) {
|
31 |
+
$meta = wp_parse_args( $meta, array(
|
32 |
+
'color' => '',
|
33 |
+
'image' => '',
|
34 |
+
'repeat' => '',
|
35 |
+
'attachment' => '',
|
36 |
+
'position' => '',
|
37 |
+
'size' => '',
|
38 |
+
) );
|
39 |
+
|
40 |
+
$output = '<div class="rwmb-background-row">';
|
41 |
+
|
42 |
+
// Color.
|
43 |
+
$color = RWMB_Color_Field::normalize( array(
|
44 |
+
'type' => 'color',
|
45 |
+
'id' => "{$field['id']}_color",
|
46 |
+
'field_name' => "{$field['field_name']}[color]",
|
47 |
+
) );
|
48 |
+
$output .= RWMB_Color_Field::html( $meta['color'], $color );
|
49 |
+
|
50 |
+
// Image.
|
51 |
+
$image = RWMB_File_Input_Field::normalize( array(
|
52 |
+
'type' => 'file_input',
|
53 |
+
'id' => "{$field['id']}_image",
|
54 |
+
'field_name' => "{$field['field_name']}[image]",
|
55 |
+
'placeholder' => __( 'Background Image', 'meta-box' ),
|
56 |
+
) );
|
57 |
+
$output .= '<div class="rwmb-background-image">';
|
58 |
+
$output .= RWMB_File_Input_Field::html( $meta['image'], $image );
|
59 |
+
$output .= '</div>';
|
60 |
+
|
61 |
+
$output .= '</div><!-- .rwmb-background-row -->';
|
62 |
+
$output .= '<div class="rwmb-background-row">';
|
63 |
+
|
64 |
+
// Repeat.
|
65 |
+
$repeat = RWMB_Select_Field::normalize( array(
|
66 |
+
'type' => 'select',
|
67 |
+
'id' => "{$field['id']}_repeat",
|
68 |
+
'field_name' => "{$field['field_name']}[repeat]",
|
69 |
+
'placeholder' => esc_html__( '-- Background Repeat --', 'meta-box' ),
|
70 |
+
'options' => array(
|
71 |
+
'no-repeat' => esc_html__( 'No Repeat', 'meta-box' ),
|
72 |
+
'repeat' => esc_html__( 'Repeat All', 'meta-box' ),
|
73 |
+
'repeat-x' => esc_html__( 'Repeat Horizontally', 'meta-box' ),
|
74 |
+
'repeat-y' => esc_html__( 'Repeat Vertically', 'meta-box' ),
|
75 |
+
'inherit' => esc_html__( 'Inherit', 'meta-box' ),
|
76 |
+
),
|
77 |
+
) );
|
78 |
+
$output .= RWMB_Select_Field::html( $meta['repeat'], $repeat );
|
79 |
+
|
80 |
+
// Position.
|
81 |
+
$position = RWMB_Select_Field::normalize( array(
|
82 |
+
'type' => 'select',
|
83 |
+
'id' => "{$field['id']}_position",
|
84 |
+
'field_name' => "{$field['field_name']}[position]",
|
85 |
+
'placeholder' => esc_html__( '-- Background Position --', 'meta-box' ),
|
86 |
+
'options' => array(
|
87 |
+
'top_left' => esc_html__( 'Top Left', 'meta-box' ),
|
88 |
+
'top_center' => esc_html__( 'Top Center', 'meta-box' ),
|
89 |
+
'top_right' => esc_html__( 'Top Right', 'meta-box' ),
|
90 |
+
'center_left' => esc_html__( 'Center Left', 'meta-box' ),
|
91 |
+
'center_center' => esc_html__( 'Center Center', 'meta-box' ),
|
92 |
+
'center_right' => esc_html__( 'Center Right', 'meta-box' ),
|
93 |
+
'bottom_left' => esc_html__( 'Bottom Left', 'meta-box' ),
|
94 |
+
'bottom_center' => esc_html__( 'Bottom Center', 'meta-box' ),
|
95 |
+
'bottom_right' => esc_html__( 'Bottom Right', 'meta-box' ),
|
96 |
+
),
|
97 |
+
) );
|
98 |
+
$output .= RWMB_Select_Field::html( $meta['position'], $position );
|
99 |
+
|
100 |
+
// Attachment.
|
101 |
+
$attachment = RWMB_Select_Field::normalize( array(
|
102 |
+
'type' => 'select',
|
103 |
+
'id' => "{$field['id']}_attachment",
|
104 |
+
'field_name' => "{$field['field_name']}[attachment]",
|
105 |
+
'placeholder' => esc_html__( '-- Background Attachment --', 'meta-box' ),
|
106 |
+
'options' => array(
|
107 |
+
'fixed' => esc_html__( 'Fixed', 'meta-box' ),
|
108 |
+
'scroll' => esc_html__( 'Scroll', 'meta-box' ),
|
109 |
+
'inherit' => esc_html__( 'Inherit', 'meta-box' ),
|
110 |
+
),
|
111 |
+
) );
|
112 |
+
$output .= RWMB_Select_Field::html( $meta['attachment'], $attachment );
|
113 |
+
|
114 |
+
// Size.
|
115 |
+
$size = RWMB_Select_Field::normalize( array(
|
116 |
+
'type' => 'select',
|
117 |
+
'id' => "{$field['id']}_size",
|
118 |
+
'field_name' => "{$field['field_name']}[size]",
|
119 |
+
'placeholder' => esc_html__( '-- Background Size --', 'meta-box' ),
|
120 |
+
'options' => array(
|
121 |
+
'inherit' => esc_html__( 'Inherit', 'meta-box' ),
|
122 |
+
'cover' => esc_html__( 'Cover', 'meta-box' ),
|
123 |
+
'contain' => esc_html__( 'Contain', 'meta-box' ),
|
124 |
+
),
|
125 |
+
) );
|
126 |
+
$output .= RWMB_Select_Field::html( $meta['size'], $size );
|
127 |
+
$output .= '</div><!-- .rwmb-background-row -->';
|
128 |
+
|
129 |
+
return $output;
|
130 |
+
}
|
131 |
+
|
132 |
+
/**
|
133 |
+
* Format value for the helper functions.
|
134 |
+
*
|
135 |
+
* @param array $field Field parameters.
|
136 |
+
* @param string|array $value The field meta value.
|
137 |
+
* @param array $args Additional arguments. Rarely used. See specific fields for details.
|
138 |
+
* @param int|null $post_id Post ID. null for current post. Optional.
|
139 |
+
*
|
140 |
+
* @return string
|
141 |
+
*/
|
142 |
+
public static function format_value( $field, $value, $args, $post_id ) {
|
143 |
+
if ( ! $field['clone'] ) {
|
144 |
+
return self::call( 'format_single_value', $field, $value, $args, $post_id );
|
145 |
+
}
|
146 |
+
$output = '<ul>';
|
147 |
+
foreach ( $value as $subvalue ) {
|
148 |
+
$output .= '<li>' . self::call( 'format_single_value', $field, $subvalue, $args, $post_id ) . '</li>';
|
149 |
+
}
|
150 |
+
$output .= '</ul>';
|
151 |
+
return $output;
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
|
157 |
+
*
|
158 |
+
* @param array $field Field parameters.
|
159 |
+
* @param string $value The value.
|
160 |
+
* @param array $args Additional arguments. Rarely used. See specific fields for details.
|
161 |
+
* @param int|null $post_id Post ID. null for current post. Optional.
|
162 |
+
*
|
163 |
+
* @return string
|
164 |
+
*/
|
165 |
+
public static function format_single_value( $field, $value, $args, $post_id ) {
|
166 |
+
$output = '';
|
167 |
+
$value = array_filter( $value );
|
168 |
+
foreach ( $value as $key => $subvalue ) {
|
169 |
+
$subvalue = 'image' === $key ? 'url( "' . esc_url( $subvalue ) . '")' : $subvalue;
|
170 |
+
$output .= 'background-' . $key . ': ' . $subvalue . ';';
|
171 |
+
}
|
172 |
+
return $output;
|
173 |
+
}
|
174 |
+
}
|
inc/fields/button-group.php
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The Button group.
|
4 |
+
*
|
5 |
+
* @package Meta Box
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Button group class.
|
10 |
+
*/
|
11 |
+
class RWMB_Button_Group_Field extends RWMB_Choice_Field {
|
12 |
+
/**
|
13 |
+
* Enqueue scripts and styles.
|
14 |
+
*/
|
15 |
+
public static function admin_enqueue_scripts() {
|
16 |
+
wp_enqueue_style( 'rwmb-button-group', RWMB_CSS_URL . 'button-group.css', '', RWMB_VER );
|
17 |
+
wp_enqueue_script( 'rwmb-button-group', RWMB_JS_URL . 'button-group.js', array(), RWMB_VER, true );
|
18 |
+
}
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Walk options.
|
22 |
+
*
|
23 |
+
* @param array $field Field parameters.
|
24 |
+
* @param mixed $options Select options.
|
25 |
+
* @param mixed $db_fields Database fields to use in the output.
|
26 |
+
* @param mixed $meta Meta value.
|
27 |
+
*
|
28 |
+
* @return string
|
29 |
+
*/
|
30 |
+
public static function walk( $field, $options, $db_fields, $meta ) {
|
31 |
+
$walker = new RWMB_Walker_Input_List( $db_fields, $field, $meta );
|
32 |
+
|
33 |
+
$output = sprintf( '<ul class="rwmb-button-input-list %s">',
|
34 |
+
$field['inline'] ? 'inline' : ''
|
35 |
+
);
|
36 |
+
$output .= $walker->walk( $options, - 1 );
|
37 |
+
$output .= '</ul>';
|
38 |
+
|
39 |
+
return $output;
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Normalize parameters for field.
|
44 |
+
*
|
45 |
+
* @param array $field Field parameters.
|
46 |
+
*
|
47 |
+
* @return array
|
48 |
+
*/
|
49 |
+
public static function normalize( $field ) {
|
50 |
+
$field = parent::normalize( $field );
|
51 |
+
$field = wp_parse_args( $field, array(
|
52 |
+
'inline' => null,
|
53 |
+
) );
|
54 |
+
|
55 |
+
$field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field;
|
56 |
+
$field = RWMB_Input_Field::normalize( $field );
|
57 |
+
|
58 |
+
$field['flatten'] = true;
|
59 |
+
$field['inline'] = ! $field['multiple'] && ! isset( $field['inline'] ) ? true : $field['inline'];
|
60 |
+
|
61 |
+
return $field;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Get the attributes for a field.
|
66 |
+
*
|
67 |
+
* @param array $field Field parameters.
|
68 |
+
* @param mixed $value Meta value.
|
69 |
+
*
|
70 |
+
* @return array
|
71 |
+
*/
|
72 |
+
public static function get_attributes( $field, $value = null ) {
|
73 |
+
$attributes = RWMB_Input_Field::get_attributes( $field, $value );
|
74 |
+
$attributes['id'] = false;
|
75 |
+
$attributes['type'] = $field['multiple'] ? 'checkbox' : 'radio';
|
76 |
+
$attributes['value'] = $value;
|
77 |
+
|
78 |
+
return $attributes;
|
79 |
+
}
|
80 |
+
}
|
inc/fields/color.php
CHANGED
@@ -13,21 +13,23 @@ class RWMB_Color_Field extends RWMB_Text_Field {
|
|
13 |
* Enqueue scripts and styles.
|
14 |
*/
|
15 |
public static function admin_enqueue_scripts() {
|
16 |
-
$args = func_get_args();
|
17 |
-
$field = $args[0];
|
18 |
-
$js_dependency = array( 'wp-color-picker' );
|
19 |
wp_enqueue_style( 'rwmb-color', RWMB_CSS_URL . 'color.css', array( 'wp-color-picker' ), RWMB_VER );
|
20 |
-
|
|
|
|
|
|
|
|
|
21 |
wp_enqueue_script( 'wp-color-picker-alpha', RWMB_JS_URL . 'wp-color-picker-alpha/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), RWMB_VER, true );
|
22 |
-
$
|
23 |
}
|
24 |
-
wp_enqueue_script( 'rwmb-color', RWMB_JS_URL . 'color.js', $
|
25 |
}
|
26 |
|
27 |
/**
|
28 |
* Normalize parameters for field.
|
29 |
*
|
30 |
* @param array $field Field parameters.
|
|
|
31 |
* @return array
|
32 |
*/
|
33 |
public static function normalize( $field ) {
|
@@ -52,11 +54,12 @@ class RWMB_Color_Field extends RWMB_Text_Field {
|
|
52 |
*
|
53 |
* @param array $field Field parameters.
|
54 |
* @param mixed $value Meta value.
|
|
|
55 |
* @return array
|
56 |
*/
|
57 |
public static function get_attributes( $field, $value = null ) {
|
58 |
-
$attributes
|
59 |
-
$attributes
|
60 |
'data-options' => wp_json_encode( $field['js_options'] ),
|
61 |
) );
|
62 |
$attributes['type'] = 'text';
|
13 |
* Enqueue scripts and styles.
|
14 |
*/
|
15 |
public static function admin_enqueue_scripts() {
|
|
|
|
|
|
|
16 |
wp_enqueue_style( 'rwmb-color', RWMB_CSS_URL . 'color.css', array( 'wp-color-picker' ), RWMB_VER );
|
17 |
+
|
18 |
+
$dependencies = array( 'wp-color-picker' );
|
19 |
+
$args = func_get_args();
|
20 |
+
$field = reset( $args );
|
21 |
+
if ( ! empty( $field['alpha_channel'] ) ) {
|
22 |
wp_enqueue_script( 'wp-color-picker-alpha', RWMB_JS_URL . 'wp-color-picker-alpha/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), RWMB_VER, true );
|
23 |
+
$dependencies = array( 'wp-color-picker-alpha' );
|
24 |
}
|
25 |
+
wp_enqueue_script( 'rwmb-color', RWMB_JS_URL . 'color.js', $dependencies, RWMB_VER, true );
|
26 |
}
|
27 |
|
28 |
/**
|
29 |
* Normalize parameters for field.
|
30 |
*
|
31 |
* @param array $field Field parameters.
|
32 |
+
*
|
33 |
* @return array
|
34 |
*/
|
35 |
public static function normalize( $field ) {
|
54 |
*
|
55 |
* @param array $field Field parameters.
|
56 |
* @param mixed $value Meta value.
|
57 |
+
*
|
58 |
* @return array
|
59 |
*/
|
60 |
public static function get_attributes( $field, $value = null ) {
|
61 |
+
$attributes = parent::get_attributes( $field, $value );
|
62 |
+
$attributes = wp_parse_args( $attributes, array(
|
63 |
'data-options' => wp_json_encode( $field['js_options'] ),
|
64 |
) );
|
65 |
$attributes['type'] = 'text';
|
inc/fields/file-input.php
CHANGED
@@ -32,7 +32,7 @@ class RWMB_File_Input_Field extends RWMB_Input_Field {
|
|
32 |
$attributes = self::get_attributes( $field, $meta );
|
33 |
return sprintf(
|
34 |
'<input %s>
|
35 |
-
<a href="#" class="rwmb-file-input-select button
|
36 |
<a href="#" class="rwmb-file-input-remove button %s">%s</a>',
|
37 |
self::render_attributes( $attributes ),
|
38 |
esc_html__( 'Select', 'meta-box' ),
|
32 |
$attributes = self::get_attributes( $field, $meta );
|
33 |
return sprintf(
|
34 |
'<input %s>
|
35 |
+
<a href="#" class="rwmb-file-input-select button">%s</a>
|
36 |
<a href="#" class="rwmb-file-input-remove button %s">%s</a>',
|
37 |
self::render_attributes( $attributes ),
|
38 |
esc_html__( 'Select', 'meta-box' ),
|
inc/fields/input-list.php
CHANGED
@@ -87,7 +87,7 @@ class RWMB_Input_List_Field extends RWMB_Choice_Field {
|
|
87 |
*/
|
88 |
public static function get_select_all_html( $field ) {
|
89 |
if ( $field['multiple'] && $field['select_all_none'] ) {
|
90 |
-
return sprintf( '<p><button class="rwmb-input-list-select-all-none button" data-name="%s">%s</button></p>', $field['id'], __( 'Select All / None','meta-box' ) );
|
91 |
}
|
92 |
return '';
|
93 |
}
|
87 |
*/
|
88 |
public static function get_select_all_html( $field ) {
|
89 |
if ( $field['multiple'] && $field['select_all_none'] ) {
|
90 |
+
return sprintf( '<p><button class="rwmb-input-list-select-all-none button" data-name="%s">%s</button></p>', $field['id'], __( 'Select All / None', 'meta-box' ) );
|
91 |
}
|
92 |
return '';
|
93 |
}
|
inc/fields/media.php
CHANGED
@@ -56,7 +56,7 @@ class RWMB_Media_Field extends RWMB_File_Field {
|
|
56 |
public static function html( $meta, $field ) {
|
57 |
$meta = (array) $meta;
|
58 |
$meta = implode( ',', $meta );
|
59 |
-
$attributes = self::
|
60 |
|
61 |
$html = sprintf(
|
62 |
'<input %s data-options="%s">',
|
56 |
public static function html( $meta, $field ) {
|
57 |
$meta = (array) $meta;
|
58 |
$meta = implode( ',', $meta );
|
59 |
+
$attributes = self::call( 'get_attributes', $field, $meta );
|
60 |
|
61 |
$html = sprintf(
|
62 |
'<input %s data-options="%s">',
|
inc/fields/post.php
CHANGED
@@ -84,12 +84,7 @@ class RWMB_Post_Field extends RWMB_Object_Choice_Field {
|
|
84 |
* @return mixed
|
85 |
*/
|
86 |
public static function meta( $post_id, $saved, $field ) {
|
87 |
-
|
88 |
-
$post = get_post( $post_id );
|
89 |
-
return $post->post_parent;
|
90 |
-
}
|
91 |
-
|
92 |
-
return parent::meta( $post_id, $saved, $field );
|
93 |
}
|
94 |
|
95 |
/**
|
84 |
* @return mixed
|
85 |
*/
|
86 |
public static function meta( $post_id, $saved, $field ) {
|
87 |
+
return $field['parent'] ? wp_get_post_parent_id( $post_id ) : parent::meta( $post_id, $saved, $field );
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
|
90 |
/**
|
inc/fields/single-image.php
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The advanced image upload field which uses WordPress media popup to upload and select images.
|
4 |
+
*
|
5 |
+
* @package Meta Box
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Image advanced field class.
|
10 |
+
*/
|
11 |
+
class RWMB_Single_Image_Field extends RWMB_Image_Advanced_Field {
|
12 |
+
/**
|
13 |
+
* Normalize parameters for field.
|
14 |
+
*
|
15 |
+
* @param array $field Field parameters.
|
16 |
+
*
|
17 |
+
* @return array
|
18 |
+
*/
|
19 |
+
public static function normalize( $field ) {
|
20 |
+
$field['max_file_uploads'] = 1;
|
21 |
+
$field['max_status'] = false;
|
22 |
+
|
23 |
+
$field = parent::normalize( $field );
|
24 |
+
|
25 |
+
$field['attributes'] = wp_parse_args( $field['attributes'], array(
|
26 |
+
'class' => '',
|
27 |
+
'data-single-image' => 1,
|
28 |
+
) );
|
29 |
+
|
30 |
+
$field['attributes']['class'] .= ' rwmb-image_advanced';
|
31 |
+
$field['multiple'] = false;
|
32 |
+
|
33 |
+
return $field;
|
34 |
+
}
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Get meta values to save.
|
38 |
+
*
|
39 |
+
* @param mixed $new The submitted meta value.
|
40 |
+
* @param mixed $old The existing meta value.
|
41 |
+
* @param int $post_id The post ID.
|
42 |
+
* @param array $field The field parameters.
|
43 |
+
*
|
44 |
+
* @return array|mixed
|
45 |
+
*/
|
46 |
+
public static function value( $new, $old, $post_id, $field ) {
|
47 |
+
return $new;
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* Get the field value. Return meaningful info of the files.
|
52 |
+
*
|
53 |
+
* @param array $field Field parameters.
|
54 |
+
* @param array $args Not used for this field.
|
55 |
+
* @param int|null $post_id Post ID. null for current post. Optional.
|
56 |
+
*
|
57 |
+
* @return mixed Full info of uploaded files
|
58 |
+
*/
|
59 |
+
public static function get_value( $field, $args = array(), $post_id = null ) {
|
60 |
+
$value = RWMB_Field::get_value( $field, $args, $post_id );
|
61 |
+
$return = RWMB_Image_Field::file_info( $value, $args );
|
62 |
+
return $return;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
|
67 |
+
*
|
68 |
+
* @param array $field Field parameters.
|
69 |
+
* @param array $value The field value.
|
70 |
+
* @param array $args Additional arguments. Rarely used. See specific fields for details.
|
71 |
+
* @param int|null $post_id Post ID. null for current post. Optional.
|
72 |
+
*
|
73 |
+
* @return string
|
74 |
+
*/
|
75 |
+
public static function format_single_value( $field, $value, $args, $post_id ) {
|
76 |
+
$img = sprintf( '<img src="%s" alt="%s">', esc_url( $value['url'] ), esc_attr( $value['alt'] ) );
|
77 |
+
|
78 |
+
// Link thumbnail to full size image?
|
79 |
+
if ( isset( $args['link'] ) && $args['link'] ) {
|
80 |
+
$img = sprintf( '<a href="%s" title="%s">%s</a>', esc_url( $value['full_url'] ), esc_attr( $value['title'] ), $img );
|
81 |
+
}
|
82 |
+
return $img;
|
83 |
+
}
|
84 |
+
}
|
inc/fields/switch.php
ADDED
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* The Switch field.
|
4 |
+
*
|
5 |
+
* @package Meta Box
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Switch field class.
|
10 |
+
*/
|
11 |
+
class RWMB_Switch_Field extends RWMB_Input_Field {
|
12 |
+
/**
|
13 |
+
* Enqueue scripts and styles.
|
14 |
+
*/
|
15 |
+
public static function admin_enqueue_scripts() {
|
16 |
+
wp_enqueue_style( 'rwmb-switch', RWMB_CSS_URL . 'switch.css', '', RWMB_VER );
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Get field HTML.
|
21 |
+
*
|
22 |
+
* @param mixed $meta Meta value.
|
23 |
+
* @param array $field Field parameters.
|
24 |
+
*
|
25 |
+
* @return string
|
26 |
+
*/
|
27 |
+
public static function html( $meta, $field ) {
|
28 |
+
$attributes = self::get_attributes( $field, 1 );
|
29 |
+
$output = sprintf(
|
30 |
+
'<label class="rwmb-switch-label rwmb-switch-label--' . esc_attr( $field['style'] ) . '">
|
31 |
+
<input %s %s>
|
32 |
+
<div class="rwmb-switch-status">
|
33 |
+
<span class="rwmb-switch-slider"></span>
|
34 |
+
<span class="rwmb-switch-on">' . $field['on_label'] . '</span>
|
35 |
+
<span class="rwmb-switch-off">' . $field['off_label'] . '</span>
|
36 |
+
</div>
|
37 |
+
</label>
|
38 |
+
',
|
39 |
+
self::render_attributes( $attributes ),
|
40 |
+
checked( ! empty( $meta ), 1, false )
|
41 |
+
);
|
42 |
+
|
43 |
+
return $output;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Normalize parameters for field.
|
48 |
+
*
|
49 |
+
* @param array $field Field parameters.
|
50 |
+
*
|
51 |
+
* @return array
|
52 |
+
*/
|
53 |
+
public static function normalize( $field ) {
|
54 |
+
$field = parent::normalize( $field );
|
55 |
+
$field = wp_parse_args( $field, array(
|
56 |
+
'style' => 'rounded',
|
57 |
+
'on_label' => '',
|
58 |
+
'off_label' => '',
|
59 |
+
) );
|
60 |
+
|
61 |
+
return $field;
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Get the attributes for a field.
|
66 |
+
*
|
67 |
+
* @param array $field The field parameters.
|
68 |
+
* @param mixed $value The attribute value.
|
69 |
+
*
|
70 |
+
* @return array
|
71 |
+
*/
|
72 |
+
public static function get_attributes( $field, $value = null ) {
|
73 |
+
$attributes = parent::get_attributes( $field, $value );
|
74 |
+
$attributes['type'] = 'checkbox';
|
75 |
+
|
76 |
+
return $attributes;
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
|
81 |
+
*
|
82 |
+
* @param array $field Field parameters.
|
83 |
+
* @param string $value The value.
|
84 |
+
* @param array $args Additional arguments. Rarely used. See specific fields for details.
|
85 |
+
* @param int|null $post_id Post ID. null for current post. Optional.
|
86 |
+
*
|
87 |
+
* @return string
|
88 |
+
*/
|
89 |
+
public static function format_single_value( $field, $value, $args, $post_id ) {
|
90 |
+
$on = $field['on_label'] ? $field['on_label'] : __( 'On', 'meta-box' );
|
91 |
+
$off = $field['off_label'] ? $field['on_label'] : __( 'Off', 'meta-box' );
|
92 |
+
return $value ? $on : $off;
|
93 |
+
}
|
94 |
+
}
|
inc/fields/wysiwyg.php
CHANGED
@@ -34,7 +34,7 @@ class RWMB_Wysiwyg_Field extends RWMB_Field {
|
|
34 |
* @return string
|
35 |
*/
|
36 |
public static function value( $new, $old, $post_id, $field ) {
|
37 |
-
return
|
38 |
}
|
39 |
|
40 |
/**
|
34 |
* @return string
|
35 |
*/
|
36 |
public static function value( $new, $old, $post_id, $field ) {
|
37 |
+
return $field['raw'] ? $new : wpautop( $new );
|
38 |
}
|
39 |
|
40 |
/**
|
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', '4.
|
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', '4.13.0' );
|
22 |
|
23 |
list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
|
24 |
|
inc/meta-box-registry.php
CHANGED
@@ -37,6 +37,28 @@ class RWMB_Meta_Box_Registry {
|
|
37 |
return isset( $this->data[ $id ] ) ? $this->data[ $id ] : false;
|
38 |
}
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
/**
|
41 |
* Retrieve all meta boxes.
|
42 |
*
|
37 |
return isset( $this->data[ $id ] ) ? $this->data[ $id ] : false;
|
38 |
}
|
39 |
|
40 |
+
/**
|
41 |
+
* Get meta boxes under some conditions.
|
42 |
+
*
|
43 |
+
* @param array $args Custom argument to get meta boxes by.
|
44 |
+
*
|
45 |
+
* @return array
|
46 |
+
*/
|
47 |
+
public function get_by( $args ) {
|
48 |
+
$meta_boxes = $this->data;
|
49 |
+
foreach ( $meta_boxes as $index => $meta_box ) {
|
50 |
+
foreach ( $args as $key => $value ) {
|
51 |
+
$meta_box_key = 'object_type' === $key ? $meta_box->get_object_type() : $meta_box->$key;
|
52 |
+
if ( $meta_box_key !== $value ) {
|
53 |
+
unset( $meta_boxes[ $index ] );
|
54 |
+
continue 2; // Skip the meta box loop.
|
55 |
+
}
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
return $meta_boxes;
|
60 |
+
}
|
61 |
+
|
62 |
/**
|
63 |
* Retrieve all meta boxes.
|
64 |
*
|
inc/meta-box.php
CHANGED
@@ -58,6 +58,9 @@ class RW_Meta_Box {
|
|
58 |
}
|
59 |
|
60 |
$this->meta_box['fields'] = self::normalize_fields( $meta_box['fields'], $storage );
|
|
|
|
|
|
|
61 |
if ( $this->is_shown() ) {
|
62 |
$this->global_hooks();
|
63 |
$this->object_hooks();
|
@@ -141,6 +144,10 @@ class RW_Meta_Box {
|
|
141 |
wp_enqueue_style( 'rwmb-rtl', RWMB_CSS_URL . 'style-rtl.css', array(), RWMB_VER );
|
142 |
}
|
143 |
|
|
|
|
|
|
|
|
|
144 |
// Load clone script conditionally.
|
145 |
foreach ( $this->fields as $field ) {
|
146 |
if ( $field['clone'] ) {
|
@@ -208,7 +215,8 @@ class RW_Meta_Box {
|
|
208 |
|
209 |
// Container.
|
210 |
printf(
|
211 |
-
'<div class="rwmb-meta-box" data-autosave="%s" data-object-type="%s">',
|
|
|
212 |
esc_attr( $this->autosave ? 'true' : 'false' ),
|
213 |
esc_attr( $this->object_type )
|
214 |
);
|
@@ -303,8 +311,7 @@ class RW_Meta_Box {
|
|
303 |
public function validate() {
|
304 |
$nonce = filter_input( INPUT_POST, "nonce_{$this->id}", FILTER_SANITIZE_STRING );
|
305 |
|
306 |
-
return
|
307 |
-
! $this->saved
|
308 |
&& ( ! defined( 'DOING_AUTOSAVE' ) || $this->autosave )
|
309 |
&& wp_verify_nonce( $nonce, "rwmb-save-{$this->id}" );
|
310 |
}
|
@@ -325,6 +332,7 @@ class RW_Meta_Box {
|
|
325 |
'post_types' => 'post',
|
326 |
'autosave' => false,
|
327 |
'default_hidden' => false,
|
|
|
328 |
) );
|
329 |
|
330 |
/**
|
58 |
}
|
59 |
|
60 |
$this->meta_box['fields'] = self::normalize_fields( $meta_box['fields'], $storage );
|
61 |
+
|
62 |
+
$this->meta_box = apply_filters( 'rwmb_meta_box_settings', $this->meta_box );
|
63 |
+
|
64 |
if ( $this->is_shown() ) {
|
65 |
$this->global_hooks();
|
66 |
$this->object_hooks();
|
144 |
wp_enqueue_style( 'rwmb-rtl', RWMB_CSS_URL . 'style-rtl.css', array(), RWMB_VER );
|
145 |
}
|
146 |
|
147 |
+
if ( 'seamless' === $this->style ) {
|
148 |
+
wp_enqueue_script( 'rwmb', RWMB_JS_URL . 'script.js', array( 'jquery' ), RWMB_VER, true );
|
149 |
+
}
|
150 |
+
|
151 |
// Load clone script conditionally.
|
152 |
foreach ( $this->fields as $field ) {
|
153 |
if ( $field['clone'] ) {
|
215 |
|
216 |
// Container.
|
217 |
printf(
|
218 |
+
'<div class="rwmb-meta-box%s" data-autosave="%s" data-object-type="%s">',
|
219 |
+
esc_attr( 'seamless' === $this->style ? ' rwmb-meta-box--seamless' : '' ),
|
220 |
esc_attr( $this->autosave ? 'true' : 'false' ),
|
221 |
esc_attr( $this->object_type )
|
222 |
);
|
311 |
public function validate() {
|
312 |
$nonce = filter_input( INPUT_POST, "nonce_{$this->id}", FILTER_SANITIZE_STRING );
|
313 |
|
314 |
+
return ! $this->saved
|
|
|
315 |
&& ( ! defined( 'DOING_AUTOSAVE' ) || $this->autosave )
|
316 |
&& wp_verify_nonce( $nonce, "rwmb-save-{$this->id}" );
|
317 |
}
|
332 |
'post_types' => 'post',
|
333 |
'autosave' => false,
|
334 |
'default_hidden' => false,
|
335 |
+
'style' => 'default',
|
336 |
) );
|
337 |
|
338 |
/**
|
inc/walkers/select.php
CHANGED
@@ -29,7 +29,7 @@ class RWMB_Walker_Select extends RWMB_Walker_Base {
|
|
29 |
$output .= sprintf(
|
30 |
'<option value="%s" %s>%s%s</option>',
|
31 |
esc_attr( $object->$id ),
|
32 |
-
selected( in_array(
|
33 |
$indent,
|
34 |
esc_html( RWMB_Field::filter( 'choice_label', $object->$label, $this->field, $object ) )
|
35 |
);
|
29 |
$output .= sprintf(
|
30 |
'<option value="%s" %s>%s%s</option>',
|
31 |
esc_attr( $object->$id ),
|
32 |
+
selected( in_array( $object->$id, $meta ), true, false ),
|
33 |
$indent,
|
34 |
esc_html( RWMB_Field::filter( 'choice_label', $object->$label, $this->field, $object ) )
|
35 |
);
|
js/button-group.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( function ( $ ) {
|
2 |
+
'use strict';
|
3 |
+
|
4 |
+
// Check initial status.
|
5 |
+
function CheckInput() {
|
6 |
+
var $this = $( this ),
|
7 |
+
$input = $this.find( 'input' ),
|
8 |
+
$label = $input.parent(),
|
9 |
+
type = $input.attr( 'type' );
|
10 |
+
|
11 |
+
if ( $input.prop( 'checked' ) ) {
|
12 |
+
$label.addClass( 'selected' );
|
13 |
+
}
|
14 |
+
}
|
15 |
+
$( '.rwmb-button-input-list li' ).each( CheckInput );
|
16 |
+
|
17 |
+
// Toggle status when click.
|
18 |
+
function InputClick() {
|
19 |
+
var $this = $( this ),
|
20 |
+
$input = $this.find( 'input' ),
|
21 |
+
$label = $input.parent(),
|
22 |
+
type = $input.attr( 'type' ),
|
23 |
+
parent_label = $( this ).parent().find( 'label' );
|
24 |
+
|
25 |
+
if ( ! $input.prop( 'checked' ) ) {
|
26 |
+
$label.removeClass( 'selected' );
|
27 |
+
return;
|
28 |
+
}
|
29 |
+
|
30 |
+
$label.addClass( 'selected' );
|
31 |
+
|
32 |
+
if ( 'radio' === type ) {
|
33 |
+
parent_label.removeClass( 'selected' );
|
34 |
+
$label.addClass( 'selected' );
|
35 |
+
}
|
36 |
+
}
|
37 |
+
$( document ).on( 'click', '.rwmb-button-input-list li', InputClick );
|
38 |
+
$( document ).on( 'clone', '.rwmb-button-input-list', CheckInput );
|
39 |
+
} );
|
js/clone.js
CHANGED
@@ -14,7 +14,7 @@ jQuery( function ( $ ) {
|
|
14 |
var $field = $( this );
|
15 |
|
16 |
// Name attribute
|
17 |
-
var name =
|
18 |
if ( name && ! $field.closest( '.rwmb-group-clone' ).length ) {
|
19 |
$field.attr( 'name', cloneIndex.replace( index, name, '[', ']', false ) );
|
20 |
}
|
@@ -137,23 +137,26 @@ jQuery( function ( $ ) {
|
|
137 |
var $last = $container.children( '.rwmb-clone' ).last(),
|
138 |
$clone = $last.clone(),
|
139 |
inputSelectors = 'input[class*="rwmb"], textarea[class*="rwmb"], select[class*="rwmb"], button[class*="rwmb"]',
|
140 |
-
$inputs = $clone.find( inputSelectors ),
|
141 |
nextIndex = cloneIndex.nextIndex( $container );
|
142 |
|
143 |
-
// Reset value for fields
|
144 |
-
$inputs.each( cloneValue.reset );
|
145 |
-
|
146 |
// Insert Clone
|
147 |
$clone.insertAfter( $last );
|
148 |
|
149 |
// Trigger custom event for the clone instance. Required for Group extension to update sub fields.
|
150 |
$clone.trigger( 'clone_instance', nextIndex );
|
151 |
|
|
|
|
|
|
|
|
|
152 |
// Set fields index. Must run before trigger clone event.
|
153 |
cloneIndex.set( $inputs, nextIndex );
|
154 |
|
155 |
-
// Trigger custom clone event
|
156 |
$inputs.trigger( 'clone', nextIndex );
|
|
|
|
|
|
|
157 |
}
|
158 |
|
159 |
/**
|
14 |
var $field = $( this );
|
15 |
|
16 |
// Name attribute
|
17 |
+
var name = this.name;
|
18 |
if ( name && ! $field.closest( '.rwmb-group-clone' ).length ) {
|
19 |
$field.attr( 'name', cloneIndex.replace( index, name, '[', ']', false ) );
|
20 |
}
|
137 |
var $last = $container.children( '.rwmb-clone' ).last(),
|
138 |
$clone = $last.clone(),
|
139 |
inputSelectors = 'input[class*="rwmb"], textarea[class*="rwmb"], select[class*="rwmb"], button[class*="rwmb"]',
|
|
|
140 |
nextIndex = cloneIndex.nextIndex( $container );
|
141 |
|
|
|
|
|
|
|
142 |
// Insert Clone
|
143 |
$clone.insertAfter( $last );
|
144 |
|
145 |
// Trigger custom event for the clone instance. Required for Group extension to update sub fields.
|
146 |
$clone.trigger( 'clone_instance', nextIndex );
|
147 |
|
148 |
+
// Reset value for fields
|
149 |
+
var $inputs = $clone.find( inputSelectors );
|
150 |
+
$inputs.each( cloneValue.reset );
|
151 |
+
|
152 |
// Set fields index. Must run before trigger clone event.
|
153 |
cloneIndex.set( $inputs, nextIndex );
|
154 |
|
155 |
+
// Trigger custom clone event.
|
156 |
$inputs.trigger( 'clone', nextIndex );
|
157 |
+
|
158 |
+
// After cloning fields.
|
159 |
+
$inputs.trigger( 'after_clone', nextIndex );
|
160 |
}
|
161 |
|
162 |
/**
|
js/date.js
CHANGED
@@ -23,6 +23,10 @@ jQuery( function ( $ ) {
|
|
23 |
if ( $inline.length ) {
|
24 |
options.altField = '#' + $this.attr( 'id' );
|
25 |
$this.on( 'keydown', _.debounce( function () {
|
|
|
|
|
|
|
|
|
26 |
$picker
|
27 |
.datepicker( 'setDate', $this.val() )
|
28 |
.find( ".ui-datepicker-current-day" )
|
23 |
if ( $inline.length ) {
|
24 |
options.altField = '#' + $this.attr( 'id' );
|
25 |
$this.on( 'keydown', _.debounce( function () {
|
26 |
+
// if val is empty, return to allow empty datepicker input.
|
27 |
+
if ( !$this.val() ) {
|
28 |
+
return;
|
29 |
+
}
|
30 |
$picker
|
31 |
.datepicker( 'setDate', $this.val() )
|
32 |
.find( ".ui-datepicker-current-day" )
|
js/image-advanced.js
CHANGED
@@ -30,11 +30,18 @@ jQuery( function ( $ ) {
|
|
30 |
*/
|
31 |
function initImageField() {
|
32 |
var view = new ImageField( { input: this } );
|
33 |
-
//Remove old then add new
|
34 |
-
$( this ).siblings( 'div.rwmb-media-view' ).remove();
|
35 |
$( this ).after( view.el );
|
36 |
}
|
37 |
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
} );
|
30 |
*/
|
31 |
function initImageField() {
|
32 |
var view = new ImageField( { input: this } );
|
|
|
|
|
33 |
$( this ).after( view.el );
|
34 |
}
|
35 |
|
36 |
+
/**
|
37 |
+
* Remove views for uploaded images.
|
38 |
+
*/
|
39 |
+
function removeView() {
|
40 |
+
$( this ).find( '.rwmb-media-view' ).remove();
|
41 |
+
}
|
42 |
+
|
43 |
+
$( '.rwmb-image_advanced' ).each( initImageField );
|
44 |
+
$( document )
|
45 |
+
.on( 'clone_instance', '.rwmb-image_advanced-clone, .rwmb-single_image-clone', removeView )
|
46 |
+
.on( 'after_clone', '.rwmb-image_advanced', initImageField );
|
47 |
} );
|
js/media.js
CHANGED
@@ -120,11 +120,17 @@ jQuery( function ( $ ) {
|
|
120 |
MediaField = views.MediaField = Backbone.View.extend( {
|
121 |
className: 'rwmb-media-view',
|
122 |
initialize: function ( options ) {
|
123 |
-
var that = this
|
|
|
124 |
this.$input = $( options.input );
|
|
|
|
|
|
|
|
|
|
|
125 |
this.controller = new Controller( _.extend(
|
126 |
{
|
127 |
-
fieldName:
|
128 |
ids: this.$input.val().split( ',' )
|
129 |
},
|
130 |
this.$input.data( 'options' )
|
120 |
MediaField = views.MediaField = Backbone.View.extend( {
|
121 |
className: 'rwmb-media-view',
|
122 |
initialize: function ( options ) {
|
123 |
+
var that = this,
|
124 |
+
fieldName = options.input.name;
|
125 |
this.$input = $( options.input );
|
126 |
+
|
127 |
+
if ( 1 != this.$input.attr( 'data-single-image' ) ) {
|
128 |
+
fieldName += '[]';
|
129 |
+
}
|
130 |
+
|
131 |
this.controller = new Controller( _.extend(
|
132 |
{
|
133 |
+
fieldName: fieldName,
|
134 |
ids: this.$input.val().split( ',' )
|
135 |
},
|
136 |
this.$input.data( 'options' )
|
js/script.js
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
1 |
+
jQuery( function ( $ ) {
|
2 |
+
// Add class for seamless meta boxes.
|
3 |
+
$( '.rwmb-meta-box--seamless' ).closest( '.postbox' ).addClass( 'rwmb-seamless' );
|
4 |
+
} );
|
languages/meta-box-it_IT.mo
CHANGED
Binary file
|
languages/meta-box-it_IT.po
CHANGED
@@ -1,126 +1,318 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
-
"Project-Id-Version: Meta Box
|
4 |
-
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date:
|
6 |
-
"PO-Revision-Date:
|
7 |
-
"Last-Translator:
|
8 |
-
"Language-Team:
|
|
|
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: __;_n
|
13 |
-
"
|
14 |
-
"X-Poedit-
|
15 |
-
"X-Poedit-
|
16 |
-
"X-
|
17 |
-
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
18 |
-
"X-Poedit-SearchPath-0:
|
19 |
-
"X-Poedit-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
-
#:
|
26 |
-
msgid "
|
|
|
|
|
27 |
msgstr ""
|
28 |
|
29 |
-
#:
|
30 |
-
msgid "
|
31 |
msgstr ""
|
32 |
|
33 |
-
#:
|
34 |
-
msgid "
|
35 |
-
msgstr "
|
36 |
|
37 |
-
#:
|
38 |
-
msgid "
|
39 |
-
msgstr "
|
40 |
|
41 |
-
#:
|
42 |
-
|
43 |
-
|
44 |
-
msgstr "Carica i files"
|
45 |
|
46 |
-
#:
|
47 |
-
|
48 |
-
|
49 |
-
msgstr "Elimina file"
|
50 |
|
51 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
msgctxt "file upload"
|
53 |
msgid "Delete"
|
54 |
msgstr "Elimina"
|
55 |
|
56 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
msgctxt "file upload"
|
58 |
-
msgid "
|
59 |
-
msgstr "
|
60 |
|
61 |
-
#:
|
62 |
msgctxt "file upload"
|
63 |
-
msgid "
|
64 |
-
msgstr "
|
65 |
|
66 |
-
#:
|
67 |
-
|
68 |
-
|
|
|
69 |
|
70 |
-
#:
|
71 |
-
|
72 |
-
|
73 |
-
msgid "Uploaded files"
|
74 |
-
msgstr "Files caricati"
|
75 |
|
76 |
-
#:
|
77 |
-
|
78 |
-
|
79 |
-
msgid "Delete this file"
|
80 |
-
msgstr "Elimina file"
|
81 |
|
82 |
-
#:
|
83 |
-
|
84 |
-
|
85 |
-
msgid "Delete"
|
86 |
-
msgstr "Cancella"
|
87 |
|
88 |
-
#:
|
89 |
-
|
90 |
-
|
91 |
-
msgid "Edit"
|
92 |
-
msgstr ""
|
93 |
|
94 |
-
#:
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
msgstr "Carica files"
|
99 |
|
100 |
-
#:
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
msgstr "Aggiungi altro file"
|
105 |
|
106 |
-
#:
|
107 |
-
msgctxt "
|
108 |
-
msgid "
|
109 |
-
msgstr ""
|
110 |
|
111 |
-
#:
|
112 |
-
msgctxt "
|
113 |
-
msgid "
|
114 |
-
msgstr ""
|
115 |
|
116 |
-
#:
|
117 |
-
msgctxt "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
msgid "or"
|
119 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
|
121 |
-
#:
|
122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
msgctxt "image upload"
|
124 |
-
msgid "
|
125 |
-
msgstr "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
|
|
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
+
"Project-Id-Version: Meta Box 4.8.7\n"
|
4 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/meta-box\n"
|
5 |
+
"POT-Creation-Date: 2017-12-14 12:13+0100\n"
|
6 |
+
"PO-Revision-Date: 2017-12-14 13:06+0100\n"
|
7 |
+
"Last-Translator: Giacomo Antolini <giacomo.antolini@gmail.com>\n"
|
8 |
+
"Language-Team: Meta Box <admin@metabox.io>\n"
|
9 |
+
"Language: it_IT\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Poedit-KeywordsList: __;_x;_e;_ex;_n;_nx;esc_attr__;esc_attr_e;esc_attr_x;"
|
14 |
+
"esc_html__;esc_html_e;esc_html_x;_n_noop;_nx_noop\n"
|
15 |
+
"X-Poedit-Basepath: ..\n"
|
16 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
+
"X-Generator: Poedit 2.0.4\n"
|
18 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19 |
+
"X-Poedit-SearchPath-0: .\n"
|
20 |
+
"X-Poedit-SearchPathExcluded-0: js\n"
|
21 |
+
"X-Poedit-SearchPathExcluded-1: demo\n"
|
22 |
+
"X-Poedit-SearchPathExcluded-2: tests\n"
|
23 |
+
"X-Poedit-SearchPathExcluded-3: css\n"
|
24 |
+
"X-Poedit-SearchPathExcluded-4: lang\n"
|
25 |
+
|
26 |
+
#: inc/about/about.php:50
|
27 |
+
msgid "About"
|
28 |
+
msgstr "Informazioni"
|
29 |
+
|
30 |
+
#: inc/about/about.php:59 inc/about/about.php:60
|
31 |
+
msgid "Welcome to Meta Box"
|
32 |
+
msgstr "Benvenuto su Meta Box"
|
33 |
+
|
34 |
+
#: inc/about/sections/getting-started.php:13
|
35 |
+
msgid "Getting Started With Online Generator"
|
36 |
+
msgstr "Inizia Con Il Generatore Online"
|
37 |
+
|
38 |
+
#: inc/about/sections/getting-started.php:14
|
39 |
+
msgid ""
|
40 |
+
"The fastest way to getting started with Meta Box is use our online generator "
|
41 |
+
"to generate meta boxes with custom fields. It provides a friendly UI for you "
|
42 |
+
"to create meta boxes and custom fields just by drag and drop fields."
|
43 |
+
msgstr ""
|
44 |
+
"Il modo più facile per iniziare con Meta Box è utilizzando il nostro "
|
45 |
+
"generatore online. Fornisce una semplice interfaccia grafica che permette di "
|
46 |
+
"creare le meta box e i campi personalizzati tramite il drag-and-drop."
|
47 |
+
|
48 |
+
#: inc/about/sections/getting-started.php:16
|
49 |
+
msgid "online generator"
|
50 |
+
msgstr "generatore online"
|
51 |
+
|
52 |
+
#: inc/about/sections/getting-started.php:18
|
53 |
+
msgid "Go to Online Generator"
|
54 |
+
msgstr "Vai al Generatore Online"
|
55 |
+
|
56 |
+
#: inc/about/sections/getting-started.php:22
|
57 |
+
msgid "Understand The Basics"
|
58 |
+
msgstr "Capire Le Basi"
|
59 |
+
|
60 |
+
#: inc/about/sections/getting-started.php:23
|
61 |
+
msgid ""
|
62 |
+
"Meta Box doesn't have any admin page for configuration or settings. Instead "
|
63 |
+
"of that, it provides a very powerful API to speed up the process of creating "
|
64 |
+
"meta boxes and custom fields. It might take you a little time at first, but "
|
65 |
+
"then you'll love the way it work because it helps you do and customize "
|
66 |
+
"almost everything."
|
67 |
msgstr ""
|
68 |
+
"Meta Box non ha una pagina di gestione per la configurazione e le "
|
69 |
+
"impostazioni. Al suo posto, fornisce delle potenti API per velocizzare il "
|
70 |
+
"processo di creazione delle meta box e dei campi personalizzati. Può "
|
71 |
+
"richiedere un po’ di tempo all’inizio, ma poi amerai il modo in cui funziona "
|
72 |
+
"perché ti dà la possibilità di personalizzare quasi tutto."
|
73 |
+
|
74 |
+
#: inc/about/sections/getting-started.php:24
|
75 |
+
msgid "Learn More"
|
76 |
+
msgstr "Scopri di Più"
|
77 |
+
|
78 |
+
#: inc/about/sections/getting-started.php:26 inc/core.php:39
|
79 |
+
msgid "Extensions"
|
80 |
+
msgstr "Estensioni"
|
81 |
|
82 |
+
#: inc/about/sections/getting-started.php:27
|
83 |
+
msgid ""
|
84 |
+
"Wanna see more features that transform your WordPress website into a "
|
85 |
+
"powerful CMS? Check out some extensions below:"
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: inc/about/sections/getting-started.php:29
|
89 |
+
msgid "Meta Box Group"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: inc/about/sections/getting-started.php:30
|
93 |
+
msgid "Meta Box Conditional Logic"
|
94 |
+
msgstr ""
|
95 |
|
96 |
+
#: inc/about/sections/getting-started.php:31
|
97 |
+
msgid "MB Settings Page"
|
98 |
+
msgstr ""
|
99 |
|
100 |
+
#: inc/about/sections/getting-started.php:32
|
101 |
+
msgid "MB Term Meta"
|
102 |
+
msgstr ""
|
|
|
103 |
|
104 |
+
#: inc/about/sections/getting-started.php:34
|
105 |
+
msgid "More Extensions"
|
106 |
+
msgstr "Altre Estensioni"
|
|
|
107 |
|
108 |
+
#: inc/about/sections/getting-started.php:39
|
109 |
+
msgid "Go to MetaBox.IO →"
|
110 |
+
msgstr "Vai su MetaBox.IO →"
|
111 |
+
|
112 |
+
#: inc/about/sections/tabs.php:11
|
113 |
+
msgid "Getting Started"
|
114 |
+
msgstr "Inizia"
|
115 |
+
|
116 |
+
#: inc/about/sections/welcome.php:13
|
117 |
+
#, php-format
|
118 |
+
msgid "Welcome to %1$s %2$s"
|
119 |
+
msgstr "Benvenuto su %1$s %2$s"
|
120 |
+
|
121 |
+
#: inc/about/sections/welcome.php:16
|
122 |
+
msgid ""
|
123 |
+
"This plugin is a lightweight and powerful toolkit that helps you to create "
|
124 |
+
"custom meta boxes and custom fields in WordPress fast and easy. Follow the "
|
125 |
+
"instruction below to get started."
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
#: inc/core.php:38
|
129 |
+
msgid "Documentation"
|
130 |
+
msgstr "Documentazione"
|
131 |
+
|
132 |
+
#: inc/field.php:356
|
133 |
+
msgid "+ Add more"
|
134 |
+
msgstr "+ Aggiungine altre"
|
135 |
+
|
136 |
+
#: inc/fields/autocomplete.php:20 inc/fields/autocomplete.php:81
|
137 |
+
#: inc/fields/autocomplete.php:93
|
138 |
+
msgid "Delete"
|
139 |
+
msgstr "Elimina"
|
140 |
+
|
141 |
+
#: inc/fields/file.php:121
|
142 |
msgctxt "file upload"
|
143 |
msgid "Delete"
|
144 |
msgstr "Elimina"
|
145 |
|
146 |
+
#: inc/fields/button.php:32
|
147 |
+
msgid "Click me"
|
148 |
+
msgstr "Cliccami"
|
149 |
+
|
150 |
+
#: inc/fields/checkbox.php:53
|
151 |
+
msgid "Yes"
|
152 |
+
msgstr "Sì"
|
153 |
+
|
154 |
+
#: inc/fields/checkbox.php:53
|
155 |
+
msgid "No"
|
156 |
+
msgstr "No"
|
157 |
+
|
158 |
+
#: inc/fields/file-input.php:19
|
159 |
+
msgid "Select File"
|
160 |
+
msgstr "Seleziona File"
|
161 |
+
|
162 |
+
#: inc/fields/file-input.php:38 inc/fields/select.php:87
|
163 |
+
msgid "Select"
|
164 |
+
msgstr "Seleziona"
|
165 |
+
|
166 |
+
#: inc/fields/file-input.php:40
|
167 |
+
msgid "Remove"
|
168 |
+
msgstr "Rimuovi"
|
169 |
+
|
170 |
+
#: inc/fields/media.php:27
|
171 |
+
msgctxt "media"
|
172 |
+
msgid "Remove"
|
173 |
+
msgstr "Rimuovi"
|
174 |
+
|
175 |
+
#: inc/fields/file.php:21
|
176 |
+
#, php-format
|
177 |
+
msgid "You may only upload maximum %d file"
|
178 |
+
msgstr "Puoi caricare al massimo %d file"
|
179 |
+
|
180 |
+
#: inc/fields/file.php:23
|
181 |
+
#, php-format
|
182 |
+
msgid "You may only upload maximum %d files"
|
183 |
+
msgstr "Puoi caricare al massimo %d file"
|
184 |
+
|
185 |
+
#: inc/fields/file.php:53
|
186 |
+
msgid "Error: Cannot delete file"
|
187 |
+
msgstr "Errore: Non posso cancellare il file"
|
188 |
+
|
189 |
+
#: inc/fields/file.php:66
|
190 |
msgctxt "file upload"
|
191 |
+
msgid "+ Add new file"
|
192 |
+
msgstr "+ Aggiungi un nuovo file"
|
193 |
|
194 |
+
#: inc/fields/file.php:122
|
195 |
msgctxt "file upload"
|
196 |
+
msgid "Edit"
|
197 |
+
msgstr "Modifica"
|
198 |
|
199 |
+
#: inc/fields/media.php:28
|
200 |
+
msgctxt "media"
|
201 |
+
msgid "Edit"
|
202 |
+
msgstr "Modifica"
|
203 |
|
204 |
+
#: inc/fields/input-list.php:90
|
205 |
+
msgid "Select All / None"
|
206 |
+
msgstr "Seleziona Tutti / Nessuno"
|
|
|
|
|
207 |
|
208 |
+
#: inc/fields/key-value.php:126
|
209 |
+
msgid "Key"
|
210 |
+
msgstr "Chiave"
|
|
|
|
|
211 |
|
212 |
+
#: inc/fields/key-value.php:127
|
213 |
+
msgid "Value"
|
214 |
+
msgstr "Valore"
|
|
|
|
|
215 |
|
216 |
+
#: inc/fields/map.php:64
|
217 |
+
msgid "Find Address"
|
218 |
+
msgstr "Trova l'Indirizzo"
|
|
|
|
|
219 |
|
220 |
+
#: inc/fields/media.php:24
|
221 |
+
msgctxt "media"
|
222 |
+
msgid "+ Add Media"
|
223 |
+
msgstr "+ Aggiungi Media"
|
|
|
224 |
|
225 |
+
#: inc/fields/media.php:25
|
226 |
+
msgctxt "media"
|
227 |
+
msgid " file"
|
228 |
+
msgstr " file"
|
|
|
229 |
|
230 |
+
#: inc/fields/media.php:26
|
231 |
+
msgctxt "media"
|
232 |
+
msgid " files"
|
233 |
+
msgstr " file"
|
234 |
|
235 |
+
#: inc/fields/media.php:29
|
236 |
+
msgctxt "media"
|
237 |
+
msgid "View"
|
238 |
+
msgstr "Mostra"
|
239 |
|
240 |
+
#: inc/fields/media.php:30
|
241 |
+
msgctxt "media"
|
242 |
+
msgid "No Title"
|
243 |
+
msgstr "Nessun Titolo"
|
244 |
+
|
245 |
+
#: inc/fields/media.php:33
|
246 |
+
msgctxt "media"
|
247 |
+
msgid "Select Files"
|
248 |
+
msgstr "Seleziona File"
|
249 |
+
|
250 |
+
#: inc/fields/media.php:34
|
251 |
+
msgctxt "media"
|
252 |
msgid "or"
|
253 |
+
msgstr "o"
|
254 |
+
|
255 |
+
#: inc/fields/media.php:35
|
256 |
+
msgctxt "media"
|
257 |
+
msgid "Drop files here to upload"
|
258 |
+
msgstr "Trascina i file qui per caricarli"
|
259 |
+
|
260 |
+
#: inc/fields/oembed.php:64
|
261 |
+
msgid "Embed HTML not available."
|
262 |
+
msgstr "Incorporazione dell'HTML non disponibile."
|
263 |
+
|
264 |
+
#: inc/fields/post.php:36
|
265 |
+
msgid "Select a post"
|
266 |
+
msgstr "Seleziona un post"
|
267 |
+
|
268 |
+
#: inc/fields/post.php:41 inc/fields/taxonomy.php:52
|
269 |
+
#, php-format
|
270 |
+
msgid "Select a %s"
|
271 |
+
msgstr "Seleziona un %s"
|
272 |
+
|
273 |
+
#: inc/fields/select-advanced.php:45
|
274 |
+
msgid "Select an item"
|
275 |
+
msgstr "Seleziona un oggetto"
|
276 |
+
|
277 |
+
#: inc/fields/select.php:87
|
278 |
+
msgid "All"
|
279 |
+
msgstr "Tutto"
|
280 |
|
281 |
+
#: inc/fields/select.php:87
|
282 |
+
msgid "None"
|
283 |
+
msgstr "Nessuno"
|
284 |
+
|
285 |
+
#: inc/fields/sidebar.php:30
|
286 |
+
msgid "Select a sidebar"
|
287 |
+
msgstr "Seleziona una sidecar"
|
288 |
+
|
289 |
+
#: inc/fields/switch.php:90
|
290 |
+
msgid "On"
|
291 |
+
msgstr "Acceso"
|
292 |
+
|
293 |
+
#: inc/fields/switch.php:91
|
294 |
+
msgid "Off"
|
295 |
+
msgstr "Spento"
|
296 |
+
|
297 |
+
#: inc/fields/taxonomy.php:47
|
298 |
+
msgid "Select a term"
|
299 |
+
msgstr "Seleziona un termine"
|
300 |
+
|
301 |
+
#: inc/fields/thickbox-image.php:55
|
302 |
msgctxt "image upload"
|
303 |
+
msgid "Upload Images"
|
304 |
+
msgstr "Carica Immagini"
|
305 |
+
|
306 |
+
#: inc/fields/user.php:30
|
307 |
+
msgid "Select an user"
|
308 |
+
msgstr "Seleziona un utente"
|
309 |
+
|
310 |
+
#: inc/validation.php:47
|
311 |
+
msgid "Please correct the errors highlighted below and try again."
|
312 |
+
msgstr "Correggere gli errori evidenziati qui sotto e riprovare."
|
313 |
+
|
314 |
+
#~ msgid "Upload Files"
|
315 |
+
#~ msgstr "Carica i File"
|
316 |
|
317 |
+
#~ msgid "Preview"
|
318 |
+
#~ msgstr "Anteprima"
|
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: 4.
|
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: 4.13.0
|
7 |
* Author: MetaBox.io
|
8 |
* Author URI: https://metabox.io
|
9 |
* License: GPL2+
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://paypal.me/anhtnt
|
|
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.3
|
6 |
Tested up to: 4.9.1
|
7 |
-
Stable tag: 4.
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.
|
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.3
|
6 |
Tested up to: 4.9.1
|
7 |
+
Stable tag: 4.13.0
|
8 |
License: GPLv2 or later
|
9 |
|
10 |
Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.
|