Meta Box - Version 4.3.11

Version Description

  • Bug fix: use field id instead of field_name for wysiwyg field
  • Improvement: allow to sort files
  • Improvement: use 'meta-box' text domain instead of 'rwmb'
  • Improvement: coding standards
Download this release

Release Info

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

Code changes from version 4.3.10 to 4.3.11

Files changed (238) hide show
  1. css/color.css +0 -0
  2. css/divider.css +2 -2
  3. css/file.css +29 -31
  4. css/heading.css +1 -1
  5. css/image-select.css +0 -0
  6. css/image.css +9 -11
  7. css/jqueryui/jquery-ui-timepicker-addon.css +0 -0
  8. css/jqueryui/jquery.ui.core.css +0 -0
  9. css/jqueryui/jquery.ui.datepicker.css +0 -0
  10. css/jqueryui/jquery.ui.slider.css +0 -0
  11. css/jqueryui/jquery.ui.theme.css +0 -0
  12. css/oembed.css +0 -0
  13. css/plupload-image.css +2 -2
  14. css/range.css +1 -2
  15. css/select-advanced.css +0 -0
  16. css/select.css +0 -0
  17. css/select2/select2.css +0 -0
  18. css/select2/select2.png +0 -0
  19. css/select2/select2x2.png +0 -0
  20. css/select2/spinner.gif +0 -0
  21. css/slider.css +0 -0
  22. css/style.css +2 -2
  23. css/taxonomy.css +3 -3
  24. css/wysiwyg.css +0 -0
  25. img/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  26. img/jqueryui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  27. img/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  28. img/jqueryui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  29. img/jqueryui/ui-bg_glass_75_dadada_1x400.png +0 -0
  30. img/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  31. img/jqueryui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  32. img/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  33. img/jqueryui/ui-icons_222222_256x240.png +0 -0
  34. img/jqueryui/ui-icons_2e83ff_256x240.png +0 -0
  35. img/jqueryui/ui-icons_454545_256x240.png +0 -0
  36. img/jqueryui/ui-icons_888888_256x240.png +0 -0
  37. img/jqueryui/ui-icons_cd0a0a_256x240.png +0 -0
  38. img/loader.gif +0 -0
  39. inc/common.php +23 -3
  40. inc/field.php +13 -8
  41. inc/fields/button.php +4 -3
  42. inc/fields/checkbox-list.php +5 -4
  43. inc/fields/checkbox.php +3 -3
  44. inc/fields/color.php +3 -3
  45. inc/fields/date.php +5 -4
  46. inc/fields/datetime.php +7 -6
  47. inc/fields/divider.php +4 -4
  48. inc/fields/email.php +2 -2
  49. inc/fields/fieldset-text.php +4 -3
  50. inc/fields/file-advanced.php +21 -18
  51. inc/fields/file-input.php +7 -6
  52. inc/fields/file.php +59 -23
  53. inc/fields/heading.php +4 -4
  54. inc/fields/hidden.php +3 -3
  55. inc/fields/image-advanced.php +21 -19
  56. inc/fields/image-select.php +4 -3
  57. inc/fields/image.php +11 -11
  58. inc/fields/map.php +3 -3
  59. inc/fields/number.php +4 -3
  60. inc/fields/oembed.php +5 -4
  61. inc/fields/password.php +3 -3
  62. inc/fields/plupload-image.php +29 -28
  63. inc/fields/post.php +16 -13
  64. inc/fields/radio.php +3 -3
  65. inc/fields/range.php +3 -2
  66. inc/fields/select-advanced.php +2 -2
  67. inc/fields/select.php +3 -3
  68. inc/fields/slider.php +3 -3
  69. inc/fields/taxonomy-advanced.php +1 -0
  70. inc/fields/taxonomy.php +17 -15
  71. inc/fields/text-list.php +4 -3
  72. inc/fields/text.php +0 -0
  73. inc/fields/textarea.php +4 -3
  74. inc/fields/thickbox-image.php +3 -3
  75. inc/fields/time.php +6 -6
  76. inc/fields/url.php +2 -2
  77. inc/fields/user.php +10 -7
  78. inc/fields/wysiwyg.php +6 -4
  79. inc/helpers.php +7 -3
  80. inc/init.php +0 -0
  81. inc/meta-box.php +22 -19
  82. js/autosave.js +4 -2
  83. js/clone.js +75 -63
  84. js/color.js +30 -28
  85. js/date.js +10 -9
  86. js/datetime.js +12 -10
  87. js/file-advanced.js +18 -14
  88. js/file-input.js +7 -5
  89. js/file.js +69 -21
  90. js/image-advanced.js +21 -17
  91. js/image-select.js +9 -4
  92. js/image.js +10 -8
  93. js/jquery.validate.min.js +0 -0
  94. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-af.js +0 -0
  95. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ar-DZ.js +0 -0
  96. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ar.js +0 -0
  97. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-az.js +0 -0
  98. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-be.js +0 -0
  99. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-bg.js +0 -0
  100. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-bs.js +0 -0
  101. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ca.js +0 -0
  102. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-cs.js +0 -0
  103. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-cy-GB.js +0 -0
  104. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-da.js +0 -0
  105. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-de.js +0 -0
  106. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-el.js +0 -0
  107. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-AU.js +0 -0
  108. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-GB.js +0 -0
  109. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-NZ.js +0 -0
  110. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-eo.js +0 -0
  111. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-es.js +0 -0
  112. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-et.js +0 -0
  113. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-eu.js +0 -0
  114. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fa.js +0 -0
  115. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fi.js +0 -0
  116. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fo.js +0 -0
  117. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr-CA.js +0 -0
  118. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr-CH.js +0 -0
  119. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr.js +0 -0
  120. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-gl.js +0 -0
  121. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-he.js +0 -0
  122. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hi.js +0 -0
  123. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hr.js +0 -0
  124. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hu.js +0 -0
  125. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hy.js +0 -0
  126. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-id.js +0 -0
  127. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-is.js +0 -0
  128. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-it.js +0 -0
  129. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ja.js +0 -0
  130. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ka.js +0 -0
  131. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-kk.js +0 -0
  132. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-km.js +0 -0
  133. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ko.js +0 -0
  134. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ky.js +0 -0
  135. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lb.js +0 -0
  136. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lt.js +0 -0
  137. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lv.js +0 -0
  138. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-mk.js +0 -0
  139. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ml.js +0 -0
  140. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ms.js +0 -0
  141. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nb.js +0 -0
  142. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nl-BE.js +0 -0
  143. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nl.js +0 -0
  144. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nn.js +0 -0
  145. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-no.js +0 -0
  146. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pl.js +0 -0
  147. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pt-BR.js +0 -0
  148. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pt.js +0 -0
  149. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-rm.js +0 -0
  150. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ro.js +0 -0
  151. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ru.js +0 -0
  152. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sk.js +0 -0
  153. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sl.js +0 -0
  154. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sq.js +0 -0
  155. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sr-SR.js +0 -0
  156. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sr.js +0 -0
  157. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sv.js +0 -0
  158. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ta.js +0 -0
  159. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-th.js +0 -0
  160. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-tj.js +0 -0
  161. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-tr.js +0 -0
  162. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-uk.js +0 -0
  163. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-vi.js +0 -0
  164. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-CN.js +0 -0
  165. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-HK.js +0 -0
  166. js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-TW.js +0 -0
  167. js/jqueryui/jquery-ui-timepicker-addon.js +0 -0
  168. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-af.js +0 -0
  169. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-bg.js +0 -0
  170. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ca.js +0 -0
  171. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-cs.js +0 -0
  172. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-de.js +0 -0
  173. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-el.js +0 -0
  174. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-es.js +0 -0
  175. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-et.js +0 -0
  176. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-eu.js +0 -0
  177. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-fi.js +0 -0
  178. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-fr.js +0 -0
  179. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-gl.js +0 -0
  180. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-he.js +0 -0
  181. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-hu.js +0 -0
  182. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-id.js +0 -0
  183. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-it.js +0 -0
  184. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ja.js +0 -0
  185. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ko.js +0 -0
  186. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-lt.js +0 -0
  187. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-nl.js +0 -0
  188. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-no.js +0 -0
  189. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pl.js +0 -0
  190. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pt-BR.js +0 -0
  191. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pt.js +0 -0
  192. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ro.js +0 -0
  193. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ru.js +0 -0
  194. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-sk.js +0 -0
  195. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-sv.js +0 -0
  196. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-th.js +0 -0
  197. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-tr.js +0 -0
  198. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-uk.js +0 -0
  199. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-vi.js +0 -0
  200. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-zh-CN.js +0 -0
  201. js/jqueryui/timepicker-i18n/jquery-ui-timepicker-zh-TW.js +0 -0
  202. js/map.js +10 -8
  203. js/oembed.js +2 -0
  204. js/plupload-image.js +30 -17
  205. js/select-advanced.js +10 -12
  206. js/select2/select2.min.js +0 -0
  207. js/slider.js +4 -2
  208. js/taxonomy.js +3 -1
  209. js/thickbox-image.js +6 -4
  210. js/time.js +11 -10
  211. js/validate.js +8 -4
  212. lang/ar.mo +0 -0
  213. lang/ar.po +0 -0
  214. lang/de_DE.mo +0 -0
  215. lang/de_DE.po +0 -0
  216. lang/default.mo +0 -0
  217. lang/default.po +0 -384
  218. lang/default.pot +174 -0
  219. lang/es.mo +0 -0
  220. lang/es.po +0 -0
  221. lang/it_IT.mo +0 -0
  222. lang/it_IT.po +0 -0
  223. lang/nb_NO.mo +0 -0
  224. lang/nb_NO.po +0 -0
  225. lang/nl.mo +0 -0
  226. lang/nl.po +0 -0
  227. lang/pt_BR.mo +0 -0
  228. lang/pt_BR.po +0 -0
  229. lang/sv_SE.mo +0 -0
  230. lang/sv_SE.po +0 -0
  231. lang/tr_TR.mo +0 -0
  232. lang/tr_TR.po +0 -0
  233. lang/vi.mo +0 -0
  234. lang/vi.po +0 -0
  235. lang/zh_CN.mo +0 -0
  236. lang/zh_CN.po +0 -0
  237. meta-box.php +2 -2
  238. readme.txt +11 -29
css/color.css CHANGED
File without changes
css/divider.css CHANGED
@@ -3,5 +3,5 @@
3
 
4
  .rwmb-divider-wrapper hr {
5
  border: none;
6
- border-top: 1px solid #E6E6E6;
7
- }
3
 
4
  .rwmb-divider-wrapper hr {
5
  border: none;
6
+ border-top: 1px solid #e6e6e6;
7
+ }
css/file.css CHANGED
@@ -1,60 +1,58 @@
1
- @charset "utf-8";
2
- /* CSS Document */
3
-
4
- .rwmb-file li{
5
- width: 250px;
6
- margin:0 10px 10px 0;;
7
- -moz-transition:width 0.25s, opacity 0.25s, -moz-opacity 0.25s;
8
- -webkit-transition:width 0.25s, opacity 0.25s, -webkit-opacity 0.25s;
9
- -o-transition:width 0.25s, opacity 0.25s, -o-opacity 0.25s;
10
- transition:width 0.25s, opacity 0.25s;
11
  }
12
  .rwmb-file .rwmb-icon {
13
  width: 60px;
14
- text-align:center;
15
- vertical-align:middle;
16
  overflow: hidden;
17
  }
18
- .rwmb-file .rwmb-icon img{
19
  max-height: 60px;
20
  max-width: 60px;
21
  }
22
  .rwmb-file .rwmb-info {
23
- width: 180px;
24
- vertical-align:top;
25
- overflow:hidden;
26
  }
27
  .rwmb-file .rwmb-info p {
28
- margin:.1em 0;
29
  }
30
  .rwmb-file .rwmb-info a {
31
- font-weight:bold;
32
- text-decoration:none;
33
  }
34
- .rwmb-file li, .rwmb-file .rwmb-icon, .rwmb-file .rwmb-info {
35
- display:inline-block;
 
 
36
  }
37
- .rwmb-file .rwmb-icon, .rwmb-file .rwmb-info {
38
- margin:0 0 2px 2px;
 
39
  }
40
 
41
  .rwmb-file li.removed {
42
  width: 0;
43
  margin: 0;
44
- opacity: 0;
45
  -webkit-opacity: 0;
46
- -moz-opacity: 0;
47
- -o-opacity: 0;
48
  }
49
 
50
  .rwmb-file li.removed:after {
51
  content: ' ';
52
  position: absolute;
53
- top:0;
54
- left:0;
55
- right:0;
56
- bottom:0;
57
  z-index: 2;
58
  opacity: .4;
59
- background-color: #F00;
60
  }
1
+ .rwmb-file li {
2
+ width: 250px;
3
+ margin: 0 10px 10px 0;
4
+ -webkit-transition: width .25s, opacity .25s, -webkit-opacity .25s;
5
+ transition: width .25s, opacity .25s;
 
 
 
 
 
6
  }
7
  .rwmb-file .rwmb-icon {
8
  width: 60px;
9
+ text-align: center;
10
+ vertical-align: middle;
11
  overflow: hidden;
12
  }
13
+ .rwmb-file .rwmb-icon img {
14
  max-height: 60px;
15
  max-width: 60px;
16
  }
17
  .rwmb-file .rwmb-info {
18
+ width: 180px;
19
+ vertical-align: top;
20
+ overflow: hidden;
21
  }
22
  .rwmb-file .rwmb-info p {
23
+ margin: .1em 0;
24
  }
25
  .rwmb-file .rwmb-info a {
26
+ font-weight: bold;
27
+ text-decoration: none;
28
  }
29
+ .rwmb-file li,
30
+ .rwmb-file .rwmb-icon,
31
+ .rwmb-file .rwmb-info {
32
+ display: inline-block;
33
  }
34
+ .rwmb-file .rwmb-icon,
35
+ .rwmb-file .rwmb-info {
36
+ margin: 0 0 2px 2px;
37
  }
38
 
39
  .rwmb-file li.removed {
40
  width: 0;
41
  margin: 0;
42
+ opacity: 0;
43
  -webkit-opacity: 0;
44
+ -moz-opacity: 0;
45
+ -o-opacity: 0;
46
  }
47
 
48
  .rwmb-file li.removed:after {
49
  content: ' ';
50
  position: absolute;
51
+ top: 0;
52
+ left: 0;
53
+ right: 0;
54
+ bottom: 0;
55
  z-index: 2;
56
  opacity: .4;
57
+ background-color: #f00;
58
  }
css/heading.css CHANGED
@@ -9,4 +9,4 @@
9
  text-transform: uppercase;
10
  padding: .75rem 0 .375rem;
11
  margin: 0 0 6px;
12
- }
9
  text-transform: uppercase;
10
  padding: .75rem 0 .375rem;
11
  margin: 0 0 6px;
12
+ }
css/image-select.css CHANGED
File without changes
css/image.css CHANGED
@@ -10,10 +10,8 @@
10
  text-align: center;
11
  cursor: move;
12
  position: relative;
13
- -moz-transition: width 0.25s, opacity 0.25s, -moz-opacity 0.25s;
14
- -webkit-transition: width 0.25s, opacity 0.25s, -webkit-opacity 0.25s;
15
- -o-transition: width 0.25s, opacity 0.25s, -o-opacity 0.25s;
16
- transition: width 0.25s, opacity 0.25s;
17
  }
18
  .rwmb-images img {
19
  width: 150px;
@@ -31,7 +29,7 @@
31
  display: none;
32
  text-align: center;
33
  }
34
- li:hover .rwmb-image-bar{
35
  display: block;
36
  }
37
  .rwmb-image-bar a {
@@ -48,10 +46,10 @@ li:hover .rwmb-image-bar{
48
  .rwmb-images li.removed {
49
  width: 0;
50
  margin: 0;
51
- opacity: 0;
52
  -webkit-opacity: 0;
53
- -moz-opacity: 0;
54
- -o-opacity: 0;
55
  }
56
  .rwmb-images li.removed:after {
57
  content: ' ';
@@ -64,6 +62,6 @@ li:hover .rwmb-image-bar{
64
  opacity: .4;
65
  background-color: #f00;
66
  }
67
- .rwmb-images li.ui-state-highlight{
68
- background: #DDDDDD;
69
- }
10
  text-align: center;
11
  cursor: move;
12
  position: relative;
13
+ -webkit-transition: width .25s, opacity .25s, -webkit-opacity .25s;
14
+ transition: width .25s, opacity .25s;
 
 
15
  }
16
  .rwmb-images img {
17
  width: 150px;
29
  display: none;
30
  text-align: center;
31
  }
32
+ li:hover .rwmb-image-bar {
33
  display: block;
34
  }
35
  .rwmb-image-bar a {
46
  .rwmb-images li.removed {
47
  width: 0;
48
  margin: 0;
49
+ opacity: 0;
50
  -webkit-opacity: 0;
51
+ -moz-opacity: 0;
52
+ -o-opacity: 0;
53
  }
54
  .rwmb-images li.removed:after {
55
  content: ' ';
62
  opacity: .4;
63
  background-color: #f00;
64
  }
65
+ .rwmb-images li.ui-state-highlight {
66
+ background: #ddd;
67
+ }
css/jqueryui/jquery-ui-timepicker-addon.css CHANGED
File without changes
css/jqueryui/jquery.ui.core.css CHANGED
File without changes
css/jqueryui/jquery.ui.datepicker.css CHANGED
File without changes
css/jqueryui/jquery.ui.slider.css CHANGED
File without changes
css/jqueryui/jquery.ui.theme.css CHANGED
File without changes
css/oembed.css CHANGED
File without changes
css/plupload-image.css CHANGED
@@ -6,7 +6,7 @@ div.rwmb-drag-drop {
6
  div.rwmb-image-uploading-bar {
7
  position: absolute;
8
  width: 100%;
9
- height: 0%;
10
  bottom: 0;
11
  }
12
  div.rwmb-image-uploading-status {
@@ -22,4 +22,4 @@ li.rwmb-image-error {
22
  top: 43px;
23
  left: 43px;
24
  position: relative;
25
- }
6
  div.rwmb-image-uploading-bar {
7
  position: absolute;
8
  width: 100%;
9
+ height: 0;
10
  bottom: 0;
11
  }
12
  div.rwmb-image-uploading-status {
22
  top: 43px;
23
  left: 43px;
24
  position: relative;
25
+ }
css/range.css CHANGED
@@ -1,5 +1,4 @@
1
- input[type="range"] {
2
- -webkit-border-radius: 2px;
3
  border-radius: 2px;
4
  border: 1px solid #dfdfdf;
5
  }
1
+ input[type='range'] {
 
2
  border-radius: 2px;
3
  border: 1px solid #dfdfdf;
4
  }
css/select-advanced.css CHANGED
File without changes
css/select.css CHANGED
File without changes
css/select2/select2.css CHANGED
File without changes
css/select2/select2.png CHANGED
File without changes
css/select2/select2x2.png CHANGED
File without changes
css/select2/spinner.gif CHANGED
File without changes
css/slider.css CHANGED
File without changes
css/style.css CHANGED
@@ -37,8 +37,8 @@
37
  margin-bottom: 5px;
38
  position: relative;
39
  }
40
- .rwmb-clone > input[type="radio"],
41
- .rwmb-clone > input[type="checkbox"] {
42
  margin: 6px 0 0 4px;
43
  }
44
  .rwmb-button {
37
  margin-bottom: 5px;
38
  position: relative;
39
  }
40
+ .rwmb-clone > input[type='radio'],
41
+ .rwmb-clone > input[type='checkbox'] {
42
  margin: 6px 0 0 4px;
43
  }
44
  .rwmb-button {
css/taxonomy.css CHANGED
@@ -2,9 +2,9 @@
2
  margin-left: 15px;
3
  margin-top: 5px;
4
  }
5
- .rw-taxonomy-tree.active{
6
  display: inline-block;
7
  }
8
- .rw-taxonomy-tree.disabled{
9
  display: none;
10
- }
2
  margin-left: 15px;
3
  margin-top: 5px;
4
  }
5
+ .rw-taxonomy-tree.active {
6
  display: inline-block;
7
  }
8
+ .rw-taxonomy-tree.disabled {
9
  display: none;
10
+ }
css/wysiwyg.css CHANGED
File without changes
img/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png CHANGED
File without changes
img/jqueryui/ui-bg_flat_75_ffffff_40x100.png CHANGED
File without changes
img/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png CHANGED
File without changes
img/jqueryui/ui-bg_glass_65_ffffff_1x400.png CHANGED
File without changes
img/jqueryui/ui-bg_glass_75_dadada_1x400.png CHANGED
File without changes
img/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png CHANGED
File without changes
img/jqueryui/ui-bg_glass_95_fef1ec_1x400.png CHANGED
File without changes
img/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png CHANGED
File without changes
img/jqueryui/ui-icons_222222_256x240.png CHANGED
File without changes
img/jqueryui/ui-icons_2e83ff_256x240.png CHANGED
File without changes
img/jqueryui/ui-icons_454545_256x240.png CHANGED
File without changes
img/jqueryui/ui-icons_888888_256x240.png CHANGED
File without changes
img/jqueryui/ui-icons_cd0a0a_256x240.png CHANGED
File without changes
img/loader.gif CHANGED
File without changes
inc/common.php CHANGED
@@ -15,9 +15,12 @@ if ( ! class_exists( 'RWMB_Common' ) )
15
  *
16
  * @return void
17
  */
18
- static function on_load()
19
  {
20
  self::load_textdomain();
 
 
 
21
  }
22
 
23
  /**
@@ -25,16 +28,33 @@ if ( ! class_exists( 'RWMB_Common' ) )
25
  *
26
  * @return void
27
  */
28
- static function load_textdomain()
29
  {
30
  // l18n translation files
31
  $locale = get_locale();
32
- $dir = trailingslashit( RWMB_DIR . 'lang' );
33
  $mofile = "{$dir}{$locale}.mo";
34
 
35
  // In themes/plugins/mu-plugins directory
36
  load_textdomain( 'rwmb', $mofile );
37
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  }
39
 
40
  RWMB_Common::on_load();
15
  *
16
  * @return void
17
  */
18
+ public static function on_load()
19
  {
20
  self::load_textdomain();
21
+
22
+ $plugin = 'meta-box/meta-box.php';
23
+ add_filter( "plugin_action_links_$plugin", array( __CLASS__, 'plugin_links' ) );
24
  }
25
 
26
  /**
28
  *
29
  * @return void
30
  */
31
+ public static function load_textdomain()
32
  {
33
  // l18n translation files
34
  $locale = get_locale();
35
+ $dir = trailingslashit( RWMB_DIR . 'lang' );
36
  $mofile = "{$dir}{$locale}.mo";
37
 
38
  // In themes/plugins/mu-plugins directory
39
  load_textdomain( 'rwmb', $mofile );
40
  }
41
+
42
+ /**
43
+ * Add links to Documentation and Extensions in plugin's list of action links
44
+ *
45
+ * @since 4.3.11
46
+ *
47
+ * @param array $links Array of action links
48
+ *
49
+ * @return array
50
+ */
51
+ public static function plugin_links( $links )
52
+ {
53
+ $links[] = '<a href="http://metabox.io/docs/">' . __( 'Documentation', 'meta-box' ) . '</a>';
54
+ $links[] = '<a href="http://metabox.io/plugins/">' . __( 'Extensions', 'meta-box' ) . '</a>';
55
+ return $links;
56
+ }
57
+
58
  }
59
 
60
  RWMB_Common::on_load();
inc/field.php CHANGED
@@ -8,14 +8,18 @@ if ( ! class_exists( 'RWMB_Field ' ) )
8
  *
9
  * @return void
10
  */
11
- static function add_actions() {}
 
 
12
 
13
  /**
14
  * Enqueue scripts and styles
15
  *
16
  * @return void
17
  */
18
- static function admin_enqueue_scripts() {}
 
 
19
 
20
  /**
21
  * Show field HTML
@@ -33,7 +37,7 @@ if ( ! class_exists( 'RWMB_Field ' ) )
33
  global $post;
34
 
35
  $field_class = RW_Meta_Box::get_class_name( $field );
36
- $meta = call_user_func( array( $field_class, 'meta' ), $post->ID, $saved, $field );
37
 
38
  // Apply filter to field meta value
39
  // 1st filter applies to all fields
@@ -67,7 +71,7 @@ if ( ! class_exists( 'RWMB_Field ' ) )
67
 
68
  foreach ( $meta as $index => $sub_meta )
69
  {
70
- $sub_field = $field;
71
  $sub_field['field_name'] = $field['field_name'] . "[{$index}]";
72
  if ( $index > 0 )
73
  {
@@ -203,7 +207,7 @@ if ( ! class_exists( 'RWMB_Field ' ) )
203
  static function end_html( $meta, $field )
204
  {
205
  $button = $field['clone'] ? call_user_func( array( RW_Meta_Box::get_class_name( $field ), 'add_clone_button' ) ) : '';
206
- $desc = $field['desc'] ? "<p id='{$field['id']}_description' class='description'>{$field['desc']}</p>" : '';
207
 
208
  // Closes the container
209
  $html = "{$button}{$desc}</div>";
@@ -218,7 +222,7 @@ if ( ! class_exists( 'RWMB_Field ' ) )
218
  */
219
  static function add_clone_button()
220
  {
221
- return '<a href="#" class="rwmb-button button-primary add-clone">' . __( '+', 'rwmb' ) . '</a>';
222
  }
223
 
224
  /**
@@ -228,7 +232,7 @@ if ( ! class_exists( 'RWMB_Field ' ) )
228
  */
229
  static function remove_clone_button()
230
  {
231
- return '<a href="#" class="rwmb-button button remove-clone">' . __( '&#8211;', 'rwmb' ) . '</a>';
232
  }
233
 
234
  /**
@@ -284,6 +288,7 @@ if ( ! class_exists( 'RWMB_Field ' ) )
284
  if ( '' === $new || array() === $new )
285
  {
286
  delete_post_meta( $post_id, $name );
 
287
  return;
288
  }
289
 
@@ -327,4 +332,4 @@ if ( ! class_exists( 'RWMB_Field ' ) )
327
  return $field;
328
  }
329
  }
330
- }
8
  *
9
  * @return void
10
  */
11
+ static function add_actions()
12
+ {
13
+ }
14
 
15
  /**
16
  * Enqueue scripts and styles
17
  *
18
  * @return void
19
  */
20
+ static function admin_enqueue_scripts()
21
+ {
22
+ }
23
 
24
  /**
25
  * Show field HTML
37
  global $post;
38
 
39
  $field_class = RW_Meta_Box::get_class_name( $field );
40
+ $meta = call_user_func( array( $field_class, 'meta' ), $post->ID, $saved, $field );
41
 
42
  // Apply filter to field meta value
43
  // 1st filter applies to all fields
71
 
72
  foreach ( $meta as $index => $sub_meta )
73
  {
74
+ $sub_field = $field;
75
  $sub_field['field_name'] = $field['field_name'] . "[{$index}]";
76
  if ( $index > 0 )
77
  {
207
  static function end_html( $meta, $field )
208
  {
209
  $button = $field['clone'] ? call_user_func( array( RW_Meta_Box::get_class_name( $field ), 'add_clone_button' ) ) : '';
210
+ $desc = $field['desc'] ? "<p id='{$field['id']}_description' class='description'>{$field['desc']}</p>" : '';
211
 
212
  // Closes the container
213
  $html = "{$button}{$desc}</div>";
222
  */
223
  static function add_clone_button()
224
  {
225
+ return '<a href="#" class="rwmb-button button-primary add-clone">' . __( '+', 'meta-box' ) . '</a>';
226
  }
227
 
228
  /**
232
  */
233
  static function remove_clone_button()
234
  {
235
+ return '<a href="#" class="rwmb-button button remove-clone">' . __( '&#8211;', 'meta-box' ) . '</a>';
236
  }
237
 
238
  /**
288
  if ( '' === $new || array() === $new )
289
  {
290
  delete_post_meta( $post_id, $name );
291
+
292
  return;
293
  }
294
 
332
  return $field;
333
  }
334
  }
335
+ }
inc/fields/button.php CHANGED
@@ -9,8 +9,8 @@ if ( ! class_exists( 'RWMB_Button_Field' ) )
9
  /**
10
  * Get field HTML
11
  *
12
- * @param mixed $meta
13
- * @param array $field
14
  *
15
  * @return string
16
  */
@@ -32,7 +32,8 @@ if ( ! class_exists( 'RWMB_Button_Field' ) )
32
  */
33
  static function normalize_field( $field )
34
  {
35
- $field['std'] = $field['std'] ? $field['std'] : __( 'Click me', 'rwmb' );
 
36
  return $field;
37
  }
38
  }
9
  /**
10
  * Get field HTML
11
  *
12
+ * @param mixed $meta
13
+ * @param array $field
14
  *
15
  * @return string
16
  */
32
  */
33
  static function normalize_field( $field )
34
  {
35
+ $field['std'] = $field['std'] ? $field['std'] : __( 'Click me', 'meta-box' );
36
+
37
  return $field;
38
  }
39
  }
inc/fields/checkbox-list.php CHANGED
@@ -9,8 +9,8 @@ if ( ! class_exists( 'RWMB_Checkbox_List_Field' ) )
9
  /**
10
  * Get field HTML
11
  *
12
- * @param mixed $meta
13
- * @param array $field
14
  *
15
  * @return string
16
  */
@@ -18,7 +18,7 @@ if ( ! class_exists( 'RWMB_Checkbox_List_Field' ) )
18
  {
19
  $meta = (array) $meta;
20
  $html = array();
21
- $tpl = '<label><input type="checkbox" class="rwmb-checkbox-list" name="%s" value="%s"%s> %s</label>';
22
 
23
  foreach ( $field['options'] as $value => $label )
24
  {
@@ -30,6 +30,7 @@ if ( ! class_exists( 'RWMB_Checkbox_List_Field' ) )
30
  $label
31
  );
32
  }
 
33
  return implode( '<br>', $html );
34
  }
35
 
@@ -101,4 +102,4 @@ if ( ! class_exists( 'RWMB_Checkbox_List_Field' ) )
101
  return $field;
102
  }
103
  }
104
- }
9
  /**
10
  * Get field HTML
11
  *
12
+ * @param mixed $meta
13
+ * @param array $field
14
  *
15
  * @return string
16
  */
18
  {
19
  $meta = (array) $meta;
20
  $html = array();
21
+ $tpl = '<label><input type="checkbox" class="rwmb-checkbox-list" name="%s" value="%s"%s> %s</label>';
22
 
23
  foreach ( $field['options'] as $value => $label )
24
  {
30
  $label
31
  );
32
  }
33
+
34
  return implode( '<br>', $html );
35
  }
36
 
102
  return $field;
103
  }
104
  }
105
+ }
inc/fields/checkbox.php CHANGED
@@ -9,8 +9,8 @@ if ( ! class_exists( 'RWMB_Checkbox_Field' ) )
9
  /**
10
  * Get field HTML
11
  *
12
- * @param mixed $meta
13
- * @param array $field
14
  *
15
  * @return string
16
  */
@@ -42,4 +42,4 @@ if ( ! class_exists( 'RWMB_Checkbox_Field' ) )
42
  return empty( $new ) ? 0 : 1;
43
  }
44
  }
45
- }
9
  /**
10
  * Get field HTML
11
  *
12
+ * @param mixed $meta
13
+ * @param array $field
14
  *
15
  * @return string
16
  */
42
  return empty( $new ) ? 0 : 1;
43
  }
44
  }
45
+ }
inc/fields/color.php CHANGED
@@ -20,8 +20,8 @@ if ( ! class_exists( 'RWMB_Color_Field' ) )
20
  /**
21
  * Get field HTML
22
  *
23
- * @param mixed $meta
24
- * @param array $field
25
  *
26
  * @return string
27
  */
@@ -68,4 +68,4 @@ if ( ! class_exists( 'RWMB_Color_Field' ) )
68
  return $field;
69
  }
70
  }
71
- }
20
  /**
21
  * Get field HTML
22
  *
23
+ * @param mixed $meta
24
+ * @param array $field
25
  *
26
  * @return string
27
  */
68
  return $field;
69
  }
70
  }
71
+ }
inc/fields/date.php CHANGED
@@ -19,10 +19,11 @@ if ( ! class_exists( 'RWMB_Date_Field' ) )
19
  wp_enqueue_style( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
20
 
21
  // Load localized scripts
22
- $locale = str_replace( '_', '-', get_locale() );
23
  $file_paths = array( 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . $locale . '.js' );
24
  // Also check alternate i18n filename (e.g. jquery.ui.datepicker-de.js instead of jquery.ui.datepicker-de-DE.js)
25
- if ( strlen( $locale ) > 2 ) $file_paths[] = 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . substr( $locale, 0, 2 ) . '.js';
 
26
  $deps = array( 'jquery-ui-datepicker' );
27
  foreach ( $file_paths as $file_path )
28
  {
@@ -41,8 +42,8 @@ if ( ! class_exists( 'RWMB_Date_Field' ) )
41
  /**
42
  * Get field HTML
43
  *
44
- * @param mixed $meta
45
- * @param array $field
46
  *
47
  * @return string
48
  */
19
  wp_enqueue_style( 'jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array( 'jquery-ui-core', 'jquery-ui-theme' ), '1.8.17' );
20
 
21
  // Load localized scripts
22
+ $locale = str_replace( '_', '-', get_locale() );
23
  $file_paths = array( 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . $locale . '.js' );
24
  // Also check alternate i18n filename (e.g. jquery.ui.datepicker-de.js instead of jquery.ui.datepicker-de-DE.js)
25
+ if ( strlen( $locale ) > 2 )
26
+ $file_paths[] = 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . substr( $locale, 0, 2 ) . '.js';
27
  $deps = array( 'jquery-ui-datepicker' );
28
  foreach ( $file_paths as $file_path )
29
  {
42
  /**
43
  * Get field HTML
44
  *
45
+ * @param mixed $meta
46
+ * @param array $field
47
  *
48
  * @return string
49
  */
inc/fields/datetime.php CHANGED
@@ -23,10 +23,11 @@ if ( ! class_exists( 'RWMB_Datetime_Field' ) )
23
  wp_register_script( 'jquery-ui-timepicker', RWMB_JS_URL . 'jqueryui/jquery-ui-timepicker-addon.js', array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
24
 
25
  // Load localized scripts
26
- $locale = str_replace( '_', '-', get_locale() );
27
  $date_paths = array( 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . $locale . '.js' );
28
  $time_paths = array( 'jqueryui/timepicker-i18n/jquery-ui-timepicker-' . $locale . '.js' );
29
- if ( strlen( $locale ) > 2 ) {
 
30
  // Also check alternate i18n filenames
31
  // (e.g. jquery.ui.datepicker-de.js instead of jquery.ui.datepicker-de-DE.js)
32
  $date_paths[] = 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . substr( $locale, 0, 2 ) . '.js';
@@ -59,8 +60,8 @@ if ( ! class_exists( 'RWMB_Datetime_Field' ) )
59
  /**
60
  * Get field HTML
61
  *
62
- * @param mixed $meta
63
- * @param array $field
64
  *
65
  * @return string
66
  */
@@ -148,8 +149,8 @@ if ( ! class_exists( 'RWMB_Datetime_Field' ) )
148
  static function translate_format( $field )
149
  {
150
  return strtr( $field['js_options']['dateFormat'], self::$date_format_translation )
151
- . $field['js_options']['separator']
152
- . strtr( $field['js_options']['timeFormat'], self::$time_format_translation );
153
  }
154
  }
155
  }
23
  wp_register_script( 'jquery-ui-timepicker', RWMB_JS_URL . 'jqueryui/jquery-ui-timepicker-addon.js', array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
24
 
25
  // Load localized scripts
26
+ $locale = str_replace( '_', '-', get_locale() );
27
  $date_paths = array( 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . $locale . '.js' );
28
  $time_paths = array( 'jqueryui/timepicker-i18n/jquery-ui-timepicker-' . $locale . '.js' );
29
+ if ( strlen( $locale ) > 2 )
30
+ {
31
  // Also check alternate i18n filenames
32
  // (e.g. jquery.ui.datepicker-de.js instead of jquery.ui.datepicker-de-DE.js)
33
  $date_paths[] = 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . substr( $locale, 0, 2 ) . '.js';
60
  /**
61
  * Get field HTML
62
  *
63
+ * @param mixed $meta
64
+ * @param array $field
65
  *
66
  * @return string
67
  */
149
  static function translate_format( $field )
150
  {
151
  return strtr( $field['js_options']['dateFormat'], self::$date_format_translation )
152
+ . $field['js_options']['separator']
153
+ . strtr( $field['js_options']['timeFormat'], self::$time_format_translation );
154
  }
155
  }
156
  }
inc/fields/divider.php CHANGED
@@ -19,8 +19,8 @@ if ( ! class_exists( 'RWMB_Divider_Field' ) )
19
  /**
20
  * Show begin HTML markup for fields
21
  *
22
- * @param mixed $meta
23
- * @param array $field
24
  *
25
  * @return string
26
  */
@@ -32,8 +32,8 @@ if ( ! class_exists( 'RWMB_Divider_Field' ) )
32
  /**
33
  * Show end HTML markup for fields
34
  *
35
- * @param mixed $meta
36
- * @param array $field
37
  *
38
  * @return string
39
  */
19
  /**
20
  * Show begin HTML markup for fields
21
  *
22
+ * @param mixed $meta
23
+ * @param array $field
24
  *
25
  * @return string
26
  */
32
  /**
33
  * Show end HTML markup for fields
34
  *
35
+ * @param mixed $meta
36
+ * @param array $field
37
  *
38
  * @return string
39
  */
inc/fields/email.php CHANGED
@@ -12,8 +12,8 @@ if ( ! class_exists( 'RWMB_Email_Field' ) )
12
  /**
13
  * Get field HTML
14
  *
15
- * @param mixed $meta
16
- * @param array $field
17
  *
18
  * @return string
19
  */
12
  /**
13
  * Get field HTML
14
  *
15
+ * @param mixed $meta
16
+ * @param array $field
17
  *
18
  * @return string
19
  */
inc/fields/fieldset-text.php CHANGED
@@ -19,13 +19,13 @@ if ( ! class_exists( 'RWMB_Fieldset_Text_Field' ) )
19
  if ( count( $meta ) == 1 && trim( $meta[0] ) == '' )
20
  $meta = '';
21
 
22
- $html = array();
23
  $before = '<fieldset><legend>' . $field['desc'] . '</legend>';
24
- $after = '</fieldset>';
25
 
26
  $tpl = '<label>%s <input type="text" class="rwmb-fieldset-text" name="%s[%s][%d]" placeholder="%s" value="%s" /></label>';
27
 
28
- for ( $n = 0; $n < $field['rows']; $n++ )
29
  {
30
  foreach ( $field['options'] as $k => $v )
31
  {
@@ -39,6 +39,7 @@ if ( ! class_exists( 'RWMB_Fieldset_Text_Field' ) )
39
  }
40
 
41
  $out = $before . implode( ' ', $html ) . $after;
 
42
  return $out;
43
  }
44
 
19
  if ( count( $meta ) == 1 && trim( $meta[0] ) == '' )
20
  $meta = '';
21
 
22
+ $html = array();
23
  $before = '<fieldset><legend>' . $field['desc'] . '</legend>';
24
+ $after = '</fieldset>';
25
 
26
  $tpl = '<label>%s <input type="text" class="rwmb-fieldset-text" name="%s[%s][%d]" placeholder="%s" value="%s" /></label>';
27
 
28
+ for ( $n = 0; $n < $field['rows']; $n ++ )
29
  {
30
  foreach ( $field['options'] as $k => $v )
31
  {
39
  }
40
 
41
  $out = $before . implode( ' ', $html ) . $after;
42
+
43
  return $out;
44
  }
45
 
inc/fields/file-advanced.php CHANGED
@@ -20,7 +20,7 @@ if ( ! class_exists( 'RWMB_File_Advanced_Field' ) )
20
  wp_enqueue_media();
21
  wp_enqueue_script( 'rwmb-file-advanced', RWMB_JS_URL . 'file-advanced.js', array( 'jquery', 'underscore' ), RWMB_VER, true );
22
  wp_localize_script( 'rwmb-file-advanced', 'rwmbFileAdvanced', array(
23
- 'frameTitle' => __( 'Select Files', 'rwmb' ),
24
  ) );
25
  }
26
 
@@ -45,7 +45,7 @@ if ( ! class_exists( 'RWMB_File_Advanced_Field' ) )
45
  $attachment_ids = isset( $_POST['attachment_ids'] ) ? (array) $_POST['attachment_ids'] : array();
46
 
47
  check_ajax_referer( "rwmb-attach-file_{$field_id}" );
48
- foreach( $attachment_ids as $attachment_id )
49
  {
50
  add_post_meta( $post_id, $field_id, $attachment_id, false );
51
  }
@@ -56,14 +56,14 @@ if ( ! class_exists( 'RWMB_File_Advanced_Field' ) )
56
  /**
57
  * Get field HTML
58
  *
59
- * @param mixed $meta
60
- * @param array $field
61
  *
62
  * @return string
63
  */
64
  static function html( $meta, $field )
65
  {
66
- $i18n_title = apply_filters( 'rwmb_file_advanced_select_string', _x( 'Select or Upload Files', 'file upload', 'rwmb' ), $field );
67
  $attach_nonce = wp_create_nonce( "rwmb-attach-file_{$field['id']}" );
68
 
69
  // Uploaded files
@@ -94,28 +94,31 @@ if ( ! class_exists( 'RWMB_File_Advanced_Field' ) )
94
  static function value( $new, $old, $post_id, $field )
95
  {
96
  $new = (array) $new;
 
97
  return array_unique( array_merge( $old, $new ) );
98
  }
99
 
100
  static function print_templates()
101
  {
102
- $i18n_delete = apply_filters( 'rwmb_file_delete_string', _x( 'Delete', 'file upload', 'rwmb' ) );
103
- $i18n_edit = apply_filters( 'rwmb_file_edit_string', _x( 'Edit', 'file upload', 'rwmb' ) );
104
  ?>
105
  <script id="tmpl-rwmb-file-advanced" type="text/html">
106
  <# _.each( attachments, function( attachment ) { #>
107
- <li>
108
- <div class="rwmb-icon"><img src="<# if ( attachment.type == 'image' ){ #>{{{ attachment.sizes.thumbnail.url }}}<# } else { #>{{{ attachment.icon }}}<# } #>"></div>
109
- <div class="rwmb-info">
110
- <a href="{{{ attachment.url }}}" target="_blank">{{{ attachment.title }}}</a>
111
- <p>{{{ attachment.mime }}}</p>
112
- <a title="<?php echo esc_attr( $i18n_edit ); ?>" href="{{{ attachment.editLink }}}" target="_blank"><?php echo esc_html( $i18n_edit ); ?></a> |
113
- <a title="<?php echo esc_attr( $i18n_delete ); ?>" class="rwmb-delete-file" href="#" data-attachment_id="{{{ attachment.id }}}"><?php echo esc_html( $i18n_delete ); ?></a>
114
- </div>
115
- </li>
116
- <# } ); #>
 
 
117
  </script>
118
- <?php
119
  }
120
  }
121
  }
20
  wp_enqueue_media();
21
  wp_enqueue_script( 'rwmb-file-advanced', RWMB_JS_URL . 'file-advanced.js', array( 'jquery', 'underscore' ), RWMB_VER, true );
22
  wp_localize_script( 'rwmb-file-advanced', 'rwmbFileAdvanced', array(
23
+ 'frameTitle' => __( 'Select Files', 'meta-box' ),
24
  ) );
25
  }
26
 
45
  $attachment_ids = isset( $_POST['attachment_ids'] ) ? (array) $_POST['attachment_ids'] : array();
46
 
47
  check_ajax_referer( "rwmb-attach-file_{$field_id}" );
48
+ foreach ( $attachment_ids as $attachment_id )
49
  {
50
  add_post_meta( $post_id, $field_id, $attachment_id, false );
51
  }
56
  /**
57
  * Get field HTML
58
  *
59
+ * @param mixed $meta
60
+ * @param array $field
61
  *
62
  * @return string
63
  */
64
  static function html( $meta, $field )
65
  {
66
+ $i18n_title = apply_filters( 'rwmb_file_advanced_select_string', _x( 'Select or Upload Files', 'file upload', 'meta-box' ), $field );
67
  $attach_nonce = wp_create_nonce( "rwmb-attach-file_{$field['id']}" );
68
 
69
  // Uploaded files
94
  static function value( $new, $old, $post_id, $field )
95
  {
96
  $new = (array) $new;
97
+
98
  return array_unique( array_merge( $old, $new ) );
99
  }
100
 
101
  static function print_templates()
102
  {
103
+ $i18n_delete = apply_filters( 'rwmb_file_delete_string', _x( 'Delete', 'file upload', 'meta-box' ) );
104
+ $i18n_edit = apply_filters( 'rwmb_file_edit_string', _x( 'Edit', 'file upload', 'meta-box' ) );
105
  ?>
106
  <script id="tmpl-rwmb-file-advanced" type="text/html">
107
  <# _.each( attachments, function( attachment ) { #>
108
+ <li id="item_{{{ attachment.id }}}">
109
+ <div class="rwmb-icon">
110
+ <img src="<# if ( attachment.type == 'image' ){ #>{{{ attachment.sizes.thumbnail.url }}}<# } else { #>{{{ attachment.icon }}}<# } #>">
111
+ </div>
112
+ <div class="rwmb-info">
113
+ <a href="{{{ attachment.url }}}" target="_blank">{{{ attachment.title }}}</a>
114
+ <p>{{{ attachment.mime }}}</p>
115
+ <a title="<?php echo esc_attr( $i18n_edit ); ?>" href="{{{ attachment.editLink }}}" target="_blank"><?php echo esc_html( $i18n_edit ); ?></a> |
116
+ <a title="<?php echo esc_attr( $i18n_delete ); ?>" class="rwmb-delete-file" href="#" data-attachment_id="{{{ attachment.id }}}"><?php echo esc_html( $i18n_delete ); ?></a>
117
+ </div>
118
+ </li>
119
+ <# } ); #>
120
  </script>
121
+ <?php
122
  }
123
  }
124
  }
inc/fields/file-input.php CHANGED
@@ -14,15 +14,15 @@ if ( ! class_exists( 'RWMB_File_Input_Field' ) )
14
  wp_enqueue_media();
15
  wp_enqueue_script( 'rwmb-file-input', RWMB_JS_URL . 'file-input.js', array( 'jquery' ), RWMB_VER, true );
16
  wp_localize_script( 'rwmb-file-input', 'rwmbFileInput', array(
17
- 'frameTitle' => __( 'Select File', 'rwmb' ),
18
  ) );
19
  }
20
 
21
  /**
22
  * Get field HTML
23
  *
24
- * @param mixed $meta
25
- * @param array $field
26
  *
27
  * @return string
28
  */
@@ -37,9 +37,9 @@ if ( ! class_exists( 'RWMB_File_Input_Field' ) )
37
  $meta,
38
  $field['placeholder'],
39
  $field['size'],
40
- __( 'Select', 'rwmb' ),
41
  $meta ? '' : 'hidden',
42
- __( 'Remove', 'rwmb' )
43
  );
44
  }
45
 
@@ -56,7 +56,8 @@ if ( ! class_exists( 'RWMB_File_Input_Field' ) )
56
  'size' => 30,
57
  'placeholder' => '',
58
  ) );
 
59
  return $field;
60
  }
61
  }
62
- }
14
  wp_enqueue_media();
15
  wp_enqueue_script( 'rwmb-file-input', RWMB_JS_URL . 'file-input.js', array( 'jquery' ), RWMB_VER, true );
16
  wp_localize_script( 'rwmb-file-input', 'rwmbFileInput', array(
17
+ 'frameTitle' => __( 'Select File', 'meta-box' ),
18
  ) );
19
  }
20
 
21
  /**
22
  * Get field HTML
23
  *
24
+ * @param mixed $meta
25
+ * @param array $field
26
  *
27
  * @return string
28
  */
37
  $meta,
38
  $field['placeholder'],
39
  $field['size'],
40
+ __( 'Select', 'meta-box' ),
41
  $meta ? '' : 'hidden',
42
+ __( 'Remove', 'meta-box' )
43
  );
44
  }
45
 
56
  'size' => 30,
57
  'placeholder' => '',
58
  ) );
59
+
60
  return $field;
61
  }
62
  }
63
+ }
inc/fields/file.php CHANGED
@@ -16,8 +16,8 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
16
  wp_enqueue_style( 'rwmb-file', RWMB_CSS_URL . 'file.css', array(), RWMB_VER );
17
  wp_enqueue_script( 'rwmb-file', RWMB_JS_URL . 'file.js', array( 'jquery' ), RWMB_VER, true );
18
  wp_localize_script( 'rwmb-file', 'rwmbFile', array(
19
- 'maxFileUploadsSingle' => __( 'You may only upload maximum %d file', 'rwmb' ),
20
- 'maxFileUploadsPlural' => __( 'You may only upload maximum %d files', 'rwmb' ),
21
  ) );
22
  }
23
 
@@ -33,6 +33,34 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
33
 
34
  // Delete file via Ajax
35
  add_action( 'wp_ajax_rwmb_delete_file', array( __CLASS__, 'wp_ajax_delete_file' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  }
37
 
38
  /**
@@ -67,24 +95,24 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
67
  if ( $ok )
68
  wp_send_json_success();
69
  else
70
- wp_send_json_error( __( 'Error: Cannot delete file', 'rwmb' ) );
71
  }
72
 
73
  /**
74
  * Get field HTML
75
  *
76
- * @param mixed $meta
77
- * @param array $field
78
  *
79
  * @return string
80
  */
81
  static function html( $meta, $field )
82
  {
83
- $i18n_title = apply_filters( 'rwmb_file_upload_string', _x( 'Upload Files', 'file upload', 'rwmb' ), $field );
84
- $i18n_more = apply_filters( 'rwmb_file_add_string', _x( '+ Add new file', 'file upload', 'rwmb' ), $field );
85
 
86
  // Uploaded files
87
- $html = self::get_uploaded_files( $meta, $field );
88
  $new_file_classes = array( 'new-files' );
89
  if ( ! empty( $field['max_file_uploads'] ) && count( $meta ) >= (int) $field['max_file_uploads'] )
90
  $new_file_classes[] = 'hidden';
@@ -107,16 +135,19 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
107
 
108
  static function get_uploaded_files( $files, $field )
109
  {
110
- $delete_nonce = wp_create_nonce( "rwmb-delete-file_{$field['id']}" );
111
- $classes = array('rwmb-file', 'rwmb-uploaded');
112
- if ( count( $files ) <= 0 )
 
 
113
  $classes[] = 'hidden';
114
- $ol = '<ul class="%s" data-field_id="%s" data-delete_nonce="%s" data-force_delete="%s" data-max_file_uploads="%s" data-mime_type="%s">';
115
  $html = sprintf(
116
  $ol,
117
  implode( ' ', $classes ),
118
  $field['id'],
119
  $delete_nonce,
 
120
  $field['force_delete'] ? 1 : 0,
121
  $field['max_file_uploads'],
122
  $field['mime_type']
@@ -134,10 +165,10 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
134
 
135
  static function file_html( $attachment_id )
136
  {
137
- $i18n_delete = apply_filters( 'rwmb_file_delete_string', _x( 'Delete', 'file upload', 'rwmb' ) );
138
- $i18n_edit = apply_filters( 'rwmb_file_edit_string', _x( 'Edit', 'file upload', 'rwmb' ) );
139
- $li = '
140
- <li>
141
  <div class="rwmb-icon">%s</div>
142
  <div class="rwmb-info">
143
  <a href="%s" target="_blank">%s</a>
@@ -148,8 +179,10 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
148
  </li>';
149
 
150
  $mime_type = get_post_mime_type( $attachment_id );
 
151
  return sprintf(
152
  $li,
 
153
  wp_get_attachment_image( $attachment_id, array( 60, 60 ), true ),
154
  wp_get_attachment_url( $attachment_id ),
155
  get_the_title( $attachment_id ),
@@ -176,11 +209,11 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
176
  static function value( $new, $old, $post_id, $field )
177
  {
178
  $name = $field['id'];
179
- if ( empty( $_FILES[ $name ] ) )
180
  return $new;
181
 
182
- $new = array();
183
- $files = self::fix_file_array( $_FILES[ $name ] );
184
 
185
  foreach ( $files as $file_item )
186
  {
@@ -198,7 +231,7 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
198
  'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $file_name ) ),
199
  'post_content' => '',
200
  );
201
- $id = wp_insert_attachment( $attachment, $file_name, $post_id );
202
 
203
  if ( ! is_wp_error( $id ) )
204
  {
@@ -214,9 +247,9 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
214
 
215
  /**
216
  * Fixes the odd indexing of multiple file uploads from the format:
217
- * $_FILES['field']['key']['index']
218
  * To the more standard and appropriate:
219
- * $_FILES['field']['index']['key']
220
  *
221
  * @param array $files
222
  *
@@ -232,6 +265,7 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
232
  $output[$index][$key] = $value;
233
  }
234
  }
 
235
  return $output;
236
  }
237
 
@@ -244,13 +278,14 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
244
  */
245
  static function normalize_field( $field )
246
  {
247
- $field = wp_parse_args( $field, array(
248
  'std' => array(),
249
  'force_delete' => false,
250
  'max_file_uploads' => 0,
251
  'mime_type' => '',
252
  ) );
253
  $field['multiple'] = true;
 
254
  return $field;
255
  }
256
 
@@ -266,6 +301,7 @@ if ( ! class_exists( 'RWMB_File_Field' ) )
266
  static function meta( $post_id, $saved, $field )
267
  {
268
  $meta = parent::meta( $post_id, $saved, $field );
 
269
  return empty( $meta ) ? array() : (array) $meta;
270
  }
271
  }
16
  wp_enqueue_style( 'rwmb-file', RWMB_CSS_URL . 'file.css', array(), RWMB_VER );
17
  wp_enqueue_script( 'rwmb-file', RWMB_JS_URL . 'file.js', array( 'jquery' ), RWMB_VER, true );
18
  wp_localize_script( 'rwmb-file', 'rwmbFile', array(
19
+ 'maxFileUploadsSingle' => __( 'You may only upload maximum %d file', 'meta-box' ),
20
+ 'maxFileUploadsPlural' => __( 'You may only upload maximum %d files', 'meta-box' ),
21
  ) );
22
  }
23
 
33
 
34
  // Delete file via Ajax
35
  add_action( 'wp_ajax_rwmb_delete_file', array( __CLASS__, 'wp_ajax_delete_file' ) );
36
+
37
+ // allow reordering
38
+ add_action( 'wp_ajax_rwmb_reorder_files', array( __CLASS__, 'wp_ajax_reorder_files' ) );
39
+ }
40
+
41
+ /**
42
+ * Ajax callback for reordering images
43
+ *
44
+ * @return void
45
+ */
46
+ static function wp_ajax_reorder_files()
47
+ {
48
+ $field_id = isset( $_POST['field_id'] ) ? $_POST['field_id'] : 0;
49
+ $order = isset( $_POST['order'] ) ? $_POST['order'] : '';
50
+ $post_id = isset( $_POST['post_id'] ) ? intval( $_POST['post_id'] ) : 0;
51
+
52
+ check_ajax_referer( "rwmb-reorder-files_{$field_id}" );
53
+
54
+ parse_str( $order, $items );
55
+
56
+ delete_post_meta( $post_id, $field_id );
57
+
58
+ foreach ( $items['item'] as $item )
59
+ {
60
+ add_post_meta( $post_id, $field_id, $item, false );
61
+ }
62
+
63
+ wp_send_json_success();
64
  }
65
 
66
  /**
95
  if ( $ok )
96
  wp_send_json_success();
97
  else
98
+ wp_send_json_error( __( 'Error: Cannot delete file', 'meta-box' ) );
99
  }
100
 
101
  /**
102
  * Get field HTML
103
  *
104
+ * @param mixed $meta
105
+ * @param array $field
106
  *
107
  * @return string
108
  */
109
  static function html( $meta, $field )
110
  {
111
+ $i18n_title = apply_filters( 'rwmb_file_upload_string', _x( 'Upload Files', 'file upload', 'meta-box' ), $field );
112
+ $i18n_more = apply_filters( 'rwmb_file_add_string', _x( '+ Add new file', 'file upload', 'meta-box' ), $field );
113
 
114
  // Uploaded files
115
+ $html = self::get_uploaded_files( $meta, $field );
116
  $new_file_classes = array( 'new-files' );
117
  if ( ! empty( $field['max_file_uploads'] ) && count( $meta ) >= (int) $field['max_file_uploads'] )
118
  $new_file_classes[] = 'hidden';
135
 
136
  static function get_uploaded_files( $files, $field )
137
  {
138
+ $reorder_nonce = wp_create_nonce( "rwmb-reorder-files_{$field['id']}" );
139
+ $delete_nonce = wp_create_nonce( "rwmb-delete-file_{$field['id']}" );
140
+
141
+ $classes = array( 'rwmb-file', 'rwmb-uploaded' );
142
+ if ( count( $files ) <= 0 )
143
  $classes[] = 'hidden';
144
+ $ol = '<ul class="%s" data-field_id="%s" data-delete_nonce="%s" data-reorder_nonce="%s" data-force_delete="%s" data-max_file_uploads="%s" data-mime_type="%s">';
145
  $html = sprintf(
146
  $ol,
147
  implode( ' ', $classes ),
148
  $field['id'],
149
  $delete_nonce,
150
+ $reorder_nonce,
151
  $field['force_delete'] ? 1 : 0,
152
  $field['max_file_uploads'],
153
  $field['mime_type']
165
 
166
  static function file_html( $attachment_id )
167
  {
168
+ $i18n_delete = apply_filters( 'rwmb_file_delete_string', _x( 'Delete', 'file upload', 'meta-box' ) );
169
+ $i18n_edit = apply_filters( 'rwmb_file_edit_string', _x( 'Edit', 'file upload', 'meta-box' ) );
170
+ $li = '
171
+ <li id="item_%s">
172
  <div class="rwmb-icon">%s</div>
173
  <div class="rwmb-info">
174
  <a href="%s" target="_blank">%s</a>
179
  </li>';
180
 
181
  $mime_type = get_post_mime_type( $attachment_id );
182
+
183
  return sprintf(
184
  $li,
185
+ $attachment_id,
186
  wp_get_attachment_image( $attachment_id, array( 60, 60 ), true ),
187
  wp_get_attachment_url( $attachment_id ),
188
  get_the_title( $attachment_id ),
209
  static function value( $new, $old, $post_id, $field )
210
  {
211
  $name = $field['id'];
212
+ if ( empty( $_FILES[$name] ) )
213
  return $new;
214
 
215
+ $new = array();
216
+ $files = self::fix_file_array( $_FILES[$name] );
217
 
218
  foreach ( $files as $file_item )
219
  {
231
  'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $file_name ) ),
232
  'post_content' => '',
233
  );
234
+ $id = wp_insert_attachment( $attachment, $file_name, $post_id );
235
 
236
  if ( ! is_wp_error( $id ) )
237
  {
247
 
248
  /**
249
  * Fixes the odd indexing of multiple file uploads from the format:
250
+ * $_FILES['field']['key']['index']
251
  * To the more standard and appropriate:
252
+ * $_FILES['field']['index']['key']
253
  *
254
  * @param array $files
255
  *
265
  $output[$index][$key] = $value;
266
  }
267
  }
268
+
269
  return $output;
270
  }
271
 
278
  */
279
  static function normalize_field( $field )
280
  {
281
+ $field = wp_parse_args( $field, array(
282
  'std' => array(),
283
  'force_delete' => false,
284
  'max_file_uploads' => 0,
285
  'mime_type' => '',
286
  ) );
287
  $field['multiple'] = true;
288
+
289
  return $field;
290
  }
291
 
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
  }
inc/fields/heading.php CHANGED
@@ -19,8 +19,8 @@ if ( ! class_exists( 'RWMB_Heading_Field' ) )
19
  /**
20
  * Show begin HTML markup for fields
21
  *
22
- * @param mixed $meta
23
- * @param array $field
24
  *
25
  * @return string
26
  */
@@ -35,8 +35,8 @@ if ( ! class_exists( 'RWMB_Heading_Field' ) )
35
  /**
36
  * Show end HTML markup for fields
37
  *
38
- * @param mixed $meta
39
- * @param array $field
40
  *
41
  * @return string
42
  */
19
  /**
20
  * Show begin HTML markup for fields
21
  *
22
+ * @param mixed $meta
23
+ * @param array $field
24
  *
25
  * @return string
26
  */
35
  /**
36
  * Show end HTML markup for fields
37
  *
38
+ * @param mixed $meta
39
+ * @param array $field
40
  *
41
  * @return string
42
  */
inc/fields/hidden.php CHANGED
@@ -9,8 +9,8 @@ if ( ! class_exists( 'RWMB_Hidden_Field' ) )
9
  /**
10
  * Get field HTML
11
  *
12
- * @param mixed $meta
13
- * @param array $field
14
  *
15
  * @return string
16
  */
@@ -24,4 +24,4 @@ if ( ! class_exists( 'RWMB_Hidden_Field' ) )
24
  );
25
  }
26
  }
27
- }
9
  /**
10
  * Get field HTML
11
  *
12
+ * @param mixed $meta
13
+ * @param array $field
14
  *
15
  * @return string
16
  */
24
  );
25
  }
26
  }
27
+ }
inc/fields/image-advanced.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php
2
  // Prevent loading this file directly
3
  defined( 'ABSPATH' ) || exit;
 
4
  require_once RWMB_FIELDS_DIR . 'image.php';
5
  if ( ! class_exists( 'RWMB_Image_Advanced_Field' ) )
6
  {
@@ -19,7 +20,7 @@ if ( ! class_exists( 'RWMB_Image_Advanced_Field' ) )
19
  wp_enqueue_media();
20
  wp_enqueue_script( 'rwmb-image-advanced', RWMB_JS_URL . 'image-advanced.js', array( 'jquery', 'underscore' ), RWMB_VER, true );
21
  wp_localize_script( 'rwmb-image-advanced', 'rwmbImageAdvanced', array(
22
- 'frameTitle' => __( 'Select Images', 'rwmb' ),
23
  ) );
24
  }
25
 
@@ -60,14 +61,14 @@ if ( ! class_exists( 'RWMB_Image_Advanced_Field' ) )
60
  /**
61
  * Get field HTML
62
  *
63
- * @param mixed $meta
64
- * @param array $field
65
  *
66
  * @return string
67
  */
68
  static function html( $meta, $field )
69
  {
70
- $i18n_title = apply_filters( 'rwmb_image_advanced_select_string', _x( 'Select or Upload Images', 'image upload', 'rwmb' ), $field );
71
  $attach_nonce = wp_create_nonce( "rwmb-attach-media_{$field['id']}" );
72
 
73
  // Uploaded images
@@ -98,30 +99,31 @@ if ( ! class_exists( 'RWMB_Image_Advanced_Field' ) )
98
  static function value( $new, $old, $post_id, $field )
99
  {
100
  $new = (array) $new;
 
101
  return array_unique( array_merge( $old, $new ) );
102
  }
103
 
104
  static function print_templates()
105
  {
106
- $i18n_delete = apply_filters( 'rwmb_image_delete_string', _x( 'Delete', 'image upload', 'rwmb' ) );
107
- $i18n_edit = apply_filters( 'rwmb_image_edit_string', _x( 'Edit', 'image upload', 'rwmb' ) );
108
  ?>
109
  <script id="tmpl-rwmb-image-advanced" type="text/html">
110
  <# _.each( attachments, function( attachment ) { #>
111
- <li id="item_{{{ attachment.id }}}">
112
- <# if ( attachment.sizes.hasOwnProperty( 'thumbnail' ) ) { #>
113
- <img src="{{{ attachment.sizes.thumbnail.url }}}">
114
- <# } else { #>
115
- <img src="{{{ attachment.sizes.full.url }}}">
116
- <# } #>
117
- <div class="rwmb-image-bar">
118
- <a title="<?php echo esc_attr( $i18n_edit ); ?>" class="rwmb-edit-file" href="{{{ attachment.editLink }}}" target="_blank"><?php echo esc_html( $i18n_edit ); ?></a> |
119
- <a title="<?php echo esc_attr( $i18n_delete ); ?>" class="rwmb-delete-file" href="#" data-attachment_id="{{{ attachment.id }}}">&times;</a>
120
- </div>
121
- </li>
122
- <# } ); #>
123
  </script>
124
- <?php
125
  }
126
 
127
  }
1
  <?php
2
  // Prevent loading this file directly
3
  defined( 'ABSPATH' ) || exit;
4
+
5
  require_once RWMB_FIELDS_DIR . 'image.php';
6
  if ( ! class_exists( 'RWMB_Image_Advanced_Field' ) )
7
  {
20
  wp_enqueue_media();
21
  wp_enqueue_script( 'rwmb-image-advanced', RWMB_JS_URL . 'image-advanced.js', array( 'jquery', 'underscore' ), RWMB_VER, true );
22
  wp_localize_script( 'rwmb-image-advanced', 'rwmbImageAdvanced', array(
23
+ 'frameTitle' => __( 'Select Images', 'meta-box' ),
24
  ) );
25
  }
26
 
61
  /**
62
  * Get field HTML
63
  *
64
+ * @param mixed $meta
65
+ * @param array $field
66
  *
67
  * @return string
68
  */
69
  static function html( $meta, $field )
70
  {
71
+ $i18n_title = apply_filters( 'rwmb_image_advanced_select_string', _x( 'Select or Upload Images', 'image upload', 'meta-box' ), $field );
72
  $attach_nonce = wp_create_nonce( "rwmb-attach-media_{$field['id']}" );
73
 
74
  // Uploaded images
99
  static function value( $new, $old, $post_id, $field )
100
  {
101
  $new = (array) $new;
102
+
103
  return array_unique( array_merge( $old, $new ) );
104
  }
105
 
106
  static function print_templates()
107
  {
108
+ $i18n_delete = apply_filters( 'rwmb_image_delete_string', _x( 'Delete', 'image upload', 'meta-box' ) );
109
+ $i18n_edit = apply_filters( 'rwmb_image_edit_string', _x( 'Edit', 'image upload', 'meta-box' ) );
110
  ?>
111
  <script id="tmpl-rwmb-image-advanced" type="text/html">
112
  <# _.each( attachments, function( attachment ) { #>
113
+ <li id="item_{{{ attachment.id }}}">
114
+ <# if ( attachment.sizes.hasOwnProperty( 'thumbnail' ) ) { #>
115
+ <img src="{{{ attachment.sizes.thumbnail.url }}}">
116
+ <# } else { #>
117
+ <img src="{{{ attachment.sizes.full.url }}}">
118
+ <# } #>
119
+ <div class="rwmb-image-bar">
120
+ <a title="<?php echo esc_attr( $i18n_edit ); ?>" class="rwmb-edit-file" href="{{{ attachment.editLink }}}" target="_blank"><?php echo esc_html( $i18n_edit ); ?></a> |
121
+ <a title="<?php echo esc_attr( $i18n_delete ); ?>" class="rwmb-delete-file" href="#" data-attachment_id="{{{ attachment.id }}}">&times;</a>
122
+ </div>
123
+ </li>
124
+ <# } ); #>
125
  </script>
126
+ <?php
127
  }
128
 
129
  }
inc/fields/image-select.php CHANGED
@@ -20,15 +20,15 @@ if ( ! class_exists( 'RWMB_Image_Select_Field' ) )
20
  /**
21
  * Get field HTML
22
  *
23
- * @param mixed $meta
24
- * @param array $field
25
  *
26
  * @return string
27
  */
28
  static function html( $meta, $field )
29
  {
30
  $html = array();
31
- $tpl = '<label class="rwmb-image-select"><img src="%s"><input type="%s" class="hidden" name="%s" value="%s"%s></label>';
32
 
33
  $meta = (array) $meta;
34
  foreach ( $field['options'] as $value => $image )
@@ -56,6 +56,7 @@ if ( ! class_exists( 'RWMB_Image_Select_Field' ) )
56
  static function normalize_field( $field )
57
  {
58
  $field['field_name'] .= $field['multiple'] ? '[]' : '';
 
59
  return $field;
60
  }
61
  }
20
  /**
21
  * Get field HTML
22
  *
23
+ * @param mixed $meta
24
+ * @param array $field
25
  *
26
  * @return string
27
  */
28
  static function html( $meta, $field )
29
  {
30
  $html = array();
31
+ $tpl = '<label class="rwmb-image-select"><img src="%s"><input type="%s" class="hidden" name="%s" value="%s"%s></label>';
32
 
33
  $meta = (array) $meta;
34
  foreach ( $field['options'] as $value => $image )
56
  static function normalize_field( $field )
57
  {
58
  $field['field_name'] .= $field['multiple'] ? '[]' : '';
59
+
60
  return $field;
61
  }
62
  }
inc/fields/image.php CHANGED
@@ -60,15 +60,15 @@ if ( ! class_exists( 'RWMB_Image_Field' ) )
60
  /**
61
  * Get field HTML
62
  *
63
- * @param mixed $meta
64
- * @param array $field
65
  *
66
  * @return string
67
  */
68
  static function html( $meta, $field )
69
  {
70
- $i18n_title = apply_filters( 'rwmb_image_upload_string', _x( 'Upload Images', 'image upload', 'rwmb' ), $field );
71
- $i18n_more = apply_filters( 'rwmb_image_add_string', _x( '+ Add new image', 'image upload', 'rwmb' ), $field );
72
 
73
  // Uploaded images
74
  $html = self::get_uploaded_images( $meta, $field );
@@ -99,11 +99,11 @@ if ( ! class_exists( 'RWMB_Image_Field' ) )
99
  static function get_uploaded_images( $images, $field )
100
  {
101
  $reorder_nonce = wp_create_nonce( "rwmb-reorder-images_{$field['id']}" );
102
- $delete_nonce = wp_create_nonce( "rwmb-delete-file_{$field['id']}" );
103
- $classes = array( 'rwmb-images', 'rwmb-uploaded' );
104
- if ( count( $images ) <= 0 )
105
  $classes[] = 'hidden';
106
- $ul = '<ul class="%s" data-field_id="%s" data-delete_nonce="%s" data-reorder_nonce="%s" data-force_delete="%s" data-max_file_uploads="%s">';
107
  $html = sprintf(
108
  $ul,
109
  implode( ' ', $classes ),
@@ -133,9 +133,9 @@ if ( ! class_exists( 'RWMB_Image_Field' ) )
133
  */
134
  static function img_html( $image )
135
  {
136
- $i18n_delete = apply_filters( 'rwmb_image_delete_string', _x( 'Delete', 'image upload', 'rwmb' ) );
137
- $i18n_edit = apply_filters( 'rwmb_image_edit_string', _x( 'Edit', 'image upload', 'rwmb' ) );
138
- $li = '
139
  <li id="item_%s">
140
  <img src="%s" />
141
  <div class="rwmb-image-bar">
60
  /**
61
  * Get field HTML
62
  *
63
+ * @param mixed $meta
64
+ * @param array $field
65
  *
66
  * @return string
67
  */
68
  static function html( $meta, $field )
69
  {
70
+ $i18n_title = apply_filters( 'rwmb_image_upload_string', _x( 'Upload Images', 'image upload', 'meta-box' ), $field );
71
+ $i18n_more = apply_filters( 'rwmb_image_add_string', _x( '+ Add new image', 'image upload', 'meta-box' ), $field );
72
 
73
  // Uploaded images
74
  $html = self::get_uploaded_images( $meta, $field );
99
  static function get_uploaded_images( $images, $field )
100
  {
101
  $reorder_nonce = wp_create_nonce( "rwmb-reorder-images_{$field['id']}" );
102
+ $delete_nonce = wp_create_nonce( "rwmb-delete-file_{$field['id']}" );
103
+ $classes = array( 'rwmb-images', 'rwmb-uploaded' );
104
+ if ( count( $images ) <= 0 )
105
  $classes[] = 'hidden';
106
+ $ul = '<ul class="%s" data-field_id="%s" data-delete_nonce="%s" data-reorder_nonce="%s" data-force_delete="%s" data-max_file_uploads="%s">';
107
  $html = sprintf(
108
  $ul,
109
  implode( ' ', $classes ),
133
  */
134
  static function img_html( $image )
135
  {
136
+ $i18n_delete = apply_filters( 'rwmb_image_delete_string', _x( 'Delete', 'image upload', 'meta-box' ) );
137
+ $i18n_edit = apply_filters( 'rwmb_image_edit_string', _x( 'Edit', 'image upload', 'meta-box' ) );
138
+ $li = '
139
  <li id="item_%s">
140
  <img src="%s" />
141
  <div class="rwmb-image-bar">
inc/fields/map.php CHANGED
@@ -20,8 +20,8 @@ if ( ! class_exists( 'RWMB_Map_Field' ) )
20
  /**
21
  * Get field HTML
22
  *
23
- * @param mixed $meta
24
- * @param array $field
25
  *
26
  * @return string
27
  */
@@ -45,7 +45,7 @@ if ( ! class_exists( 'RWMB_Map_Field' ) )
45
  $html .= sprintf(
46
  '<button class="button rwmb-map-goto-address-button" value="%s">%s</button>',
47
  is_array( $address ) ? implode( ',', $address ) : $address,
48
- __( 'Find Address', 'rwmb' )
49
  );
50
  }
51
 
20
  /**
21
  * Get field HTML
22
  *
23
+ * @param mixed $meta
24
+ * @param array $field
25
  *
26
  * @return string
27
  */
45
  $html .= sprintf(
46
  '<button class="button rwmb-map-goto-address-button" value="%s">%s</button>',
47
  is_array( $address ) ? implode( ',', $address ) : $address,
48
+ __( 'Find Address', 'meta-box' )
49
  );
50
  }
51
 
inc/fields/number.php CHANGED
@@ -9,8 +9,8 @@ if ( ! class_exists( 'RWMB_Number_Field' ) )
9
  /**
10
  * Get field HTML
11
  *
12
- * @param mixed $meta
13
- * @param array $field
14
  *
15
  * @return string
16
  */
@@ -40,7 +40,8 @@ if ( ! class_exists( 'RWMB_Number_Field' ) )
40
  'step' => 1,
41
  'min' => 0,
42
  ) );
 
43
  return $field;
44
  }
45
  }
46
- }
9
  /**
10
  * Get field HTML
11
  *
12
+ * @param mixed $meta
13
+ * @param array $field
14
  *
15
  * @return string
16
  */
40
  'step' => 1,
41
  'min' => 0,
42
  ) );
43
+
44
  return $field;
45
  }
46
  }
47
+ }
inc/fields/oembed.php CHANGED
@@ -51,14 +51,15 @@ if ( ! class_exists( 'RWMB_OEmbed_Field' ) )
51
  static function get_embed( $url )
52
  {
53
  $embed = @wp_oembed_get( $url );
54
- return $embed ? $embed : __( 'Embed HTML not available.', 'rwmb' );
 
55
  }
56
 
57
  /**
58
  * Get field HTML
59
  *
60
- * @param mixed $meta
61
- * @param array $field
62
  *
63
  * @return string
64
  */
@@ -73,7 +74,7 @@ if ( ! class_exists( 'RWMB_OEmbed_Field' ) )
73
  $field['id'],
74
  $meta,
75
  $field['size'],
76
- __( 'Preview', 'rwmb' ),
77
  $meta ? self::get_embed( $meta ) : ''
78
  );
79
  }
51
  static function get_embed( $url )
52
  {
53
  $embed = @wp_oembed_get( $url );
54
+
55
+ return $embed ? $embed : __( 'Embed HTML not available.', 'meta-box' );
56
  }
57
 
58
  /**
59
  * Get field HTML
60
  *
61
+ * @param mixed $meta
62
+ * @param array $field
63
  *
64
  * @return string
65
  */
74
  $field['id'],
75
  $meta,
76
  $field['size'],
77
+ __( 'Preview', 'meta-box' ),
78
  $meta ? self::get_embed( $meta ) : ''
79
  );
80
  }
inc/fields/password.php CHANGED
@@ -12,8 +12,8 @@ if ( ! class_exists( 'RWMB_Password_Field' ) )
12
  /**
13
  * Get field HTML
14
  *
15
- * @param mixed $meta
16
- * @param array $field
17
  *
18
  * @return string
19
  */
@@ -28,4 +28,4 @@ if ( ! class_exists( 'RWMB_Password_Field' ) )
28
  );
29
  }
30
  }
31
- }
12
  /**
13
  * Get field HTML
14
  *
15
+ * @param mixed $meta
16
+ * @param array $field
17
  *
18
  * @return string
19
  */
28
  );
29
  }
30
  }
31
+ }
inc/fields/plupload-image.php CHANGED
@@ -9,7 +9,7 @@ if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
9
  /**
10
  * Add field actions
11
  *
12
- * @return void
13
  */
14
  static function add_actions()
15
  {
@@ -26,14 +26,14 @@ if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
26
  static function handle_upload()
27
  {
28
  global $wpdb;
29
- $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
30
  $field_id = isset( $_REQUEST['field_id'] ) ? $_REQUEST['field_id'] : '';
31
 
32
  check_ajax_referer( "rwmb-upload-images_{$field_id}" );
33
 
34
  // You can use WP's wp_handle_upload() function:
35
- $file = $_FILES['async-upload'];
36
- $file_attr = wp_handle_upload( $file, array( 'test_form' => false ) );
37
  //Get next menu_order
38
  $meta = get_post_meta( $post_id, $field_id, false );
39
  if ( empty( $meta ) )
@@ -91,8 +91,8 @@ if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
91
  /**
92
  * Get field HTML
93
  *
94
- * @param mixed $meta
95
- * @param array $field
96
  *
97
  * @return string
98
  */
@@ -102,15 +102,15 @@ if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
102
  $meta = ( array ) $meta;
103
 
104
  // Filter to change the drag & drop box background string
105
- $i18n_drop = apply_filters( 'rwmb_plupload_image_drop_string', _x( 'Drop images here', 'image upload', 'rwmb' ), $field );
106
- $i18n_or = apply_filters( 'rwmb_plupload_image_or_string', _x( 'or', 'image upload', 'rwmb' ), $field );
107
- $i18n_select = apply_filters( 'rwmb_plupload_image_select_string', _x( 'Select Files', 'image upload', 'rwmb' ), $field );
108
 
109
  // Uploaded images
110
 
111
  // Check for max_file_uploads
112
- $classes = array( 'rwmb-drag-drop', 'drag-drop', 'hide-if-no-js', 'new-files');
113
- if ( ! empty( $field['max_file_uploads'] ) && count( $meta ) >= (int) $field['max_file_uploads'] )
114
  $classes[] = 'hidden';
115
 
116
 
@@ -152,6 +152,7 @@ if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
152
  static function value( $new, $old, $post_id, $field )
153
  {
154
  $new = (array) $new;
 
155
  return array_unique( array_merge( $old, $new ) );
156
  }
157
 
@@ -165,30 +166,30 @@ if ( ! class_exists( 'RWMB_Plupload_Image_Field' ) )
165
  static function normalize_field( $field )
166
  {
167
  $field['js_options'] = array(
168
- 'runtimes' => 'html5,silverlight,flash,html4',
169
- 'file_data_name' => 'async-upload',
170
  //'container' => $field['id'] . '-container',
171
- 'browse_button' => $field['id'] . '-browse-button',
172
- 'drop_element' => $field['id'] . '-dragdrop',
173
- 'multiple_queues' => true,
174
- 'max_file_size' => wp_max_upload_size() . 'b',
175
- 'url' => admin_url( 'admin-ajax.php' ),
176
- 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
177
- 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
178
- 'multipart' => true,
179
- 'urlstream_upload' => true,
180
- 'filters' => array(
181
  array(
182
- 'title' => _x( 'Allowed Image Files', 'image upload', 'rwmb' ),
183
  'extensions' => 'jpg,jpeg,gif,png',
184
  ),
185
  ),
186
- 'multipart_params' => array(
187
- 'field_id' => $field['id'],
188
- 'action' => 'rwmb_plupload_image_upload',
189
  )
190
  );
191
- $field = parent::normalize_field( $field );
192
 
193
  return $field;
194
  }
9
  /**
10
  * Add field actions
11
  *
12
+ * @return void
13
  */
14
  static function add_actions()
15
  {
26
  static function handle_upload()
27
  {
28
  global $wpdb;
29
+ $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
30
  $field_id = isset( $_REQUEST['field_id'] ) ? $_REQUEST['field_id'] : '';
31
 
32
  check_ajax_referer( "rwmb-upload-images_{$field_id}" );
33
 
34
  // You can use WP's wp_handle_upload() function:
35
+ $file = $_FILES['async-upload'];
36
+ $file_attr = wp_handle_upload( $file, array( 'test_form' => false ) );
37
  //Get next menu_order
38
  $meta = get_post_meta( $post_id, $field_id, false );
39
  if ( empty( $meta ) )
91
  /**
92
  * Get field HTML
93
  *
94
+ * @param mixed $meta
95
+ * @param array $field
96
  *
97
  * @return string
98
  */
102
  $meta = ( array ) $meta;
103
 
104
  // Filter to change the drag & drop box background string
105
+ $i18n_drop = apply_filters( 'rwmb_plupload_image_drop_string', _x( 'Drop images here', 'image upload', 'meta-box' ), $field );
106
+ $i18n_or = apply_filters( 'rwmb_plupload_image_or_string', _x( 'or', 'image upload', 'meta-box' ), $field );
107
+ $i18n_select = apply_filters( 'rwmb_plupload_image_select_string', _x( 'Select Files', 'image upload', 'meta-box' ), $field );
108
 
109
  // Uploaded images
110
 
111
  // Check for max_file_uploads
112
+ $classes = array( 'rwmb-drag-drop', 'drag-drop', 'hide-if-no-js', 'new-files' );
113
+ if ( ! empty( $field['max_file_uploads'] ) && count( $meta ) >= (int) $field['max_file_uploads'] )
114
  $classes[] = 'hidden';
115
 
116
 
152
  static function value( $new, $old, $post_id, $field )
153
  {
154
  $new = (array) $new;
155
+
156
  return array_unique( array_merge( $old, $new ) );
157
  }
158
 
166
  static function normalize_field( $field )
167
  {
168
  $field['js_options'] = array(
169
+ 'runtimes' => 'html5,silverlight,flash,html4',
170
+ 'file_data_name' => 'async-upload',
171
  //'container' => $field['id'] . '-container',
172
+ 'browse_button' => $field['id'] . '-browse-button',
173
+ 'drop_element' => $field['id'] . '-dragdrop',
174
+ 'multiple_queues' => true,
175
+ 'max_file_size' => wp_max_upload_size() . 'b',
176
+ 'url' => admin_url( 'admin-ajax.php' ),
177
+ 'flash_swf_url' => includes_url( 'js/plupload/plupload.flash.swf' ),
178
+ 'silverlight_xap_url' => includes_url( 'js/plupload/plupload.silverlight.xap' ),
179
+ 'multipart' => true,
180
+ 'urlstream_upload' => true,
181
+ 'filters' => array(
182
  array(
183
+ 'title' => _x( 'Allowed Image Files', 'image upload', 'meta-box' ),
184
  'extensions' => 'jpg,jpeg,gif,png',
185
  ),
186
  ),
187
+ 'multipart_params' => array(
188
+ 'field_id' => $field['id'],
189
+ 'action' => 'rwmb_plupload_image_upload',
190
  )
191
  );
192
+ $field = parent::normalize_field( $field );
193
 
194
  return $field;
195
  }
inc/fields/post.php CHANGED
@@ -22,8 +22,8 @@ if ( ! class_exists( 'RWMB_Post_Field' ) )
22
  /**
23
  * Get field HTML
24
  *
25
- * @param mixed $meta
26
- * @param array $field
27
  *
28
  * @return string
29
  */
@@ -49,10 +49,10 @@ if ( ! class_exists( 'RWMB_Post_Field' ) )
49
  */
50
  static function normalize_field( $field )
51
  {
52
- $default_post_type = __( 'Post', 'rwmb' );
53
  if ( is_string( $field['post_type'] ) )
54
  {
55
- $post_type_object = get_post_type_object( $field['post_type'] );
56
  $default_post_type = $post_type_object->labels->singular_name;
57
  }
58
 
@@ -63,18 +63,18 @@ if ( ! class_exists( 'RWMB_Post_Field' ) )
63
  'query_args' => array(),
64
  ) );
65
 
66
- $field['std'] = empty( $field['std'] ) ? sprintf( __( 'Select a %s', 'rwmb' ), $default_post_type ) : $field['std'];
67
 
68
  if ( $field['parent'] )
69
  {
70
- $field['multiple'] = false;
71
  $field['field_name'] = 'parent_id';
72
  }
73
 
74
  $field['query_args'] = wp_parse_args( $field['query_args'], array(
75
  'post_type' => $field['post_type'],
76
  'post_status' => 'publish',
77
- 'posts_per_page' => -1,
78
  ) );
79
 
80
  switch ( $field['field_type'] )
@@ -106,8 +106,10 @@ if ( ! class_exists( 'RWMB_Post_Field' ) )
106
  if ( isset( $field['parent'] ) && $field['parent'] )
107
  {
108
  $post = get_post( $post_id );
 
109
  return $post->post_parent;
110
  }
 
111
  return RWMB_Select_Field::meta( $post_id, $saved, $field );
112
  }
113
 
@@ -137,16 +139,17 @@ if ( ! class_exists( 'RWMB_Post_Field' ) )
137
  */
138
  static function get_options( $field )
139
  {
140
- $query = new WP_Query( $field['query_args'] );
141
- if ( $query->have_posts() ) {
142
- while( $query->have_posts() )
 
 
143
  {
144
- $post = $query->next_post();
145
  $options[$post->ID] = $post->post_title;
146
  }
147
- } else {
148
- $options = array();
149
  }
 
150
  return $options;
151
  }
152
  }
22
  /**
23
  * Get field HTML
24
  *
25
+ * @param mixed $meta
26
+ * @param array $field
27
  *
28
  * @return string
29
  */
49
  */
50
  static function normalize_field( $field )
51
  {
52
+ $default_post_type = __( 'Post', 'meta-box' );
53
  if ( is_string( $field['post_type'] ) )
54
  {
55
+ $post_type_object = get_post_type_object( $field['post_type'] );
56
  $default_post_type = $post_type_object->labels->singular_name;
57
  }
58
 
63
  'query_args' => array(),
64
  ) );
65
 
66
+ $field['std'] = empty( $field['std'] ) ? sprintf( __( 'Select a %s', 'meta-box' ), $default_post_type ) : $field['std'];
67
 
68
  if ( $field['parent'] )
69
  {
70
+ $field['multiple'] = false;
71
  $field['field_name'] = 'parent_id';
72
  }
73
 
74
  $field['query_args'] = wp_parse_args( $field['query_args'], array(
75
  'post_type' => $field['post_type'],
76
  'post_status' => 'publish',
77
+ 'posts_per_page' => - 1,
78
  ) );
79
 
80
  switch ( $field['field_type'] )
106
  if ( isset( $field['parent'] ) && $field['parent'] )
107
  {
108
  $post = get_post( $post_id );
109
+
110
  return $post->post_parent;
111
  }
112
+
113
  return RWMB_Select_Field::meta( $post_id, $saved, $field );
114
  }
115
 
139
  */
140
  static function get_options( $field )
141
  {
142
+ $options = array();
143
+ $query = new WP_Query( $field['query_args'] );
144
+ if ( $query->have_posts() )
145
+ {
146
+ while ( $query->have_posts() )
147
  {
148
+ $post = $query->next_post();
149
  $options[$post->ID] = $post->post_title;
150
  }
 
 
151
  }
152
+
153
  return $options;
154
  }
155
  }
inc/fields/radio.php CHANGED
@@ -9,15 +9,15 @@ if ( ! class_exists( 'RWMB_Radio_Field' ) )
9
  /**
10
  * Get field HTML
11
  *
12
- * @param mixed $meta
13
- * @param array $field
14
  *
15
  * @return string
16
  */
17
  static function html( $meta, $field )
18
  {
19
  $html = array();
20
- $tpl = '<label><input type="radio" class="rwmb-radio" name="%s" value="%s"%s> %s</label>';
21
 
22
  foreach ( $field['options'] as $value => $label )
23
  {
9
  /**
10
  * Get field HTML
11
  *
12
+ * @param mixed $meta
13
+ * @param array $field
14
  *
15
  * @return string
16
  */
17
  static function html( $meta, $field )
18
  {
19
  $html = array();
20
+ $tpl = '<label><input type="radio" class="rwmb-radio" name="%s" value="%s"%s> %s</label>';
21
 
22
  foreach ( $field['options'] as $value => $label )
23
  {
inc/fields/range.php CHANGED
@@ -19,8 +19,8 @@ if ( ! class_exists( 'RWMB_Range_Field' ) )
19
  /**
20
  * Get field HTML
21
  *
22
- * @param mixed $meta
23
- * @param array $field
24
  *
25
  * @return string
26
  */
@@ -51,6 +51,7 @@ if ( ! class_exists( 'RWMB_Range_Field' ) )
51
  'max' => 10,
52
  'step' => 1,
53
  ) );
 
54
  return $field;
55
  }
56
 
19
  /**
20
  * Get field HTML
21
  *
22
+ * @param mixed $meta
23
+ * @param array $field
24
  *
25
  * @return string
26
  */
51
  'max' => 10,
52
  'step' => 1,
53
  ) );
54
+
55
  return $field;
56
  }
57
 
inc/fields/select-advanced.php CHANGED
@@ -26,8 +26,8 @@ if ( ! class_exists( 'RWMB_Select_Advanced_Field' ) )
26
  /**
27
  * Get field HTML
28
  *
29
- * @param mixed $meta
30
- * @param array $field
31
  *
32
  * @return string
33
  */
26
  /**
27
  * Get field HTML
28
  *
29
+ * @param mixed $meta
30
+ * @param array $field
31
  *
32
  * @return string
33
  */
inc/fields/select.php CHANGED
@@ -19,8 +19,8 @@ if ( ! class_exists( 'RWMB_Select_Field' ) )
19
  /**
20
  * Get field HTML
21
  *
22
- * @param mixed $meta
23
- * @param array $field
24
  *
25
  * @return string
26
  */
@@ -136,7 +136,7 @@ if ( ! class_exists( 'RWMB_Select_Field' ) )
136
  $html .= sprintf(
137
  $option,
138
  $value,
139
- selected( in_array( $value, (array)$meta ), true, false ),
140
  $label
141
  );
142
  }
19
  /**
20
  * Get field HTML
21
  *
22
+ * @param mixed $meta
23
+ * @param array $field
24
  *
25
  * @return string
26
  */
136
  $html .= sprintf(
137
  $option,
138
  $value,
139
+ selected( in_array( $value, (array) $meta ), true, false ),
140
  $label
141
  );
142
  }
inc/fields/slider.php CHANGED
@@ -25,8 +25,8 @@ if ( ! class_exists( 'RWMB_Slider_Field' ) )
25
  /**
26
  * Get div HTML
27
  *
28
- * @param mixed $meta
29
- * @param array $field
30
  *
31
  * @return string
32
  */
@@ -53,7 +53,7 @@ if ( ! class_exists( 'RWMB_Slider_Field' ) )
53
  */
54
  static function normalize_field( $field )
55
  {
56
- $field = wp_parse_args( $field, array(
57
  'prefix' => '',
58
  'suffix' => '',
59
  'js_options' => array(),
25
  /**
26
  * Get div HTML
27
  *
28
+ * @param mixed $meta
29
+ * @param array $field
30
  *
31
  * @return string
32
  */
53
  */
54
  static function normalize_field( $field )
55
  {
56
+ $field = wp_parse_args( $field, array(
57
  'prefix' => '',
58
  'suffix' => '',
59
  'js_options' => array(),
inc/fields/taxonomy-advanced.php CHANGED
@@ -55,6 +55,7 @@ if ( ! class_exists( 'RWMB_Taxonomy_Advanced_Field' ) )
55
  {
56
  $meta = get_post_meta( $post_id, $field['id'], true );
57
  $meta = array_map( 'intval', array_filter( explode( ',', $meta . ',' ) ) );
 
58
  return $meta;
59
  }
60
  }
55
  {
56
  $meta = get_post_meta( $post_id, $field['id'], true );
57
  $meta = array_map( 'intval', array_filter( explode( ',', $meta . ',' ) ) );
58
+
59
  return $meta;
60
  }
61
  }
inc/fields/taxonomy.php CHANGED
@@ -36,10 +36,10 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
36
  // Set default args
37
  $field['options']['args'] = ! isset( $field['options']['args'] ) ? $default_args : wp_parse_args( $field['options']['args'], $default_args );
38
 
39
- $tax = get_taxonomy( $field['options']['taxonomy'] );
40
- $field['placeholder'] = empty( $field['placeholder'] ) ? sprintf( __( 'Select a %s' , 'rwmb' ), $tax->labels->singular_name ) : $field['placeholder'];
41
 
42
- switch( $field['options']['type'] )
43
  {
44
  case 'select_advanced':
45
  $field = RWMB_Select_Advanced_Field::normalize_field( $field );
@@ -54,7 +54,7 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
54
  break;
55
  default:
56
  $field['options']['type'] = 'select';
57
- $field = RWMB_Select_Field::normalize_field( $field );
58
  }
59
 
60
  if ( in_array( $field['options']['type'], array( 'checkbox_tree', 'select_tree' ) ) )
@@ -92,18 +92,18 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
92
 
93
  $html = '';
94
 
95
- switch( $options['type'] )
96
  {
97
  case 'checkbox_list':
98
  $html = RWMB_Checkbox_List_Field::html( $meta, $field );
99
  break;
100
  case 'checkbox_tree':
101
  $elements = self::process_terms( $terms );
102
- $html .= self::walk_checkbox_tree( $meta, $field, $elements, $options['parent'], true );
103
  break;
104
  case 'select_tree':
105
  $elements = self::process_terms( $terms );
106
- $html .= self::walk_select_tree( $meta, $field, $elements, $options['parent'], true );
107
  break;
108
  case 'select_advanced':
109
  $html = RWMB_Select_Advanced_Field::html( $meta, $field );
@@ -131,12 +131,12 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
131
  {
132
  if ( ! isset( $elements[$parent] ) )
133
  return;
134
- $terms = $elements[$parent];
135
  $field['options'] = self::get_options( $terms );
136
- $hidden = $active ? '' : 'hidden';
137
 
138
  $html = "<ul class = 'rw-taxonomy-tree {$hidden}'>";
139
- $li = '<li><label><input type="checkbox" name="%s" value="%s"%s> %s</label>';
140
  foreach ( $terms as $term )
141
  {
142
  $html .= sprintf(
@@ -168,18 +168,18 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
168
  {
169
  if ( ! isset( $elements[$parent] ) )
170
  return;
171
- $terms = $elements[$parent];
172
  $field['options'] = self::get_options( $terms );
173
 
174
- $classes = array( 'rw-taxonomy-tree' );
175
  $classes[] = $active ? 'active' : 'disabled';
176
  $classes[] = "rwmb-taxonomy-{$parent}";
177
 
178
- $html = '<div class="' . implode( ' ', $classes ) . '">';
179
  $html .= RWMB_Select_Field::html( $meta, $field );
180
  foreach ( $terms as $term )
181
  {
182
- $html .= self::walk_select_tree( $meta, $field, $elements, $term->term_id, $active && in_array( $term->term_id, $meta ) );
183
  }
184
  $html .= '</div>';
185
 
@@ -201,6 +201,7 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
201
  {
202
  $elements[$term->parent][] = $term;
203
  }
 
204
  return $elements;
205
  }
206
 
@@ -214,10 +215,11 @@ if ( ! class_exists( 'RWMB_Taxonomy_Field' ) )
214
  static function get_options( $terms = array() )
215
  {
216
  $options = array();
217
- foreach( $terms as $term )
218
  {
219
  $options[$term->term_id] = $term->name;
220
  }
 
221
  return $options;
222
  }
223
 
36
  // Set default args
37
  $field['options']['args'] = ! isset( $field['options']['args'] ) ? $default_args : wp_parse_args( $field['options']['args'], $default_args );
38
 
39
+ $tax = get_taxonomy( $field['options']['taxonomy'] );
40
+ $field['placeholder'] = empty( $field['placeholder'] ) ? sprintf( __( 'Select a %s', 'meta-box' ), $tax->labels->singular_name ) : $field['placeholder'];
41
 
42
+ switch ( $field['options']['type'] )
43
  {
44
  case 'select_advanced':
45
  $field = RWMB_Select_Advanced_Field::normalize_field( $field );
54
  break;
55
  default:
56
  $field['options']['type'] = 'select';
57
+ $field = RWMB_Select_Field::normalize_field( $field );
58
  }
59
 
60
  if ( in_array( $field['options']['type'], array( 'checkbox_tree', 'select_tree' ) ) )
92
 
93
  $html = '';
94
 
95
+ switch ( $options['type'] )
96
  {
97
  case 'checkbox_list':
98
  $html = RWMB_Checkbox_List_Field::html( $meta, $field );
99
  break;
100
  case 'checkbox_tree':
101
  $elements = self::process_terms( $terms );
102
+ $html .= self::walk_checkbox_tree( $meta, $field, $elements, $options['parent'], true );
103
  break;
104
  case 'select_tree':
105
  $elements = self::process_terms( $terms );
106
+ $html .= self::walk_select_tree( $meta, $field, $elements, $options['parent'], true );
107
  break;
108
  case 'select_advanced':
109
  $html = RWMB_Select_Advanced_Field::html( $meta, $field );
131
  {
132
  if ( ! isset( $elements[$parent] ) )
133
  return;
134
+ $terms = $elements[$parent];
135
  $field['options'] = self::get_options( $terms );
136
+ $hidden = $active ? '' : 'hidden';
137
 
138
  $html = "<ul class = 'rw-taxonomy-tree {$hidden}'>";
139
+ $li = '<li><label><input type="checkbox" name="%s" value="%s"%s> %s</label>';
140
  foreach ( $terms as $term )
141
  {
142
  $html .= sprintf(
168
  {
169
  if ( ! isset( $elements[$parent] ) )
170
  return;
171
+ $terms = $elements[$parent];
172
  $field['options'] = self::get_options( $terms );
173
 
174
+ $classes = array( 'rw-taxonomy-tree' );
175
  $classes[] = $active ? 'active' : 'disabled';
176
  $classes[] = "rwmb-taxonomy-{$parent}";
177
 
178
+ $html = '<div class="' . implode( ' ', $classes ) . '">';
179
  $html .= RWMB_Select_Field::html( $meta, $field );
180
  foreach ( $terms as $term )
181
  {
182
+ $html .= self::walk_select_tree( $meta, $field, $elements, $term->term_id, $active && in_array( $term->term_id, $meta ) );
183
  }
184
  $html .= '</div>';
185
 
201
  {
202
  $elements[$term->parent][] = $term;
203
  }
204
+
205
  return $elements;
206
  }
207
 
215
  static function get_options( $terms = array() )
216
  {
217
  $options = array();
218
+ foreach ( $terms as $term )
219
  {
220
  $options[$term->term_id] = $term->name;
221
  }
222
+
223
  return $options;
224
  }
225
 
inc/fields/text-list.php CHANGED
@@ -16,12 +16,12 @@ if ( ! class_exists( 'RWMB_Text_List_Field' ) )
16
  */
17
  static function html( $meta, $field )
18
  {
19
- $html = '';
20
  $input = '<label><input type="text" class="rwmb-text-list" name="%s" id="%s" value="%s" placeholder="%s" /> %s</label>';
21
 
22
  $i = 0;
23
  foreach ( $field['options'] as $value => $label )
24
- {
25
  $html .= sprintf(
26
  $input,
27
  $field['field_name'],
@@ -30,8 +30,9 @@ if ( ! class_exists( 'RWMB_Text_List_Field' ) )
30
  $value,
31
  $label
32
  );
33
- $i++;
34
  }
 
35
  return $html;
36
  }
37
 
16
  */
17
  static function html( $meta, $field )
18
  {
19
+ $html = '';
20
  $input = '<label><input type="text" class="rwmb-text-list" name="%s" id="%s" value="%s" placeholder="%s" /> %s</label>';
21
 
22
  $i = 0;
23
  foreach ( $field['options'] as $value => $label )
24
+ {
25
  $html .= sprintf(
26
  $input,
27
  $field['field_name'],
30
  $value,
31
  $label
32
  );
33
+ $i ++;
34
  }
35
+
36
  return $html;
37
  }
38
 
inc/fields/text.php CHANGED
File without changes
inc/fields/textarea.php CHANGED
@@ -9,8 +9,8 @@ if ( ! class_exists( 'RWMB_Textarea_Field' ) )
9
  /**
10
  * Get field HTML
11
  *
12
- * @param mixed $meta
13
- * @param array $field
14
  *
15
  * @return string
16
  */
@@ -40,7 +40,8 @@ if ( ! class_exists( 'RWMB_Textarea_Field' ) )
40
  'cols' => 60,
41
  'rows' => 3,
42
  ) );
 
43
  return $field;
44
  }
45
  }
46
- }
9
  /**
10
  * Get field HTML
11
  *
12
+ * @param mixed $meta
13
+ * @param array $field
14
  *
15
  * @return string
16
  */
40
  'cols' => 60,
41
  'rows' => 3,
42
  ) );
43
+
44
  return $field;
45
  }
46
  }
47
+ }
inc/fields/thickbox-image.php CHANGED
@@ -24,14 +24,14 @@ if ( ! class_exists( 'RWMB_Thickbox_Image_Field' ) )
24
  /**
25
  * Get field HTML
26
  *
27
- * @param mixed $meta
28
- * @param array $field
29
  *
30
  * @return string
31
  */
32
  static function html( $meta, $field )
33
  {
34
- $i18n_title = apply_filters( 'rwmb_thickbox_image_upload_string', _x( 'Upload Images', 'image upload', 'rwmb' ), $field );
35
 
36
  // Uploaded images
37
  $html = self::get_uploaded_images( $meta, $field );
24
  /**
25
  * Get field HTML
26
  *
27
+ * @param mixed $meta
28
+ * @param array $field
29
  *
30
  * @return string
31
  */
32
  static function html( $meta, $field )
33
  {
34
+ $i18n_title = apply_filters( 'rwmb_thickbox_image_upload_string', _x( 'Upload Images', 'image upload', 'meta-box' ), $field );
35
 
36
  // Uploaded images
37
  $html = self::get_uploaded_images( $meta, $field );
inc/fields/time.php CHANGED
@@ -9,9 +9,9 @@ if ( ! class_exists( 'RWMB_Time_Field' ) )
9
  /**
10
  * Enqueue scripts and styles
11
  *
12
- * @return void
13
  */
14
- static function admin_enqueue_scripts( )
15
  {
16
  $url = RWMB_CSS_URL . 'jqueryui';
17
  wp_register_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
@@ -24,7 +24,7 @@ if ( ! class_exists( 'RWMB_Time_Field' ) )
24
  wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
25
  $deps = array( 'jquery-ui-timepicker' );
26
 
27
- $locale = str_replace( '_', '-', get_locale() );
28
  $timepicker_locale_js_url = '';
29
  if ( file_exists( RWMB_DIR . "js/jqueryui/timepicker-i18n/jquery-ui-timepicker-{$locale}.js" ) )
30
  {
@@ -40,15 +40,15 @@ if ( ! class_exists( 'RWMB_Time_Field' ) )
40
  $deps = array( 'jquery-ui-timepicker-i18n' );
41
  }
42
 
43
- wp_enqueue_script( 'rwmb-time', RWMB_JS_URL.'time.js', $deps, RWMB_VER, true );
44
  wp_localize_script( 'rwmb-time', 'RWMB_Timepicker', array( 'lang' => $locale ) );
45
  }
46
 
47
  /**
48
  * Get field HTML
49
  *
50
- * @param mixed $meta
51
- * @param array $field
52
  *
53
  * @return string
54
  */
9
  /**
10
  * Enqueue scripts and styles
11
  *
12
+ * @return void
13
  */
14
+ static function admin_enqueue_scripts()
15
  {
16
  $url = RWMB_CSS_URL . 'jqueryui';
17
  wp_register_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
24
  wp_register_script( 'jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array( 'jquery-ui-datepicker', 'jquery-ui-slider' ), '0.9.7', true );
25
  $deps = array( 'jquery-ui-timepicker' );
26
 
27
+ $locale = str_replace( '_', '-', get_locale() );
28
  $timepicker_locale_js_url = '';
29
  if ( file_exists( RWMB_DIR . "js/jqueryui/timepicker-i18n/jquery-ui-timepicker-{$locale}.js" ) )
30
  {
40
  $deps = array( 'jquery-ui-timepicker-i18n' );
41
  }
42
 
43
+ wp_enqueue_script( 'rwmb-time', RWMB_JS_URL . 'time.js', $deps, RWMB_VER, true );
44
  wp_localize_script( 'rwmb-time', 'RWMB_Timepicker', array( 'lang' => $locale ) );
45
  }
46
 
47
  /**
48
  * Get field HTML
49
  *
50
+ * @param mixed $meta
51
+ * @param array $field
52
  *
53
  * @return string
54
  */
inc/fields/url.php CHANGED
@@ -12,8 +12,8 @@ if ( ! class_exists( 'RWMB_URL_Field' ) )
12
  /**
13
  * Get field HTML
14
  *
15
- * @param mixed $meta
16
- * @param array $field
17
  *
18
  * @return string
19
  */
12
  /**
13
  * Get field HTML
14
  *
15
+ * @param mixed $meta
16
+ * @param array $field
17
  *
18
  * @return string
19
  */
inc/fields/user.php CHANGED
@@ -22,8 +22,8 @@ if ( ! class_exists( 'RWMB_User_Field' ) )
22
  /**
23
  * Get field HTML
24
  *
25
- * @param mixed $meta
26
- * @param array $field
27
  *
28
  * @return string
29
  */
@@ -50,16 +50,16 @@ if ( ! class_exists( 'RWMB_User_Field' ) )
50
  */
51
  static function normalize_field( $field )
52
  {
53
-
54
- $default_post_type = __( 'User', 'rwmb' );
55
-
56
  $field = wp_parse_args( $field, array(
57
  'field_type' => 'select_advanced',
58
  'parent' => false,
59
  'query_args' => array(),
60
  ) );
61
 
62
- $field['std'] = empty( $field['std'] ) ? sprintf( __( 'Select a %s', 'rwmb' ), $default_post_type ) : $field['std'];
63
 
64
  $field['query_args'] = wp_parse_args( $field['query_args'], array(
65
  'orderby' => 'display_name',
@@ -97,8 +97,10 @@ if ( ! class_exists( 'RWMB_User_Field' ) )
97
  if ( isset( $field['parent'] ) && $field['parent'] )
98
  {
99
  $post = get_post( $post_id );
 
100
  return $post->post_parent;
101
  }
 
102
  return RWMB_Select_Field::meta( $post_id, $saved, $field );
103
  }
104
 
@@ -132,8 +134,9 @@ if ( ! class_exists( 'RWMB_User_Field' ) )
132
  $options = array();
133
  foreach ( $results as $result )
134
  {
135
- $options[$result->ID] = $result->display_name ;
136
  }
 
137
  return $options;
138
  }
139
  }
22
  /**
23
  * Get field HTML
24
  *
25
+ * @param mixed $meta
26
+ * @param array $field
27
  *
28
  * @return string
29
  */
50
  */
51
  static function normalize_field( $field )
52
  {
53
+
54
+ $default_post_type = __( 'User', 'meta-box' );
55
+
56
  $field = wp_parse_args( $field, array(
57
  'field_type' => 'select_advanced',
58
  'parent' => false,
59
  'query_args' => array(),
60
  ) );
61
 
62
+ $field['std'] = empty( $field['std'] ) ? sprintf( __( 'Select a %s', 'meta-box' ), $default_post_type ) : $field['std'];
63
 
64
  $field['query_args'] = wp_parse_args( $field['query_args'], array(
65
  'orderby' => 'display_name',
97
  if ( isset( $field['parent'] ) && $field['parent'] )
98
  {
99
  $post = get_post( $post_id );
100
+
101
  return $post->post_parent;
102
  }
103
+
104
  return RWMB_Select_Field::meta( $post_id, $saved, $field );
105
  }
106
 
134
  $options = array();
135
  foreach ( $results as $result )
136
  {
137
+ $options[$result->ID] = $result->display_name;
138
  }
139
+
140
  return $options;
141
  }
142
  }
inc/fields/wysiwyg.php CHANGED
@@ -8,6 +8,7 @@ if ( ! class_exists( 'RWMB_Wysiwyg_Field' ) )
8
  {
9
 
10
  static $cloneable_editors = array();
 
11
  /**
12
  * Enqueue scripts and styles
13
  *
@@ -49,8 +50,8 @@ if ( ! class_exists( 'RWMB_Wysiwyg_Field' ) )
49
  /**
50
  * Get field HTML
51
  *
52
- * @param mixed $meta
53
- * @param array $field
54
  *
55
  * @return string
56
  */
@@ -62,7 +63,7 @@ if ( ! class_exists( 'RWMB_Wysiwyg_Field' ) )
62
  $field['options']['textarea_name'] = $field['field_name'];
63
 
64
  // Use new wp_editor() since WP 3.3
65
- wp_editor( $meta, $field['field_name'], $field['options'] );
66
 
67
  $editor = ob_get_clean();
68
  if ( $field['clone'] )
@@ -99,7 +100,8 @@ if ( ! class_exists( 'RWMB_Wysiwyg_Field' ) )
99
  return $field;
100
  }
101
 
102
- static function footer_scripts() {
 
103
  echo '<script> var rwmb_cloneable_editors = ' . json_encode( self::$cloneable_editors ) . ';</script>';
104
  }
105
  }
8
  {
9
 
10
  static $cloneable_editors = array();
11
+
12
  /**
13
  * Enqueue scripts and styles
14
  *
50
  /**
51
  * Get field HTML
52
  *
53
+ * @param mixed $meta
54
+ * @param array $field
55
  *
56
  * @return string
57
  */
63
  $field['options']['textarea_name'] = $field['field_name'];
64
 
65
  // Use new wp_editor() since WP 3.3
66
+ wp_editor( $meta, $field['id'], $field['options'] );
67
 
68
  $editor = ob_get_clean();
69
  if ( $field['clone'] )
100
  return $field;
101
  }
102
 
103
+ static function footer_scripts()
104
+ {
105
  echo '<script> var rwmb_cloneable_editors = ' . json_encode( self::$cloneable_editors ) . ';</script>';
106
  }
107
  }
inc/helpers.php CHANGED
@@ -28,6 +28,7 @@ if ( ! class_exists( 'RWMB_Helper' ) )
28
  * Shortcode to display meta value
29
  *
30
  * @param $atts Array of shortcode attributes, same as meta() function, but has more "meta_key" parameter
 
31
  * @see meta() function below
32
  *
33
  * @return string
@@ -226,6 +227,7 @@ if ( ! class_exists( 'RWMB_Helper' ) )
226
  static function file_info( $id )
227
  {
228
  $path = get_attached_file( $id );
 
229
  return array(
230
  'ID' => $id,
231
  'name' => basename( $path ),
@@ -254,7 +256,8 @@ if ( ! class_exists( 'RWMB_Helper' ) )
254
  return false;
255
 
256
  $attachment = get_post( $id );
257
- $path = get_attached_file( $id );
 
258
  return array(
259
  'ID' => $id,
260
  'name' => basename( $path ),
@@ -293,7 +296,7 @@ if ( ! class_exists( 'RWMB_Helper' ) )
293
  $parts[2] = 14;
294
 
295
  // Map parameters
296
- $args = wp_parse_args( $args, array(
297
  'width' => '640px',
298
  'height' => '480px',
299
  'marker' => true, // Display marker?
@@ -381,7 +384,8 @@ if ( ! class_exists( 'RWMB_Helper' ) )
381
  $html .= '} )();
382
  </script>';
383
 
384
- $counter++;
 
385
  return $html;
386
  }
387
  }
28
  * Shortcode to display meta value
29
  *
30
  * @param $atts Array of shortcode attributes, same as meta() function, but has more "meta_key" parameter
31
+ *
32
  * @see meta() function below
33
  *
34
  * @return string
227
  static function file_info( $id )
228
  {
229
  $path = get_attached_file( $id );
230
+
231
  return array(
232
  'ID' => $id,
233
  'name' => basename( $path ),
256
  return false;
257
 
258
  $attachment = get_post( $id );
259
+ $path = get_attached_file( $id );
260
+
261
  return array(
262
  'ID' => $id,
263
  'name' => basename( $path ),
296
  $parts[2] = 14;
297
 
298
  // Map parameters
299
+ $args = wp_parse_args( $args, array(
300
  'width' => '640px',
301
  'height' => '480px',
302
  'marker' => true, // Display marker?
384
  $html .= '} )();
385
  </script>';
386
 
387
+ $counter ++;
388
+
389
  return $html;
390
  }
391
  }
inc/init.php CHANGED
File without changes
inc/meta-box.php CHANGED
@@ -9,8 +9,8 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
9
  * A class to rapid develop meta boxes for custom & built in content types
10
  * Piggybacks on WordPress
11
  *
12
- * @author Rilwis
13
- * @author Co-Authors @see https://github.com/rilwis/meta-box
14
  * @license GNU GPL2+
15
  * @package RW Meta Box
16
  */
@@ -112,7 +112,7 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
112
 
113
  // Load clone script conditionally
114
  $has_clone = false;
115
- $fields = self::get_fields( $this->fields );
116
 
117
  foreach ( $fields as $field )
118
  {
@@ -158,7 +158,7 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
158
  }
159
 
160
  /**************************************************
161
- SHOW META BOX
162
  **************************************************/
163
 
164
  /**
@@ -199,6 +199,7 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
199
  {
200
  $hidden[] = $this->meta_box['id'];
201
  }
 
202
  return $hidden;
203
  }
204
 
@@ -216,7 +217,7 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
216
  // Container
217
  printf(
218
  '<div class="rwmb-meta-box" data-autosave="%s">',
219
- $this->meta_box['autosave'] ? 'true' : 'false'
220
  );
221
 
222
  wp_nonce_field( "rwmb-save-{$this->meta_box['id']}", "nonce_{$this->meta_box['id']}" );
@@ -241,7 +242,7 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
241
  {
242
  var rwmb = {
243
  validationOptions : jQuery.parseJSON( \'' . json_encode( $this->validation ) . '\' ),
244
- summaryMessage : "' . esc_js( __( 'Please correct the errors highlighted below and try again.', 'rwmb' ) ) . '"
245
  };
246
  }
247
  else
@@ -264,7 +265,7 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
264
  }
265
 
266
  /**************************************************
267
- SAVE META BOX
268
  **************************************************/
269
 
270
  /**
@@ -282,7 +283,7 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
282
  $this->saved = true;
283
 
284
  // Check whether form is submitted properly
285
- $id = $this->meta_box['id'];
286
  $nonce = isset( $_POST["nonce_{$id}"] ) ? sanitize_key( $_POST["nonce_{$id}"] ) : '';
287
  if ( empty( $_POST["nonce_{$id}"] ) || ! wp_verify_nonce( $nonce, "rwmb-save-{$id}" ) )
288
  return;
@@ -324,7 +325,7 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
324
  }
325
 
326
  /**************************************************
327
- HELPER FUNCTIONS
328
  **************************************************/
329
 
330
  /**
@@ -368,16 +369,16 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
368
  foreach ( $fields as &$field )
369
  {
370
  $field = wp_parse_args( $field, array(
371
- 'multiple' => false,
372
- 'clone' => false,
373
- 'std' => '',
374
- 'desc' => '',
375
- 'format' => '',
376
- 'before' => '',
377
- 'after' => '',
378
- 'field_name' => isset( $field['id'] ) ? $field['id'] : '',
379
- 'required' => false,
380
- 'placeholder' => '',
381
  ) );
382
 
383
  do_action( 'rwmb_before_normalize_field', $field );
@@ -420,6 +421,7 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
420
 
421
  // Relace whitespace with underscores
422
  $class = str_replace( ' ', '_', $class );
 
423
  return class_exists( $class ) ? $class : false;
424
  }
425
 
@@ -445,6 +447,7 @@ if ( ! class_exists( 'RW_Meta_Box' ) )
445
  return true;
446
  }
447
  }
 
448
  return false;
449
  }
450
  }
9
  * A class to rapid develop meta boxes for custom & built in content types
10
  * Piggybacks on WordPress
11
  *
12
+ * @author Rilwis
13
+ * @author Co-Authors @see https://github.com/rilwis/meta-box
14
  * @license GNU GPL2+
15
  * @package RW Meta Box
16
  */
112
 
113
  // Load clone script conditionally
114
  $has_clone = false;
115
+ $fields = self::get_fields( $this->fields );
116
 
117
  foreach ( $fields as $field )
118
  {
158
  }
159
 
160
  /**************************************************
161
+ * SHOW META BOX
162
  **************************************************/
163
 
164
  /**
199
  {
200
  $hidden[] = $this->meta_box['id'];
201
  }
202
+
203
  return $hidden;
204
  }
205
 
217
  // Container
218
  printf(
219
  '<div class="rwmb-meta-box" data-autosave="%s">',
220
+ $this->meta_box['autosave'] ? 'true' : 'false'
221
  );
222
 
223
  wp_nonce_field( "rwmb-save-{$this->meta_box['id']}", "nonce_{$this->meta_box['id']}" );
242
  {
243
  var rwmb = {
244
  validationOptions : jQuery.parseJSON( \'' . json_encode( $this->validation ) . '\' ),
245
+ summaryMessage : "' . esc_js( __( 'Please correct the errors highlighted below and try again.', 'meta-box' ) ) . '"
246
  };
247
  }
248
  else
265
  }
266
 
267
  /**************************************************
268
+ * SAVE META BOX
269
  **************************************************/
270
 
271
  /**
283
  $this->saved = true;
284
 
285
  // Check whether form is submitted properly
286
+ $id = $this->meta_box['id'];
287
  $nonce = isset( $_POST["nonce_{$id}"] ) ? sanitize_key( $_POST["nonce_{$id}"] ) : '';
288
  if ( empty( $_POST["nonce_{$id}"] ) || ! wp_verify_nonce( $nonce, "rwmb-save-{$id}" ) )
289
  return;
325
  }
326
 
327
  /**************************************************
328
+ * HELPER FUNCTIONS
329
  **************************************************/
330
 
331
  /**
369
  foreach ( $fields as &$field )
370
  {
371
  $field = wp_parse_args( $field, array(
372
+ 'multiple' => false,
373
+ 'clone' => false,
374
+ 'std' => '',
375
+ 'desc' => '',
376
+ 'format' => '',
377
+ 'before' => '',
378
+ 'after' => '',
379
+ 'field_name' => isset( $field['id'] ) ? $field['id'] : '',
380
+ 'required' => false,
381
+ 'placeholder' => '',
382
  ) );
383
 
384
  do_action( 'rwmb_before_normalize_field', $field );
421
 
422
  // Relace whitespace with underscores
423
  $class = str_replace( ' ', '_', $class );
424
+
425
  return class_exists( $class ) ? $class : false;
426
  }
427
 
447
  return true;
448
  }
449
  }
450
+
451
  return false;
452
  }
453
  }
js/autosave.js CHANGED
@@ -1,13 +1,15 @@
1
  jQuery( function( $ )
2
  {
 
 
3
  $( document ).ajaxSend( function( e, xhr, s )
4
  {
5
- if ( typeof s.data != 'undefined' && -1 != s.data.indexOf( 'action=autosave' ) )
6
  {
7
  $( '.rwmb-meta-box').each( function()
8
  {
9
  var $meta_box = $( this );
10
- if ( $meta_box.data( 'autosave' ) == true )
11
  {
12
  s.data += '&' + $meta_box.find( ':input' ).serialize();
13
  }
1
  jQuery( function( $ )
2
  {
3
+ 'use strict';
4
+
5
  $( document ).ajaxSend( function( e, xhr, s )
6
  {
7
+ if ( typeof s.data !== 'undefined' && -1 !== s.data.indexOf( 'action=autosave' ) )
8
  {
9
  $( '.rwmb-meta-box').each( function()
10
  {
11
  var $meta_box = $( this );
12
+ if ( $meta_box.data( 'autosave' ) === true )
13
  {
14
  s.data += '&' + $meta_box.find( ':input' ).serialize();
15
  }
js/clone.js CHANGED
@@ -1,43 +1,6 @@
1
  jQuery( function ( $ )
2
  {
3
- // Add more clones
4
- $( '.add-clone' ).on( 'click', function ( e )
5
- {
6
- e.preventDefault();
7
-
8
- var $input = $( this ).parents( '.rwmb-input' );
9
-
10
- if ( $( this ).parents( '.rwmb-field' ).hasClass( 'rwmb-wysiwyg-wrapper' ) )
11
- {
12
- cloneWYSIWYG( $input );
13
- }
14
- else
15
- {
16
- clone( $input );
17
- }
18
-
19
- toggleRemoveButtons( $input );
20
- } );
21
-
22
- // Remove clones
23
- $( '.rwmb-input' ).on( 'click', '.remove-clone', function ( e )
24
- {
25
- e.preventDefault();
26
-
27
- var $this = $( this ),
28
- $input = $this.parents( '.rwmb-input' );
29
-
30
- // Remove clone only if there're 2 or more of them
31
- if ( $input.find( '.rwmb-clone' ).length <= 1 )
32
- return;
33
-
34
- $this.parent().remove();
35
-
36
- // Toggle remove buttons
37
- toggleRemoveButtons( $input );
38
- } );
39
-
40
- toggleRemoveButtons();
41
 
42
  /**
43
  * Clone fields
@@ -58,7 +21,7 @@ jQuery( function ( $ )
58
  {
59
  var $this = $( this );
60
 
61
- if ( $this.attr( 'type' ) == 'radio' || $this.attr( 'type' ) == 'checkbox' )
62
  {
63
  // Reset 'checked' attribute
64
  $this.removeAttr( 'checked' );
@@ -72,7 +35,7 @@ jQuery( function ( $ )
72
  // Get the field name, and increment
73
  var name = $this.attr( 'name' ).replace( /\[(\d+)\]/, function ( match, p1 )
74
  {
75
- return '[' + ( parseInt( p1 ) + 1 ) + ']';
76
  } );
77
 
78
  // Update the "name" attribute
@@ -87,7 +50,7 @@ jQuery( function ( $ )
87
  {
88
  id = id.replace( /_(\d+)/, function ( match, p1 )
89
  {
90
- return '_' + ( parseInt( p1 ) + 1 );
91
  } );
92
  }
93
  else
@@ -108,7 +71,7 @@ jQuery( function ( $ )
108
  {
109
  value = value.replace( /_(\d+)/, function ( match, p1 )
110
  {
111
- return '_' + ( parseInt( p1 ) + 1 );
112
  } );
113
  }
114
  else
@@ -126,6 +89,31 @@ jQuery( function ( $ )
126
  $input.trigger( 'clone' );
127
  }
128
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  /**
130
  * Clone WYSIWYG field
131
  * @param $container
@@ -143,7 +131,7 @@ jQuery( function ( $ )
143
  var new_index = 0;
144
  var new_name = field_name.replace( /\[(\d+)\]/, function ( match, p1 )
145
  {
146
- new_index = ( parseInt( p1 ) + 1 );
147
  return '[' + new_index + ']';
148
  } );
149
 
@@ -186,8 +174,8 @@ jQuery( function ( $ )
186
 
187
 
188
  //Get TinyMCE setting for our fields
189
- var tmceinit = tinyMCEPreInit.mceInit[ $clone_first.find( 'textarea.wp-editor-area' ).attr( 'name' ) ];
190
- var tmceqtinit = tinyMCEPreInit.qtInit[ $clone_first.find( 'textarea.wp-editor-area' ).attr( 'name' ) ];
191
 
192
  //Replace id & elements with new created field names
193
  tmceinit.elements = new_name;
@@ -198,16 +186,16 @@ jQuery( function ( $ )
198
  {
199
  tinymce.init( tmceinit );
200
  }
201
- catch (e)
202
  {
203
  }
204
- if ( typeof(QTags) == 'function' )
205
  {
206
  try
207
  {
208
  quicktags( tmceqtinit );
209
  }
210
- catch (e)
211
  {
212
  }
213
  }
@@ -221,21 +209,45 @@ jQuery( function ( $ )
221
 
222
  }
223
 
224
- /**
225
- * Hide remove buttons when there's only 1 of them
226
- *
227
- * @param $el jQuery element. If not supplied, the function will applies for all fields
228
- *
229
- * @return void
230
- */
231
- function toggleRemoveButtons( $el )
232
  {
233
- var $button;
234
- $el = $el || $( '.rwmb-field' );
235
- $el.each( function ()
 
 
236
  {
237
- $button = $( this ).find( '.remove-clone' );
238
- $button.length < 2 ? $button.hide() : $button.show();
239
- } );
240
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  } );
1
  jQuery( function ( $ )
2
  {
3
+ 'use strict';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
 
5
  /**
6
  * Clone fields
21
  {
22
  var $this = $( this );
23
 
24
+ if ( $this.attr( 'type' ) === 'radio' || $this.attr( 'type' ) === 'checkbox' )
25
  {
26
  // Reset 'checked' attribute
27
  $this.removeAttr( 'checked' );
35
  // Get the field name, and increment
36
  var name = $this.attr( 'name' ).replace( /\[(\d+)\]/, function ( match, p1 )
37
  {
38
+ return '[' + ( parseInt( p1, 10 ) + 1 ) + ']';
39
  } );
40
 
41
  // Update the "name" attribute
50
  {
51
  id = id.replace( /_(\d+)/, function ( match, p1 )
52
  {
53
+ return '_' + ( parseInt( p1, 10 ) + 1 );
54
  } );
55
  }
56
  else
71
  {
72
  value = value.replace( /_(\d+)/, function ( match, p1 )
73
  {
74
+ return '_' + ( parseInt( p1, 10 ) + 1 );
75
  } );
76
  }
77
  else
89
  $input.trigger( 'clone' );
90
  }
91
 
92
+ /**
93
+ * Hide remove buttons when there's only 1 of them
94
+ *
95
+ * @param $el jQuery element. If not supplied, the function will applies for all fields
96
+ *
97
+ * @return void
98
+ */
99
+ function toggleRemoveButtons( $el )
100
+ {
101
+ var $button;
102
+ $el = $el || $( '.rwmb-field' );
103
+ $el.each( function ()
104
+ {
105
+ $button = $( this ).find( '.remove-clone' );
106
+ if ( $button.length < 2 )
107
+ {
108
+ $button.hide();
109
+ }
110
+ else
111
+ {
112
+ $button.show();
113
+ }
114
+ } );
115
+ }
116
+
117
  /**
118
  * Clone WYSIWYG field
119
  * @param $container
131
  var new_index = 0;
132
  var new_name = field_name.replace( /\[(\d+)\]/, function ( match, p1 )
133
  {
134
+ new_index = ( parseInt( p1, 10 ) + 1 );
135
  return '[' + new_index + ']';
136
  } );
137
 
174
 
175
 
176
  //Get TinyMCE setting for our fields
177
+ var tmceinit = tinyMCEPreInit.mceInit[$clone_first.find( 'textarea.wp-editor-area' ).attr( 'name' )];
178
+ var tmceqtinit = tinyMCEPreInit.qtInit[$clone_first.find( 'textarea.wp-editor-area' ).attr( 'name' )];
179
 
180
  //Replace id & elements with new created field names
181
  tmceinit.elements = new_name;
186
  {
187
  tinymce.init( tmceinit );
188
  }
189
+ catch ( e )
190
  {
191
  }
192
+ if ( typeof(QTags) === 'function' )
193
  {
194
  try
195
  {
196
  quicktags( tmceqtinit );
197
  }
198
+ catch ( e )
199
  {
200
  }
201
  }
209
 
210
  }
211
 
212
+
213
+ // Add more clones
214
+ $( '.add-clone' ).on( 'click', function ( e )
 
 
 
 
 
215
  {
216
+ e.preventDefault();
217
+
218
+ var $input = $( this ).parents( '.rwmb-input' );
219
+
220
+ if ( $( this ).parents( '.rwmb-field' ).hasClass( 'rwmb-wysiwyg-wrapper' ) )
221
  {
222
+ cloneWYSIWYG( $input );
223
+ }
224
+ else
225
+ {
226
+ clone( $input );
227
+ }
228
+
229
+ toggleRemoveButtons( $input );
230
+ } );
231
+
232
+ // Remove clones
233
+ $( '.rwmb-input' ).on( 'click', '.remove-clone', function ( e )
234
+ {
235
+ e.preventDefault();
236
+
237
+ var $this = $( this ),
238
+ $input = $this.parents( '.rwmb-input' );
239
+
240
+ // Remove clone only if there're 2 or more of them
241
+ if ( $input.find( '.rwmb-clone' ).length <= 1 )
242
+ {
243
+ return;
244
+ }
245
+
246
+ $this.parent().remove();
247
+
248
+ // Toggle remove buttons
249
+ toggleRemoveButtons( $input );
250
+ } );
251
+
252
+ toggleRemoveButtons();
253
  } );
js/color.js CHANGED
@@ -1,42 +1,44 @@
1
- /**
2
- * Update color picker element
3
- * Used for static & dynamic added elements (when clone)
4
- */
5
- jQuery( document ).ready( function( $ )
6
- {
7
- $( ':input.rwmb-color' ).each( rwmb_update_color_picker );
8
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-color', rwmb_update_color_picker )
9
- .on( 'focus', '.rwmb-color', function()
10
- {
11
- $( this ).siblings( '.rwmb-color-picker' ).show();
12
- return false;
13
- } ).on( 'blur', '.rwmb-color', function()
14
- {
15
- $( this ).siblings( '.rwmb-color-picker' ).hide();
16
- return false;
17
- } );
18
-
19
  function rwmb_update_color_picker()
20
  {
21
  var $this = $( this ),
22
- $clone_container = $this.closest('.rwmb-clone'),
23
  $color_picker = $this.siblings( '.rwmb-color-picker' );
24
-
25
  // Make sure the value is displayed
26
  if ( !$this.val() )
 
27
  $this.val( '#' );
28
-
29
- if( typeof jQuery.wp === 'object' && typeof jQuery.wp.wpColorPicker === 'function' ){
30
- if( $clone_container.length > 0 )
 
 
31
  {
32
  $this.appendTo( $clone_container ).siblings( 'div.wp-picker-container' ).remove();
33
  }
34
- $this.wpColorPicker();
35
  }
36
- else {
 
37
  //We use farbtastic if the WordPress color picker widget doesn't exist
38
- $color_picker.farbtastic( $this );
39
- }
40
  }
41
 
42
- } );
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( function ( $ )
2
+ {
3
+ 'use strict';
4
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  function rwmb_update_color_picker()
6
  {
7
  var $this = $( this ),
8
+ $clone_container = $this.closest( '.rwmb-clone' ),
9
  $color_picker = $this.siblings( '.rwmb-color-picker' );
10
+
11
  // Make sure the value is displayed
12
  if ( !$this.val() )
13
+ {
14
  $this.val( '#' );
15
+ }
16
+
17
+ if ( typeof $.wp === 'object' && typeof $.wp.wpColorPicker === 'function' )
18
+ {
19
+ if ( $clone_container.length > 0 )
20
  {
21
  $this.appendTo( $clone_container ).siblings( 'div.wp-picker-container' ).remove();
22
  }
23
+ $this.wpColorPicker();
24
  }
25
+ else
26
+ {
27
  //We use farbtastic if the WordPress color picker widget doesn't exist
28
+ $color_picker.farbtastic( $this );
29
+ }
30
  }
31
 
32
+ $( ':input.rwmb-color' ).each( rwmb_update_color_picker );
33
+ $( '.rwmb-input' )
34
+ .on( 'clone', ':input.rwmb-color', rwmb_update_color_picker )
35
+ .on( 'focus', '.rwmb-color', function ()
36
+ {
37
+ $( this ).siblings( '.rwmb-color-picker' ).show();
38
+ return false;
39
+ } ).on( 'blur', '.rwmb-color', function ()
40
+ {
41
+ $( this ).siblings( '.rwmb-color-picker' ).hide();
42
+ return false;
43
+ } );
44
+ } );
js/date.js CHANGED
@@ -1,19 +1,20 @@
1
- /**
2
- * Update date picker element
3
- * Used for static & dynamic added elements (when clone)
4
- */
5
- jQuery( document ).ready( function( $ )
6
  {
7
- $( ':input.rwmb-date' ).each( rwmb_update_date_picker );
8
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-date', rwmb_update_date_picker );
9
-
 
 
 
10
  function rwmb_update_date_picker()
11
  {
12
  var $this = $( this ),
13
  options = $this.data( 'options' );
14
-
15
  $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
16
  $this.removeClass( 'hasDatepicker' ).attr( 'id', '' ).datepicker( options );
17
  }
18
 
 
 
19
  } );
1
+ jQuery( function ( $ )
 
 
 
 
2
  {
3
+ 'use strict';
4
+
5
+ /**
6
+ * Update date picker element
7
+ * Used for static & dynamic added elements (when clone)
8
+ */
9
  function rwmb_update_date_picker()
10
  {
11
  var $this = $( this ),
12
  options = $this.data( 'options' );
13
+
14
  $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
15
  $this.removeClass( 'hasDatepicker' ).attr( 'id', '' ).datepicker( options );
16
  }
17
 
18
+ $( ':input.rwmb-date' ).each( rwmb_update_date_picker );
19
+ $( '.rwmb-input' ).on( 'clone', ':input.rwmb-date', rwmb_update_date_picker );
20
  } );
js/datetime.js CHANGED
@@ -1,19 +1,21 @@
1
- /**
2
- * Update datetime picker element
3
- * Used for static & dynamic added elements (when clone)
4
- */
5
- jQuery( document ).ready( function( $ )
6
  {
7
- $( ':input.rwmb-datetime' ).each( rwmb_update_datetime_picker );
8
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-datetime', rwmb_update_datetime_picker );
9
-
 
 
 
10
  function rwmb_update_datetime_picker()
11
  {
12
  var $this = $( this ),
13
  options = $this.data( 'options' );
14
-
15
  $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
16
  $this.removeClass( 'hasDatepicker' ).attr( 'id', '' ).datetimepicker( options );
17
-
18
  }
 
 
 
19
  } );
1
+ jQuery( function ( $ )
 
 
 
 
2
  {
3
+ 'use strict';
4
+
5
+ /**
6
+ * Update datetime picker element
7
+ * Used for static & dynamic added elements (when clone)
8
+ */
9
  function rwmb_update_datetime_picker()
10
  {
11
  var $this = $( this ),
12
  options = $this.data( 'options' );
13
+
14
  $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
15
  $this.removeClass( 'hasDatepicker' ).attr( 'id', '' ).datetimepicker( options );
16
+
17
  }
18
+
19
+ $( ':input.rwmb-datetime' ).each( rwmb_update_datetime_picker );
20
+ $( '.rwmb-input' ).on( 'clone', ':input.rwmb-datetime', rwmb_update_datetime_picker );
21
  } );
js/file-advanced.js CHANGED
@@ -1,8 +1,10 @@
1
- jQuery( function( $ )
2
  {
 
 
3
  var template = $( '#tmpl-rwmb-file-advanced' ).html();
4
 
5
- $( 'body' ).on( 'click', '.rwmb-file-advanced-upload', function( e )
6
  {
7
  e.preventDefault();
8
 
@@ -14,8 +16,8 @@ jQuery( function( $ )
14
  frame,
15
  frameOptions = {
16
  className: 'media-frame rwmb-file-frame',
17
- multiple: true,
18
- title: rwmbFileAdvanced.frameTitle
19
  };
20
 
21
  msg = msg.replace( '%d', maxFileUploads );
@@ -36,7 +38,7 @@ jQuery( function( $ )
36
  frame.off( 'select' );
37
 
38
  // Handle selection
39
- frame.on( 'select', function()
40
  {
41
  // Get selections
42
  var selection = frame.state().get( 'selection' ).toJSON(),
@@ -46,15 +48,17 @@ jQuery( function( $ )
46
  if ( maxFileUploads > 0 && ( uploaded + selection.length ) > maxFileUploads )
47
  {
48
  if ( uploaded < maxFileUploads )
 
49
  selection = selection.slice( 0, maxFileUploads - uploaded );
 
50
  alert( msg );
51
  }
52
 
53
  // Get only files that haven't been added to the list
54
  // Also prevent duplication when send ajax request
55
- selection = _.filter( selection, function( attachment )
56
  {
57
- return $fileList.children( 'li#item_' + attachment.id ).length == 0;
58
  } );
59
  ids = _.pluck( selection, 'id' );
60
 
@@ -62,21 +66,21 @@ jQuery( function( $ )
62
  {
63
  // Attach attachment to field and get HTML
64
  var data = {
65
- action: 'rwmb_attach_file',
66
- post_id: $( '#post_ID' ).val(),
67
- field_id: $fileList.data( 'field_id' ),
68
  attachment_ids: ids,
69
- _ajax_nonce: $uploadButton.data( 'attach_file_nonce' )
70
  };
71
- $.post( ajaxurl, data, function( r )
72
  {
73
  if ( r.success )
74
  {
75
  $fileList
76
  .append( _.template( template, { attachments: selection }, {
77
- evaluate: /<#([\s\S]+?)#>/g,
78
  interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
79
- escape: /\{\{([^\}]+?)\}\}(?!\})/g
80
  } ) )
81
  .trigger( 'update.rwmbFile' );
82
  }
1
+ jQuery( function ( $ )
2
  {
3
+ 'use strict';
4
+
5
  var template = $( '#tmpl-rwmb-file-advanced' ).html();
6
 
7
+ $( 'body' ).on( 'click', '.rwmb-file-advanced-upload', function ( e )
8
  {
9
  e.preventDefault();
10
 
16
  frame,
17
  frameOptions = {
18
  className: 'media-frame rwmb-file-frame',
19
+ multiple : true,
20
+ title : rwmbFileAdvanced.frameTitle
21
  };
22
 
23
  msg = msg.replace( '%d', maxFileUploads );
38
  frame.off( 'select' );
39
 
40
  // Handle selection
41
+ frame.on( 'select', function ()
42
  {
43
  // Get selections
44
  var selection = frame.state().get( 'selection' ).toJSON(),
48
  if ( maxFileUploads > 0 && ( uploaded + selection.length ) > maxFileUploads )
49
  {
50
  if ( uploaded < maxFileUploads )
51
+ {
52
  selection = selection.slice( 0, maxFileUploads - uploaded );
53
+ }
54
  alert( msg );
55
  }
56
 
57
  // Get only files that haven't been added to the list
58
  // Also prevent duplication when send ajax request
59
+ selection = _.filter( selection, function ( attachment )
60
  {
61
+ return $fileList.children( 'li#item_' + attachment.id ).length === 0;
62
  } );
63
  ids = _.pluck( selection, 'id' );
64
 
66
  {
67
  // Attach attachment to field and get HTML
68
  var data = {
69
+ action : 'rwmb_attach_file',
70
+ post_id : $( '#post_ID' ).val(),
71
+ field_id : $fileList.data( 'field_id' ),
72
  attachment_ids: ids,
73
+ _ajax_nonce : $uploadButton.data( 'attach_file_nonce' )
74
  };
75
+ $.post( ajaxurl, data, function ( r )
76
  {
77
  if ( r.success )
78
  {
79
  $fileList
80
  .append( _.template( template, { attachments: selection }, {
81
+ evaluate : /<#([\s\S]+?)#>/g,
82
  interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
83
+ escape : /\{\{([^\}]+?)\}\}(?!\})/g
84
  } ) )
85
  .trigger( 'update.rwmbFile' );
86
  }
js/file-input.js CHANGED
@@ -1,8 +1,10 @@
1
- jQuery( function( $ )
2
  {
 
 
3
  var frame;
4
 
5
- $( 'body' ).on( 'click', '.rwmb-file-input-select', function( e )
6
  {
7
  e.preventDefault();
8
  var $el = $( this );
@@ -12,8 +14,8 @@ jQuery( function( $ )
12
  {
13
  frame = wp.media( {
14
  className: 'media-frame rwmb-file-frame',
15
- multiple: false,
16
- title: rwmbFileInput.frameTitle
17
  } );
18
  }
19
 
@@ -24,7 +26,7 @@ jQuery( function( $ )
24
  frame.off( 'select' );
25
 
26
  // Handle selection
27
- frame.on( 'select', function()
28
  {
29
  var url = frame.state().get( 'selection' ).first().toJSON().url;
30
  $el.siblings( 'input' ).val( url ).siblings( 'a' ).removeClass( 'hidden' );
1
+ jQuery( function ( $ )
2
  {
3
+ 'use strict';
4
+
5
  var frame;
6
 
7
+ $( 'body' ).on( 'click', '.rwmb-file-input-select', function ( e )
8
  {
9
  e.preventDefault();
10
  var $el = $( this );
14
  {
15
  frame = wp.media( {
16
  className: 'media-frame rwmb-file-frame',
17
+ multiple : false,
18
+ title : rwmbFileInput.frameTitle
19
  } );
20
  }
21
 
26
  frame.off( 'select' );
27
 
28
  // Handle selection
29
+ frame.on( 'select', function ()
30
  {
31
  var url = frame.state().get( 'selection' ).first().toJSON().url;
32
  $el.siblings( 'input' ).val( url ).siblings( 'a' ).removeClass( 'hidden' );
js/file.js CHANGED
@@ -1,7 +1,9 @@
1
- jQuery( document ).ready( function( $ )
2
  {
 
 
3
  // Add more file
4
- $( '.rwmb-add-file' ).each( function()
5
  {
6
  var $this = $( this ),
7
  $uploads = $this.siblings( '.file-input' ),
@@ -14,13 +16,17 @@ jQuery( document ).ready( function( $ )
14
  // Hide "Add New File" and input fields when loaded
15
  if ( maxFileUploads > 0 )
16
  {
17
- if ( uploadCount + fileCount >= maxFileUploads )
 
18
  $this.hide();
 
19
  if ( fileCount >= maxFileUploads )
 
20
  $uploads.hide();
 
21
  }
22
 
23
- $this.click( function()
24
  {
25
  // Clone upload input only when needed
26
  if ( maxFileUploads <= 0 || uploadCount + fileCount < maxFileUploads )
@@ -29,8 +35,10 @@ jQuery( document ).ready( function( $ )
29
  uploadCount++;
30
 
31
  // If there're too many upload inputs, hide "Add New File"
32
- if ( maxFileUploads > 0 && uploadCount + fileCount >= maxFileUploads )
 
33
  $this.hide();
 
34
  }
35
 
36
  return false;
@@ -38,21 +46,21 @@ jQuery( document ).ready( function( $ )
38
  } );
39
 
40
  // Delete file via Ajax
41
- $( '.rwmb-uploaded' ).on( 'click', '.rwmb-delete-file', function()
42
  {
43
  var $this = $( this ),
44
  $parent = $this.parents( 'li' ),
45
  $container = $this.closest( '.rwmb-uploaded' ),
46
  data = {
47
- action: 'rwmb_delete_file',
48
- _ajax_nonce: $container.data( 'delete_nonce' ),
49
- post_id: $( '#post_ID' ).val(),
50
- field_id: $container.data( 'field_id' ),
51
  attachment_id: $this.data( 'attachment_id' ),
52
- force_delete: $container.data( 'force_delete' )
53
  };
54
 
55
- $.post( ajaxurl, data, function( r )
56
  {
57
  if ( !r.success )
58
  {
@@ -63,17 +71,17 @@ jQuery( document ).ready( function( $ )
63
  $parent.addClass( 'removed' );
64
 
65
  // If transition events not supported
 
66
  if (
67
- !( 'ontransitionend' in window )
68
- && ( 'onwebkittransitionend' in window )
69
- && !( 'onotransitionend' in myDiv || navigator.appName == 'Opera' )
70
  )
71
  {
72
  $parent.remove();
73
  $container.trigger( 'update.rwmbFile' );
74
  }
75
 
76
- $( '.rwmb-uploaded' ).on( 'transitionend webkitTransitionEnd otransitionend', 'li.removed', function()
77
  {
78
  $( this ).remove();
79
  $container.trigger( 'update.rwmbFile' );
@@ -84,26 +92,66 @@ jQuery( document ).ready( function( $ )
84
  } );
85
 
86
  //Remove deleted file
87
- $( '.rwmb-uploaded' ).on( 'transitionend webkitTransitionEnd otransitionend', 'li.removed', function() {
 
88
  $( this ).remove();
89
- });
90
 
91
- $( 'body' ).on( 'update.rwmbFile', '.rwmb-uploaded', function()
92
  {
93
  var $fileList = $( this ),
94
  maxFileUploads = $fileList.data( 'max_file_uploads' ),
95
  $uploader = $fileList.siblings( '.new-files' ),
96
  numFiles = $fileList.children().length;
97
 
98
- numFiles > 0 ? $fileList.removeClass( 'hidden' ) : $fileList.addClass( 'hidden' );
 
 
 
 
 
 
 
99
 
100
  // Return if maxFileUpload = 0
101
  if ( maxFileUploads === 0 )
 
102
  return false;
 
103
 
104
  // Hide files button if reach max file uploads
105
- numFiles >= maxFileUploads ? $uploader.addClass( 'hidden' ) : $uploader.removeClass( 'hidden' );
 
 
 
 
 
 
 
106
 
107
  return false;
108
  } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
  } );
1
+ jQuery( document ).ready( function ( $ )
2
  {
3
+ 'use strict';
4
+
5
  // Add more file
6
+ $( '.rwmb-add-file' ).each( function ()
7
  {
8
  var $this = $( this ),
9
  $uploads = $this.siblings( '.file-input' ),
16
  // Hide "Add New File" and input fields when loaded
17
  if ( maxFileUploads > 0 )
18
  {
19
+ if ( uploadCount + fileCount >= maxFileUploads )
20
+ {
21
  $this.hide();
22
+ }
23
  if ( fileCount >= maxFileUploads )
24
+ {
25
  $uploads.hide();
26
+ }
27
  }
28
 
29
+ $this.click( function ()
30
  {
31
  // Clone upload input only when needed
32
  if ( maxFileUploads <= 0 || uploadCount + fileCount < maxFileUploads )
35
  uploadCount++;
36
 
37
  // If there're too many upload inputs, hide "Add New File"
38
+ if ( maxFileUploads > 0 && uploadCount + fileCount >= maxFileUploads )
39
+ {
40
  $this.hide();
41
+ }
42
  }
43
 
44
  return false;
46
  } );
47
 
48
  // Delete file via Ajax
49
+ $( '.rwmb-uploaded' ).on( 'click', '.rwmb-delete-file', function ()
50
  {
51
  var $this = $( this ),
52
  $parent = $this.parents( 'li' ),
53
  $container = $this.closest( '.rwmb-uploaded' ),
54
  data = {
55
+ action : 'rwmb_delete_file',
56
+ _ajax_nonce : $container.data( 'delete_nonce' ),
57
+ post_id : $( '#post_ID' ).val(),
58
+ field_id : $container.data( 'field_id' ),
59
  attachment_id: $this.data( 'attachment_id' ),
60
+ force_delete : $container.data( 'force_delete' )
61
  };
62
 
63
+ $.post( ajaxurl, data, function ( r )
64
  {
65
  if ( !r.success )
66
  {
71
  $parent.addClass( 'removed' );
72
 
73
  // If transition events not supported
74
+ var div = document.createElement( 'div' );
75
  if (
76
+ !( 'ontransitionend' in window ) &&
77
+ ( 'onwebkittransitionend' in window ) && !( 'onotransitionend' in div || navigator.appName === 'Opera' )
 
78
  )
79
  {
80
  $parent.remove();
81
  $container.trigger( 'update.rwmbFile' );
82
  }
83
 
84
+ $( '.rwmb-uploaded' ).on( 'transitionend webkitTransitionEnd otransitionend', 'li.removed', function ()
85
  {
86
  $( this ).remove();
87
  $container.trigger( 'update.rwmbFile' );
92
  } );
93
 
94
  //Remove deleted file
95
+ $( '.rwmb-uploaded' ).on( 'transitionend webkitTransitionEnd otransitionend', 'li.removed', function ()
96
+ {
97
  $( this ).remove();
98
+ } );
99
 
100
+ $( 'body' ).on( 'update.rwmbFile', '.rwmb-uploaded', function ()
101
  {
102
  var $fileList = $( this ),
103
  maxFileUploads = $fileList.data( 'max_file_uploads' ),
104
  $uploader = $fileList.siblings( '.new-files' ),
105
  numFiles = $fileList.children().length;
106
 
107
+ if ( numFiles > 0 )
108
+ {
109
+ $fileList.removeClass( 'hidden' );
110
+ }
111
+ else
112
+ {
113
+ $fileList.addClass( 'hidden' );
114
+ }
115
 
116
  // Return if maxFileUpload = 0
117
  if ( maxFileUploads === 0 )
118
+ {
119
  return false;
120
+ }
121
 
122
  // Hide files button if reach max file uploads
123
+ if ( numFiles >= maxFileUploads )
124
+ {
125
+ $uploader.addClass( 'hidden' );
126
+ }
127
+ else
128
+ {
129
+ $uploader.removeClass( 'hidden' );
130
+ }
131
 
132
  return false;
133
  } );
134
+
135
+ // Reorder images
136
+ $( '.rwmb-file' ).each( function ()
137
+ {
138
+ var $this = $( this ),
139
+ data = {
140
+ action : 'rwmb_reorder_files',
141
+ _ajax_nonce: $this.data( 'reorder_nonce' ),
142
+ post_id : $( '#post_ID' ).val(),
143
+ field_id : $this.data( 'field_id' )
144
+ };
145
+ $this.sortable( {
146
+ placeholder: 'ui-state-highlight',
147
+ items : 'li',
148
+ update : function ()
149
+ {
150
+
151
+ data.order = $this.sortable( 'serialize' );
152
+
153
+ $.post( ajaxurl, data );
154
+ }
155
+ } );
156
+ } );
157
  } );
js/image-advanced.js CHANGED
@@ -1,10 +1,12 @@
1
- jQuery( function( $ )
2
  {
 
 
3
  // Use only one frame for all upload fields
4
  var frame,
5
  template = $( '#tmpl-rwmb-image-advanced' ).html();
6
 
7
- $( 'body' ).on( 'click', '.rwmb-image-advanced-upload', function( e )
8
  {
9
  e.preventDefault();
10
 
@@ -35,7 +37,7 @@ jQuery( function( $ )
35
  frame.off( 'select' );
36
 
37
  // Handle selection
38
- frame.on( 'select', function()
39
  {
40
  // Get selections
41
  var selection = frame.state().get( 'selection' ).toJSON(),
@@ -45,42 +47,44 @@ jQuery( function( $ )
45
  if ( maxFileUploads > 0 && ( uploaded + selection.length ) > maxFileUploads )
46
  {
47
  if ( uploaded < maxFileUploads )
 
48
  selection = selection.slice( 0, maxFileUploads - uploaded );
 
49
  alert( msg );
50
  }
51
 
52
  // Get only files that haven't been added to the list
53
  // Also prevent duplication when send ajax request
54
- selection = _.filter( selection, function( attachment )
55
  {
56
- return $imageList.children( 'li#item_' + attachment.id ).length == 0;
57
  } );
58
  ids = _.pluck( selection, 'id' );
59
 
60
- if( ids.length > 0 )
61
  {
62
  var data = {
63
- action : 'rwmb_attach_media',
64
- post_id : $( '#post_ID' ).val(),
65
- field_id : $imageList.data( 'field_id' ),
66
- attachment_ids : ids,
67
- _ajax_nonce : $uploadButton.data( 'attach_media_nonce' )
68
  };
69
 
70
- $.post( ajaxurl, data, function( r )
71
  {
72
- if( r.success )
73
  {
74
  $imageList
75
  .append( _.template( template, { attachments: selection }, {
76
- evaluate: /<#([\s\S]+?)#>/g,
77
  interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
78
- escape: /\{\{([^\}]+?)\}\}(?!\})/g
79
  } ) )
80
- .trigger('update.rwmbFile');
81
  }
82
  }, 'json' );
83
  }
84
  } );
85
- } )
86
  } );
1
+ jQuery( function ( $ )
2
  {
3
+ 'use strict';
4
+
5
  // Use only one frame for all upload fields
6
  var frame,
7
  template = $( '#tmpl-rwmb-image-advanced' ).html();
8
 
9
+ $( 'body' ).on( 'click', '.rwmb-image-advanced-upload', function ( e )
10
  {
11
  e.preventDefault();
12
 
37
  frame.off( 'select' );
38
 
39
  // Handle selection
40
+ frame.on( 'select', function ()
41
  {
42
  // Get selections
43
  var selection = frame.state().get( 'selection' ).toJSON(),
47
  if ( maxFileUploads > 0 && ( uploaded + selection.length ) > maxFileUploads )
48
  {
49
  if ( uploaded < maxFileUploads )
50
+ {
51
  selection = selection.slice( 0, maxFileUploads - uploaded );
52
+ }
53
  alert( msg );
54
  }
55
 
56
  // Get only files that haven't been added to the list
57
  // Also prevent duplication when send ajax request
58
+ selection = _.filter( selection, function ( attachment )
59
  {
60
+ return $imageList.children( 'li#item_' + attachment.id ).length === 0;
61
  } );
62
  ids = _.pluck( selection, 'id' );
63
 
64
+ if ( ids.length > 0 )
65
  {
66
  var data = {
67
+ action : 'rwmb_attach_media',
68
+ post_id : $( '#post_ID' ).val(),
69
+ field_id : $imageList.data( 'field_id' ),
70
+ attachment_ids: ids,
71
+ _ajax_nonce : $uploadButton.data( 'attach_media_nonce' )
72
  };
73
 
74
+ $.post( ajaxurl, data, function ( r )
75
  {
76
+ if ( r.success )
77
  {
78
  $imageList
79
  .append( _.template( template, { attachments: selection }, {
80
+ evaluate : /<#([\s\S]+?)#>/g,
81
  interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
82
+ escape : /\{\{([^\}]+?)\}\}(?!\})/g
83
  } ) )
84
+ .trigger( 'update.rwmbFile' );
85
  }
86
  }, 'json' );
87
  }
88
  } );
89
+ } );
90
  } );
js/image-select.js CHANGED
@@ -1,6 +1,8 @@
1
- jQuery( function( $ )
2
  {
3
- $( 'body' ).on( 'change', '.rwmb-image-select input', function()
 
 
4
  {
5
  var $this = $( this ),
6
  type = $this.attr( 'type' ),
@@ -10,7 +12,10 @@ jQuery( function( $ )
10
  if ( selected )
11
  {
12
  $parent.addClass( 'rwmb-active' );
13
- type == 'radio' && $others.removeClass( 'rwmb-active' );
 
 
 
14
  }
15
  else
16
  {
@@ -18,4 +23,4 @@ jQuery( function( $ )
18
  }
19
  } );
20
  $( '.rwmb-image-select input' ).trigger( 'change' );
21
- } );
1
+ jQuery( function ( $ )
2
  {
3
+ 'use strict';
4
+
5
+ $( 'body' ).on( 'change', '.rwmb-image-select input', function ()
6
  {
7
  var $this = $( this ),
8
  type = $this.attr( 'type' ),
12
  if ( selected )
13
  {
14
  $parent.addClass( 'rwmb-active' );
15
+ if ( type === 'radio' )
16
+ {
17
+ $others.removeClass( 'rwmb-active' );
18
+ }
19
  }
20
  else
21
  {
23
  }
24
  } );
25
  $( '.rwmb-image-select input' ).trigger( 'change' );
26
+ } );
js/image.js CHANGED
@@ -1,23 +1,25 @@
1
- jQuery( function( $ )
2
  {
 
 
3
  // Reorder images
4
- $( '.rwmb-images' ).each( function()
5
  {
6
  var $this = $( this ),
7
  data = {
8
- action : 'rwmb_reorder_images',
9
- _ajax_nonce : $this.data( 'reorder_nonce' ),
10
- post_id : $( '#post_ID' ).val(),
11
- field_id : $this.data( 'field_id' )
12
  };
13
  $this.sortable( {
14
  placeholder: 'ui-state-highlight',
15
  items : 'li',
16
- update : function()
17
  {
18
  data.order = $this.sortable( 'serialize' );
19
  $.post( ajaxurl, data );
20
  }
21
  } );
22
  } );
23
- } );
1
+ jQuery( function ( $ )
2
  {
3
+ 'use strict';
4
+
5
  // Reorder images
6
+ $( '.rwmb-images' ).each( function ()
7
  {
8
  var $this = $( this ),
9
  data = {
10
+ action : 'rwmb_reorder_images',
11
+ _ajax_nonce: $this.data( 'reorder_nonce' ),
12
+ post_id : $( '#post_ID' ).val(),
13
+ field_id : $this.data( 'field_id' )
14
  };
15
  $this.sortable( {
16
  placeholder: 'ui-state-highlight',
17
  items : 'li',
18
+ update : function ()
19
  {
20
  data.order = $this.sortable( 'serialize' );
21
  $.post( ajaxurl, data );
22
  }
23
  } );
24
  } );
25
+ } );
js/jquery.validate.min.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-af.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ar-DZ.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ar.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-az.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-be.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-bg.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-bs.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ca.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-cs.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-cy-GB.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-da.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-de.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-el.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-AU.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-GB.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-en-NZ.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-eo.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-es.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-et.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-eu.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fa.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fi.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fo.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr-CA.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr-CH.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-fr.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-gl.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-he.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hi.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hr.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hu.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-hy.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-id.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-is.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-it.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ja.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ka.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-kk.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-km.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ko.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ky.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lb.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lt.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-lv.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-mk.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ml.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ms.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nb.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nl-BE.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nl.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-nn.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-no.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pl.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pt-BR.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-pt.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-rm.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ro.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ru.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sk.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sl.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sq.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sr-SR.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sr.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-sv.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-ta.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-th.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-tj.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-tr.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-uk.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-vi.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-CN.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-HK.js CHANGED
File without changes
js/jqueryui/datepicker-i18n/jquery.ui.datepicker-zh-TW.js CHANGED
File without changes
js/jqueryui/jquery-ui-timepicker-addon.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-af.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-bg.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ca.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-cs.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-de.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-el.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-es.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-et.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-eu.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-fi.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-fr.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-gl.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-he.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-hu.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-id.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-it.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ja.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ko.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-lt.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-nl.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-no.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pl.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pt-BR.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-pt.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ro.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-ru.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-sk.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-sv.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-th.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-tr.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-uk.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-vi.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-zh-CN.js CHANGED
File without changes
js/jqueryui/timepicker-i18n/jquery-ui-timepicker-zh-TW.js CHANGED
File without changes
js/map.js CHANGED
@@ -3,13 +3,13 @@
3
  'use strict';
4
 
5
  // Use function construction to store map & DOM elements separately for each instance
6
- var mapField = function ( $container )
7
  {
8
  this.$container = $container;
9
  };
10
 
11
  // Use prototype for better performance
12
- mapField.prototype = {
13
  // Initialize everything
14
  init : function ()
15
  {
@@ -45,7 +45,7 @@
45
  streetViewControl: 0,
46
  mapTypeId : google.maps.MapTypeId.ROADMAP
47
  } );
48
- this.marker = new google.maps.Marker( {position: latLng, map: this.map, draggable: true} );
49
  this.geocoder = new google.maps.Geocoder();
50
  },
51
 
@@ -100,7 +100,9 @@
100
 
101
  // No address field or more than 1 address fields, ignore
102
  if ( !this.addressField || this.addressField.split( ',' ).length > 1 )
 
103
  return;
 
104
 
105
  $( '#' + this.addressField ).autocomplete( {
106
  source: function ( request, response )
@@ -153,11 +155,11 @@
153
  addressList[loop] = jQuery( '#' + fieldList[loop] ).val();
154
  }
155
 
156
- address = addressList.join( "," ).replace( /\n/g, ',' ).replace( /,,/g, ',' );
157
 
158
  if ( address )
159
  {
160
- this.geocoder.geocode( {'address': address}, function ( results, status )
161
  {
162
  if ( status === google.maps.GeocoderStatus.OK )
163
  {
@@ -174,17 +176,17 @@
174
  {
175
  $( '.rwmb-map-field' ).each( function ()
176
  {
177
- var field = new mapField( $( this ) );
178
  field.init();
179
 
180
  $( this ).data( 'mapController', field );
181
  } );
182
 
183
- $( '.rwmb-input' ).on( 'clone', function ( params )
184
  {
185
  $( '.rwmb-map-field' ).each( function ()
186
  {
187
- var field = new mapField( $( this ) );
188
  field.init();
189
 
190
  $( this ).data( 'mapController', field );
3
  'use strict';
4
 
5
  // Use function construction to store map & DOM elements separately for each instance
6
+ var MapField = function ( $container )
7
  {
8
  this.$container = $container;
9
  };
10
 
11
  // Use prototype for better performance
12
+ MapField.prototype = {
13
  // Initialize everything
14
  init : function ()
15
  {
45
  streetViewControl: 0,
46
  mapTypeId : google.maps.MapTypeId.ROADMAP
47
  } );
48
+ this.marker = new google.maps.Marker( { position: latLng, map: this.map, draggable: true } );
49
  this.geocoder = new google.maps.Geocoder();
50
  },
51
 
100
 
101
  // No address field or more than 1 address fields, ignore
102
  if ( !this.addressField || this.addressField.split( ',' ).length > 1 )
103
+ {
104
  return;
105
+ }
106
 
107
  $( '#' + this.addressField ).autocomplete( {
108
  source: function ( request, response )
155
  addressList[loop] = jQuery( '#' + fieldList[loop] ).val();
156
  }
157
 
158
+ address = addressList.join( ',' ).replace( /\n/g, ',' ).replace( /,,/g, ',' );
159
 
160
  if ( address )
161
  {
162
+ this.geocoder.geocode( { 'address': address }, function ( results, status )
163
  {
164
  if ( status === google.maps.GeocoderStatus.OK )
165
  {
176
  {
177
  $( '.rwmb-map-field' ).each( function ()
178
  {
179
+ var field = new MapField( $( this ) );
180
  field.init();
181
 
182
  $( this ).data( 'mapController', field );
183
  } );
184
 
185
+ $( '.rwmb-input' ).on( 'clone', function ()
186
  {
187
  $( '.rwmb-map-field' ).each( function ()
188
  {
189
+ var field = new MapField( $( this ) );
190
  field.init();
191
 
192
  $( this ).data( 'mapController', field );
js/oembed.js CHANGED
@@ -1,5 +1,7 @@
1
  jQuery( function( $ )
2
  {
 
 
3
  $( '.rwmb-oembed-wrapper .spinner' ).hide();
4
 
5
  $( 'body' ).on( 'click', '.rwmb-oembed-wrapper .show-embed', function() {
1
  jQuery( function( $ )
2
  {
3
+ 'use strict';
4
+
5
  $( '.rwmb-oembed-wrapper .spinner' ).hide();
6
 
7
  $( 'body' ).on( 'click', '.rwmb-oembed-wrapper .show-embed', function() {
js/plupload-image.js CHANGED
@@ -1,16 +1,18 @@
1
- jQuery( function( $ )
2
  {
 
 
3
  // Hide "Uploaded files" title if there are no files uploaded after deleting files
4
- $( '.rwmb-images' ).on( 'click', '.rwmb-delete-file', function()
5
  {
6
  // Check if we need to show drop target
7
  var $dragndrop = $( this ).parents( '.rwmb-images' ).siblings( '.rwmb-drag-drop' );
8
 
9
  // After delete files, show the Drag & Drop section
10
- $dragndrop.removeClass('hidden');
11
  } );
12
 
13
- $( '.rwmb-drag-drop' ).each(function()
14
  {
15
  // Declare vars
16
  var $dropArea = $( this ),
@@ -21,8 +23,8 @@ jQuery( function( $ )
21
  // Extend uploaderData
22
  uploaderData.multipart_params = $.extend(
23
  {
24
- _ajax_nonce : $dropArea.data( 'upload_nonce' ),
25
- post_id : $( '#post_ID' ).val()
26
  },
27
  uploaderData.multipart_params
28
  );
@@ -32,7 +34,7 @@ jQuery( function( $ )
32
  uploader.init();
33
 
34
  // Add files
35
- uploader.bind( 'FilesAdded', function( up, files )
36
  {
37
  var maxFileUploads = $imageList.data( 'max_file_uploads' ),
38
  uploaded = $imageList.children().length,
@@ -41,7 +43,7 @@ jQuery( function( $ )
41
  msg = msg.replace( '%d', maxFileUploads );
42
 
43
  // Remove files from queue if exceed max file uploads
44
- if ( maxFileUploads > 0 && ( uploaded + files.length ) > maxFileUploads )
45
  {
46
  if ( uploaded < maxFileUploads )
47
  {
@@ -54,36 +56,47 @@ jQuery( function( $ )
54
 
55
  // Hide drag & drop section if reach max file uploads
56
  if ( maxFileUploads > 0 && uploaded + files.length >= maxFileUploads )
 
57
  $dropArea.addClass( 'hidden' );
 
58
 
59
- max = parseInt( up.settings.max_file_size, 10 );
60
 
61
  // Upload files
62
- plupload.each( files, function( file )
63
  {
64
  addLoading( up, file, $imageList );
65
  addThrobber( file );
66
  if ( file.size >= max )
 
67
  removeError( file );
 
68
  } );
69
  up.refresh();
70
  up.start();
71
 
72
  } );
73
 
74
- uploader.bind( 'Error', function( up, e )
75
  {
76
  addLoading( up, e.file, $imageList );
77
  removeError( e.file );
78
  up.removeFile( e.file );
79
  } );
80
 
81
- uploader.bind( 'FileUploaded', function( up, file, r )
82
  {
83
  r = $.parseJSON( r.response );
84
- r.success ? $( 'li#' + file.id ).replaceWith( r.data ) : removeError( file );
 
 
 
 
 
 
 
85
  } );
86
- });
87
 
88
  /**
89
  * Helper functions
@@ -99,7 +112,7 @@ jQuery( function( $ )
99
  $( 'li#' + file.id )
100
  .addClass( 'rwmb-image-error' )
101
  .delay( 1600 )
102
- .fadeOut( 'slow', function()
103
  {
104
  $( this ).remove();
105
  }
@@ -113,7 +126,7 @@ jQuery( function( $ )
113
  */
114
  function addLoading( up, file, $ul )
115
  {
116
- $ul.removeClass('hidden').append( "<li id='" + file.id + "'><div class='rwmb-image-uploading-bar'></div><div id='" + file.id + "-throbber' class='rwmb-image-uploading-status'></div></li>" );
117
  }
118
 
119
  /**
@@ -123,6 +136,6 @@ jQuery( function( $ )
123
  */
124
  function addThrobber( file )
125
  {
126
- $( '#' + file.id + '-throbber' ).html( "<img class='rwmb-loader' height='64' width='64' src='" + RWMB.url + "img/loader.gif'/>" );
127
  }
128
  } );
1
+ jQuery( function ( $ )
2
  {
3
+ 'use strict';
4
+
5
  // Hide "Uploaded files" title if there are no files uploaded after deleting files
6
+ $( '.rwmb-images' ).on( 'click', '.rwmb-delete-file', function ()
7
  {
8
  // Check if we need to show drop target
9
  var $dragndrop = $( this ).parents( '.rwmb-images' ).siblings( '.rwmb-drag-drop' );
10
 
11
  // After delete files, show the Drag & Drop section
12
+ $dragndrop.removeClass( 'hidden' );
13
  } );
14
 
15
+ $( '.rwmb-drag-drop' ).each( function ()
16
  {
17
  // Declare vars
18
  var $dropArea = $( this ),
23
  // Extend uploaderData
24
  uploaderData.multipart_params = $.extend(
25
  {
26
+ _ajax_nonce: $dropArea.data( 'upload_nonce' ),
27
+ post_id : $( '#post_ID' ).val()
28
  },
29
  uploaderData.multipart_params
30
  );
34
  uploader.init();
35
 
36
  // Add files
37
+ uploader.bind( 'FilesAdded', function ( up, files )
38
  {
39
  var maxFileUploads = $imageList.data( 'max_file_uploads' ),
40
  uploaded = $imageList.children().length,
43
  msg = msg.replace( '%d', maxFileUploads );
44
 
45
  // Remove files from queue if exceed max file uploads
46
+ if ( maxFileUploads > 0 && ( uploaded + files.length ) > maxFileUploads )
47
  {
48
  if ( uploaded < maxFileUploads )
49
  {
56
 
57
  // Hide drag & drop section if reach max file uploads
58
  if ( maxFileUploads > 0 && uploaded + files.length >= maxFileUploads )
59
+ {
60
  $dropArea.addClass( 'hidden' );
61
+ }
62
 
63
+ var max = parseInt( up.settings.max_file_size, 10 );
64
 
65
  // Upload files
66
+ plupload.each( files, function ( file )
67
  {
68
  addLoading( up, file, $imageList );
69
  addThrobber( file );
70
  if ( file.size >= max )
71
+ {
72
  removeError( file );
73
+ }
74
  } );
75
  up.refresh();
76
  up.start();
77
 
78
  } );
79
 
80
+ uploader.bind( 'Error', function ( up, e )
81
  {
82
  addLoading( up, e.file, $imageList );
83
  removeError( e.file );
84
  up.removeFile( e.file );
85
  } );
86
 
87
+ uploader.bind( 'FileUploaded', function ( up, file, r )
88
  {
89
  r = $.parseJSON( r.response );
90
+ if ( r.success )
91
+ {
92
+ $( 'li#' + file.id ).replaceWith( r.data );
93
+ }
94
+ else
95
+ {
96
+ removeError( file );
97
+ }
98
  } );
99
+ } );
100
 
101
  /**
102
  * Helper functions
112
  $( 'li#' + file.id )
113
  .addClass( 'rwmb-image-error' )
114
  .delay( 1600 )
115
+ .fadeOut( 'slow', function ()
116
  {
117
  $( this ).remove();
118
  }
126
  */
127
  function addLoading( up, file, $ul )
128
  {
129
+ $ul.removeClass( 'hidden' ).append( '<li id="' + file.id + '"><div class="rwmb-image-uploading-bar"></div><div id="' + file.id + '-throbber" class="rwmb-image-uploading-status"></div></li>' );
130
  }
131
 
132
  /**
136
  */
137
  function addThrobber( file )
138
  {
139
+ $( '#' + file.id + '-throbber' ).html( '<img class="rwmb-loader" height="64" width="64" src="' + RWMB.url + '"img/loader.gif">' );
140
  }
141
  } );
js/select-advanced.js CHANGED
@@ -1,17 +1,15 @@
1
- /**
2
- * Update select2
3
- * Used for static & dynamic added elements (when clone)
4
- */
5
- jQuery( document ).ready( function ( $ )
6
- {
7
- $( ':input.rwmb-select-advanced' ).each( rwmb_update_select_advanced );
8
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-select-advanced', rwmb_update_select_advanced );
9
-
10
  function rwmb_update_select_advanced()
11
  {
12
  var $this = $( this ),
13
  options = $this.data( 'options' );
14
- $this.siblings('.select2-container').remove();
15
- $this.select2( options );
16
  }
17
- } );
 
 
 
1
+ jQuery( function ( $ )
2
+ {
3
+ 'use strict';
4
+
 
 
 
 
 
5
  function rwmb_update_select_advanced()
6
  {
7
  var $this = $( this ),
8
  options = $this.data( 'options' );
9
+ $this.siblings( '.select2-container' ).remove();
10
+ $this.select2( options );
11
  }
12
+
13
+ $( ':input.rwmb-select-advanced' ).each( rwmb_update_select_advanced );
14
+ $( '.rwmb-input' ).on( 'clone', ':input.rwmb-select-advanced', rwmb_update_select_advanced );
15
+ } );
js/select2/select2.min.js CHANGED
File without changes
js/slider.js CHANGED
@@ -1,7 +1,6 @@
1
  jQuery( function( $ )
2
  {
3
- $( ':input.rwmb-slider-value' ).each( rwmb_update_slider );
4
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-slider-value', rwmb_update_slider );
5
 
6
  function rwmb_update_slider()
7
  {
@@ -34,4 +33,7 @@ jQuery( function( $ )
34
 
35
  $slider.slider( options );
36
  }
 
 
 
37
  } );
1
  jQuery( function( $ )
2
  {
3
+ 'use strict';
 
4
 
5
  function rwmb_update_slider()
6
  {
33
 
34
  $slider.slider( options );
35
  }
36
+
37
+ $( ':input.rwmb-slider-value' ).each( rwmb_update_slider );
38
+ $( '.rwmb-input' ).on( 'clone', ':input.rwmb-slider-value', rwmb_update_slider );
39
  } );
js/taxonomy.js CHANGED
@@ -1,5 +1,7 @@
1
- jQuery( document ).ready( function( $ )
2
  {
 
 
3
  $( '.rw-taxonomy-tree input:checkbox' ).change( function()
4
  {
5
  var $this = $( this ),
1
+ jQuery( function( $ )
2
  {
3
+ 'use strict';
4
+
5
  $( '.rw-taxonomy-tree input:checkbox' ).change( function()
6
  {
7
  var $this = $( this ),
js/thickbox-image.js CHANGED
@@ -1,6 +1,8 @@
1
- jQuery( function( $ )
2
  {
3
- $( 'body' ).on( 'click', '.rwmb-thickbox-upload', function()
 
 
4
  {
5
  var $this = $( this ),
6
  $holder = $this.siblings( '.rwmb-images' ),
@@ -8,7 +10,7 @@ jQuery( function( $ )
8
  field_id = $this.data( 'field_id' ),
9
  backup = window.send_to_editor;
10
 
11
- window.send_to_editor = function( html )
12
  {
13
  var $img = $( '<div />' ).append( html ).find( 'img' ),
14
  url = $img.attr( 'src' ),
@@ -27,7 +29,7 @@ jQuery( function( $ )
27
 
28
  tb_remove();
29
  window.send_to_editor = backup;
30
- }
31
  tb_show( '', 'media-upload.php?post_id=' + post_id + '&TB_iframe=true' );
32
 
33
  return false;
1
+ jQuery( function ( $ )
2
  {
3
+ 'use strict';
4
+
5
+ $( 'body' ).on( 'click', '.rwmb-thickbox-upload', function ()
6
  {
7
  var $this = $( this ),
8
  $holder = $this.siblings( '.rwmb-images' ),
10
  field_id = $this.data( 'field_id' ),
11
  backup = window.send_to_editor;
12
 
13
+ window.send_to_editor = function ( html )
14
  {
15
  var $img = $( '<div />' ).append( html ).find( 'img' ),
16
  url = $img.attr( 'src' ),
29
 
30
  tb_remove();
31
  window.send_to_editor = backup;
32
+ };
33
  tb_show( '', 'media-upload.php?post_id=' + post_id + '&TB_iframe=true' );
34
 
35
  return false;
js/time.js CHANGED
@@ -1,19 +1,20 @@
1
- /**
2
- * Update datetime picker element
3
- * Used for static & dynamic added elements (when clone)
4
- */
5
- jQuery( document ).ready( function( $ )
6
  {
7
- $( ':input.rwmb-time' ).each( rwmb_update_time_picker );
8
- $( '.rwmb-input' ).on( 'clone', ':input.rwmb-time', rwmb_update_time_picker );
9
-
 
 
 
10
  function rwmb_update_time_picker()
11
  {
12
  var $this = $( this ),
13
  options = $this.data( 'options' );
14
-
15
  $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
16
  $this.removeClass( 'hasDatepicker' ).attr( 'id', '' ).timepicker( options );
17
-
18
  }
 
 
 
19
  } );
1
+ jQuery( function ( $ )
 
 
 
 
2
  {
3
+ 'use strict';
4
+
5
+ /**
6
+ * Update datetime picker element
7
+ * Used for static & dynamic added elements (when clone)
8
+ */
9
  function rwmb_update_time_picker()
10
  {
11
  var $this = $( this ),
12
  options = $this.data( 'options' );
13
+
14
  $this.siblings( '.ui-datepicker-append' ).remove(); // Remove appended text
15
  $this.removeClass( 'hasDatepicker' ).attr( 'id', '' ).timepicker( options );
 
16
  }
17
+
18
+ $( ':input.rwmb-time' ).each( rwmb_update_time_picker );
19
+ $( '.rwmb-input' ).on( 'clone', ':input.rwmb-time', rwmb_update_time_picker );
20
  } );
js/validate.js CHANGED
@@ -1,15 +1,19 @@
1
- jQuery( document ).ready( function( $ )
2
  {
 
 
3
  var $form = $( '#post' );
4
 
5
  // Required field styling
6
- $.each( rwmb.validationOptions.rules, function( k, v )
7
  {
8
  if ( v['required'] )
 
9
  $( '#' + k ).parent().siblings( '.rwmb-label' ).addClass( 'required' ).append( '<span>*</span>' );
 
10
  } );
11
 
12
- rwmb.validationOptions.invalidHandler = function( form, validator )
13
  {
14
  // Re-enable the submit ( publish/update ) button and hide the ajax indicator
15
  $( '#publish' ).removeClass( 'button-primary-disabled' );
@@ -19,4 +23,4 @@ jQuery( document ).ready( function( $ )
19
  };
20
 
21
  $form.validate( rwmb.validationOptions );
22
- } );
1
+ jQuery( function ( $ )
2
  {
3
+ 'use strict';
4
+
5
  var $form = $( '#post' );
6
 
7
  // Required field styling
8
+ $.each( rwmb.validationOptions.rules, function ( k, v )
9
  {
10
  if ( v['required'] )
11
+ {
12
  $( '#' + k ).parent().siblings( '.rwmb-label' ).addClass( 'required' ).append( '<span>*</span>' );
13
+ }
14
  } );
15
 
16
+ rwmb.validationOptions.invalidHandler = function ()
17
  {
18
  // Re-enable the submit ( publish/update ) button and hide the ajax indicator
19
  $( '#publish' ).removeClass( 'button-primary-disabled' );
23
  };
24
 
25
  $form.validate( rwmb.validationOptions );
26
+ } );
lang/ar.mo CHANGED
File without changes
lang/ar.po CHANGED
File without changes
lang/de_DE.mo CHANGED
File without changes
lang/de_DE.po CHANGED
File without changes
lang/default.mo DELETED
Binary file
lang/default.po DELETED
@@ -1,384 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Meta Box Script For WordPress\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2013-06-03 22:19+0700\n"
6
- "PO-Revision-Date: 2013-06-03 22:19+0700\n"
7
- "Last-Translator: Rilwis <rilwis@gmail.com>\n"
8
- "Language-Team: Rilwis <rilwis@gmail.com>\n"
9
- "Language: en_EN\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: __;_e;_x:2c,1;_n:1,2;_n_noop:1,2;_nx:1,2;"
14
- "_nx_noop:1,2\n"
15
- "X-Poedit-Basepath: .\n"
16
- "X-Poedit-SourceCharset: UTF-8\n"
17
- "X-Generator: Poedit 1.5.5\n"
18
- "X-Poedit-SearchPath-0: ..\n"
19
- "X-Poedit-SearchPath-1: ../inc/fields\n"
20
-
21
- #: ../demo/all-custom-post-types.php:20
22
- msgid "Personal Information"
23
- msgstr ""
24
-
25
- #: ../demo/all-custom-post-types.php:25
26
- msgid "Full name"
27
- msgstr ""
28
-
29
- #: ../demo/better-include.php:16 ../demo/include-by-ID-or-page-template.php:8
30
- msgid "Meta Box Title"
31
- msgstr ""
32
-
33
- #: ../demo/better-include.php:19 ../demo/include-by-ID-or-page-template.php:14
34
- msgid "Your images"
35
- msgstr ""
36
-
37
- #: ../demo/date-time-js-options.php:11
38
- msgid "Date Time Picker With JS Options"
39
- msgstr ""
40
-
41
- #: ../demo/date-time-js-options.php:15
42
- msgid "Date"
43
- msgstr ""
44
-
45
- #: ../demo/date-time-js-options.php:21 ../demo/demo.php:177
46
- msgid "(yyyy-mm-dd)"
47
- msgstr ""
48
-
49
- #: ../demo/date-time-js-options.php:23
50
- msgid "Select Date"
51
- msgstr ""
52
-
53
- #: ../demo/date-time-js-options.php:24 ../demo/demo.php:178
54
- msgid "yy-mm-dd"
55
- msgstr ""
56
-
57
- #: ../demo/date-time-js-options.php:30
58
- msgid "Datetime"
59
- msgstr ""
60
-
61
- #: ../demo/date-time-js-options.php:41
62
- msgid "Time"
63
- msgstr ""
64
-
65
- #: ../demo/demo.php:34
66
- msgid "Standard Fields"
67
- msgstr ""
68
-
69
- #: ../demo/demo.php:53
70
- msgid "Text"
71
- msgstr ""
72
-
73
- #: ../demo/demo.php:57
74
- msgid "Text description"
75
- msgstr ""
76
-
77
- #: ../demo/demo.php:60
78
- msgid "Default text value"
79
- msgstr ""
80
-
81
- #: ../demo/demo.php:66
82
- msgid "Checkbox"
83
- msgstr ""
84
-
85
- #: ../demo/demo.php:74
86
- msgid "Radio"
87
- msgstr ""
88
-
89
- #: ../demo/demo.php:80 ../demo/demo.php:91 ../demo/demo.php:226
90
- msgid "Label1"
91
- msgstr ""
92
-
93
- #: ../demo/demo.php:81 ../demo/demo.php:92 ../demo/demo.php:227
94
- msgid "Label2"
95
- msgstr ""
96
-
97
- #: ../demo/demo.php:86
98
- msgid "Select"
99
- msgstr ""
100
-
101
- #: ../demo/demo.php:96
102
- msgid "Select an Item"
103
- msgstr ""
104
-
105
- #: ../demo/demo.php:103
106
- msgid "Hidden value"
107
- msgstr ""
108
-
109
- #: ../demo/demo.php:107
110
- msgid "Password"
111
- msgstr ""
112
-
113
- #: ../demo/demo.php:113
114
- msgid "Textarea"
115
- msgstr ""
116
-
117
- #: ../demo/demo.php:114
118
- msgid "Textarea description"
119
- msgstr ""
120
-
121
- #: ../demo/demo.php:131
122
- msgid "Password is required"
123
- msgstr ""
124
-
125
- #: ../demo/demo.php:132
126
- msgid "Password must be at least 7 characters"
127
- msgstr ""
128
-
129
- #: ../demo/demo.php:140
130
- msgid "Advanced Fields"
131
- msgstr ""
132
-
133
- #: ../demo/demo.php:145
134
- msgid "Slider"
135
- msgstr ""
136
-
137
- #: ../demo/demo.php:150
138
- msgid "$"
139
- msgstr ""
140
-
141
- #: ../demo/demo.php:151
142
- msgid " USD"
143
- msgstr ""
144
-
145
- #: ../demo/demo.php:162
146
- msgid "Number"
147
- msgstr ""
148
-
149
- #: ../demo/demo.php:171
150
- msgid "Date picker"
151
- msgstr ""
152
-
153
- #: ../demo/demo.php:186
154
- msgid "Datetime picker"
155
- msgstr ""
156
-
157
- #: ../demo/demo.php:200
158
- msgid "Time picker"
159
- msgstr ""
160
-
161
- #: ../demo/demo.php:215
162
- msgid "Color picker"
163
- msgstr ""
164
-
165
- #: ../demo/demo.php:221
166
- msgid "Checkbox list"
167
- msgstr ""
168
-
169
- #: ../demo/demo.php:232
170
- msgid "Email"
171
- msgstr ""
172
-
173
- #: ../demo/demo.php:234
174
- msgid "Email description"
175
- msgstr ""
176
-
177
- #: ../demo/demo.php:240
178
- msgid "Range"
179
- msgstr ""
180
-
181
- #: ../demo/demo.php:242
182
- msgid "Range description"
183
- msgstr ""
184
-
185
- #: ../demo/demo.php:251
186
- msgid "URL"
187
- msgstr ""
188
-
189
- #: ../demo/demo.php:253
190
- msgid "URL description"
191
- msgstr ""
192
-
193
- #: ../demo/demo.php:259
194
- msgid "oEmbed"
195
- msgstr ""
196
-
197
- #: ../demo/demo.php:261
198
- msgid "oEmbed description"
199
- msgstr ""
200
-
201
- #: ../demo/demo.php:266
202
- msgid "Taxonomy"
203
- msgstr ""
204
-
205
- #: ../demo/demo.php:280
206
- msgid "Posts (Pages)"
207
- msgstr ""
208
-
209
- #: ../demo/demo.php:296
210
- msgid "WYSIWYG / Rich Text Editor"
211
- msgstr ""
212
-
213
- #: ../demo/demo.php:301
214
- msgid "WYSIWYG default value"
215
- msgstr ""
216
-
217
- #: ../demo/demo.php:312 ../demo/force-delete.php:15
218
- msgid "File Upload"
219
- msgstr ""
220
-
221
- #: ../demo/demo.php:318
222
- msgid "File Advanced Upload"
223
- msgstr ""
224
-
225
- #: ../demo/demo.php:326 ../demo/force-delete.php:22
226
- msgid "Image Upload"
227
- msgstr ""
228
-
229
- #: ../demo/demo.php:332 ../demo/force-delete.php:28
230
- msgid "Thickbox Image Upload"
231
- msgstr ""
232
-
233
- #: ../demo/demo.php:338 ../demo/force-delete.php:35
234
- msgid "Plupload Image Upload"
235
- msgstr ""
236
-
237
- #: ../demo/demo.php:345
238
- msgid "Image Advanced Upload"
239
- msgstr ""
240
-
241
- #: ../demo/force-delete.php:11
242
- msgid "Test Meta Box"
243
- msgstr ""
244
-
245
- #: ../demo/map.php:9
246
- msgid "Google Map"
247
- msgstr ""
248
-
249
- #: ../demo/map.php:13
250
- msgid "Address"
251
- msgstr ""
252
-
253
- #: ../demo/map.php:15
254
- msgid "Hanoi, Vietnam"
255
- msgstr ""
256
-
257
- #: ../demo/map.php:19
258
- msgid "Location"
259
- msgstr ""
260
-
261
- #: ../inc/classes/meta-box.php:220
262
- msgid "Please correct the errors highlighted below and try again."
263
- msgstr ""
264
-
265
- #: ../inc/classes/meta-box.php:394
266
- msgid "+"
267
- msgstr ""
268
-
269
- #: ../inc/classes/meta-box.php:416
270
- msgid "&#8211;"
271
- msgstr ""
272
-
273
- #: ../inc/fields/file-advanced.php:23
274
- #, php-format
275
- msgid "You may only upload maximum %d file"
276
- msgstr ""
277
-
278
- #: ../inc/fields/file-advanced.php:24
279
- #, php-format
280
- msgid "You may only upload maximum %d files"
281
- msgstr ""
282
-
283
- #: ../inc/fields/file-advanced.php:25
284
- msgid "Select Files"
285
- msgstr ""
286
-
287
- #: ../inc/fields/file-advanced.php:68
288
- msgctxt "file upload"
289
- msgid "Select or Upload Files"
290
- msgstr ""
291
-
292
- #: ../inc/fields/file-advanced.php:104 ../inc/fields/file.php:133
293
- msgctxt "file upload"
294
- msgid "Delete"
295
- msgstr ""
296
-
297
- #: ../inc/fields/file-advanced.php:105 ../inc/fields/file.php:134
298
- msgctxt "file upload"
299
- msgid "Edit"
300
- msgstr ""
301
-
302
- #: ../inc/fields/file.php:66
303
- msgid "Error: Cannot delete file"
304
- msgstr ""
305
-
306
- #: ../inc/fields/file.php:80
307
- msgctxt "file upload"
308
- msgid "Upload Files"
309
- msgstr ""
310
-
311
- #: ../inc/fields/file.php:81
312
- msgctxt "file upload"
313
- msgid "+ Add new file"
314
- msgstr ""
315
-
316
- #: ../inc/fields/image-advanced.php:22
317
- msgid "Select Images"
318
- msgstr ""
319
-
320
- #: ../inc/fields/image-advanced.php:71
321
- msgctxt "image upload"
322
- msgid "Select or Upload Images"
323
- msgstr ""
324
-
325
- #: ../inc/fields/image-advanced.php:107 ../inc/fields/image.php:144
326
- msgctxt "image upload"
327
- msgid "Delete"
328
- msgstr ""
329
-
330
- #: ../inc/fields/image-advanced.php:108 ../inc/fields/image.php:145
331
- msgctxt "image upload"
332
- msgid "Edit"
333
- msgstr ""
334
-
335
- #: ../inc/fields/image.php:64
336
- msgid "Order saved"
337
- msgstr ""
338
-
339
- #: ../inc/fields/image.php:78 ../inc/fields/thickbox-image.php:35
340
- msgctxt "image upload"
341
- msgid "Upload Images"
342
- msgstr ""
343
-
344
- #: ../inc/fields/image.php:79
345
- msgctxt "image upload"
346
- msgid "+ Add new image"
347
- msgstr ""
348
-
349
- #: ../inc/fields/map.php:48
350
- msgid "Find Address"
351
- msgstr ""
352
-
353
- #: ../inc/fields/plupload-image.php:104
354
- msgctxt "image upload"
355
- msgid "Drop images here"
356
- msgstr ""
357
-
358
- #: ../inc/fields/plupload-image.php:105
359
- msgctxt "image upload"
360
- msgid "or"
361
- msgstr ""
362
-
363
- #: ../inc/fields/plupload-image.php:106
364
- msgctxt "image upload"
365
- msgid "Select Files"
366
- msgstr ""
367
-
368
- #: ../inc/fields/plupload-image.php:181
369
- msgctxt "image upload"
370
- msgid "Allowed Image Files"
371
- msgstr ""
372
-
373
- #: ../inc/fields/post.php:54
374
- msgid "Post"
375
- msgstr ""
376
-
377
- #: ../inc/fields/post.php:68 ../inc/fields/taxonomy.php:40
378
- #, php-format
379
- msgid "Select a %s"
380
- msgstr ""
381
-
382
- #: ../inc/fields/select-advanced.php:71
383
- msgid "Select a value"
384
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lang/default.pot ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # <!=Copyright (C) 2014 Rilwis
2
+ # This file is distributed under the GPL2+.=!>
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Meta Box 4.3.10\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/meta-box\n"
7
+ "POT-Creation-Date: 2014-09-13 10:50:22+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+
15
+ #: inc/field.php:225
16
+ msgid "+"
17
+ msgstr ""
18
+
19
+ #: inc/field.php:235
20
+ msgid "&#8211;"
21
+ msgstr ""
22
+
23
+ #: inc/fields/button.php:35
24
+ msgid "Click me"
25
+ msgstr ""
26
+
27
+ #: inc/fields/file-advanced.php:23
28
+ msgid "Select Files"
29
+ msgstr ""
30
+
31
+ #: inc/fields/file-advanced.php:66
32
+ msgctxt "file upload"
33
+ msgid "Select or Upload Files"
34
+ msgstr ""
35
+
36
+ #: inc/fields/file-advanced.php:103 inc/fields/file.php:168
37
+ msgctxt "file upload"
38
+ msgid "Delete"
39
+ msgstr ""
40
+
41
+ #: inc/fields/file-advanced.php:104 inc/fields/file.php:169
42
+ msgctxt "file upload"
43
+ msgid "Edit"
44
+ msgstr ""
45
+
46
+ #: inc/fields/file-input.php:17
47
+ msgid "Select File"
48
+ msgstr ""
49
+
50
+ #: inc/fields/file-input.php:40
51
+ msgid "Select"
52
+ msgstr ""
53
+
54
+ #: inc/fields/file-input.php:42
55
+ msgid "Remove"
56
+ msgstr ""
57
+
58
+ #: inc/fields/file.php:19
59
+ msgid "You may only upload maximum %d file"
60
+ msgstr ""
61
+
62
+ #: inc/fields/file.php:20
63
+ msgid "You may only upload maximum %d files"
64
+ msgstr ""
65
+
66
+ #: inc/fields/file.php:98
67
+ msgid "Error: Cannot delete file"
68
+ msgstr ""
69
+
70
+ #: inc/fields/file.php:111
71
+ msgctxt "file upload"
72
+ msgid "Upload Files"
73
+ msgstr ""
74
+
75
+ #: inc/fields/file.php:112
76
+ msgctxt "file upload"
77
+ msgid "+ Add new file"
78
+ msgstr ""
79
+
80
+ #: inc/fields/image-advanced.php:23
81
+ msgid "Select Images"
82
+ msgstr ""
83
+
84
+ #: inc/fields/image-advanced.php:71
85
+ msgctxt "image upload"
86
+ msgid "Select or Upload Images"
87
+ msgstr ""
88
+
89
+ #: inc/fields/image-advanced.php:108 inc/fields/image.php:136
90
+ msgctxt "image upload"
91
+ msgid "Delete"
92
+ msgstr ""
93
+
94
+ #: inc/fields/image-advanced.php:109 inc/fields/image.php:137
95
+ msgctxt "image upload"
96
+ msgid "Edit"
97
+ msgstr ""
98
+
99
+ #: inc/fields/image.php:70 inc/fields/thickbox-image.php:34
100
+ msgctxt "image upload"
101
+ msgid "Upload Images"
102
+ msgstr ""
103
+
104
+ #: inc/fields/image.php:71
105
+ msgctxt "image upload"
106
+ msgid "+ Add new image"
107
+ msgstr ""
108
+
109
+ #: inc/fields/map.php:48
110
+ msgid "Find Address"
111
+ msgstr ""
112
+
113
+ #: inc/fields/oembed.php:55
114
+ msgid "Embed HTML not available."
115
+ msgstr ""
116
+
117
+ #: inc/fields/oembed.php:77
118
+ msgid "Preview"
119
+ msgstr ""
120
+
121
+ #: inc/fields/plupload-image.php:105
122
+ msgctxt "image upload"
123
+ msgid "Drop images here"
124
+ msgstr ""
125
+
126
+ #: inc/fields/plupload-image.php:106
127
+ msgctxt "image upload"
128
+ msgid "or"
129
+ msgstr ""
130
+
131
+ #: inc/fields/plupload-image.php:107
132
+ msgctxt "image upload"
133
+ msgid "Select Files"
134
+ msgstr ""
135
+
136
+ #: inc/fields/plupload-image.php:183
137
+ msgctxt "image upload"
138
+ msgid "Allowed Image Files"
139
+ msgstr ""
140
+
141
+ #: inc/fields/post.php:52
142
+ msgid "Post"
143
+ msgstr ""
144
+
145
+ #: inc/fields/post.php:66 inc/fields/taxonomy.php:40 inc/fields/user.php:62
146
+ msgid "Select a %s"
147
+ msgstr ""
148
+
149
+ #: inc/fields/user.php:54
150
+ msgid "User"
151
+ msgstr ""
152
+
153
+ #: inc/meta-box.php:245
154
+ msgid "Please correct the errors highlighted below and try again."
155
+ msgstr ""
156
+ #. Plugin Name of the plugin/theme
157
+ msgid "Meta Box"
158
+ msgstr ""
159
+
160
+ #. Plugin URI of the plugin/theme
161
+ msgid "http://www.deluxeblogtips.com/meta-box"
162
+ msgstr ""
163
+
164
+ #. Description of the plugin/theme
165
+ msgid "Create meta box for editing pages in WordPress. Compatible with custom post types since WP 3.0"
166
+ msgstr ""
167
+
168
+ #. Author of the plugin/theme
169
+ msgid "Rilwis"
170
+ msgstr ""
171
+
172
+ #. Author URI of the plugin/theme
173
+ msgid "http://www.deluxeblogtips.com"
174
+ msgstr ""
lang/es.mo CHANGED
File without changes
lang/es.po CHANGED
File without changes
lang/it_IT.mo CHANGED
File without changes
lang/it_IT.po CHANGED
File without changes
lang/nb_NO.mo CHANGED
File without changes
lang/nb_NO.po CHANGED
File without changes
lang/nl.mo CHANGED
File without changes
lang/nl.po CHANGED
File without changes
lang/pt_BR.mo CHANGED
File without changes
lang/pt_BR.po CHANGED
File without changes
lang/sv_SE.mo CHANGED
File without changes
lang/sv_SE.po CHANGED
File without changes
lang/tr_TR.mo CHANGED
File without changes
lang/tr_TR.po CHANGED
File without changes
lang/vi.mo CHANGED
File without changes
lang/vi.po CHANGED
File without changes
lang/zh_CN.mo CHANGED
File without changes
lang/zh_CN.po CHANGED
File without changes
meta-box.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Meta Box
4
  Plugin URI: http://www.deluxeblogtips.com/meta-box
5
  Description: Create meta box for editing pages in WordPress. Compatible with custom post types since WP 3.0
6
- Version: 4.3.10
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.3.9' );
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://www.deluxeblogtips.com/meta-box
5
  Description: Create meta box for editing pages in WordPress. Compatible with custom post types since WP 3.0
6
+ Version: 4.3.11
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.3.11' );
17
 
18
  // Define plugin URLs, for fast enqueuing scripts and styles
19
  if ( ! defined( 'RWMB_URL' ) )
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
5
  Requires at least: 3.5
6
  Tested up to: 4.0
7
- Stable tag: 4.3.10
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.
@@ -15,34 +15,10 @@ Meta Box plugin provides powerful API to implement custom meta boxes and custom
15
 
16
  ### Features
17
 
18
- * Easily registers multiple custom meta boxes for posts, pages or custom post types
 
19
  * Has built-in hooks which allow you to change the appearance and behavior of meta boxes
20
- * Easily integrated with themes
21
-
22
- **You can also add more features to meta box via [premium extensions](http://metabox.io)**.
23
-
24
- ### Supported fields
25
-
26
- - button
27
- - checkbox, checkbox_list
28
- - color
29
- - date, time, datetime
30
- - divider
31
- - file, file_advanced, file_input (allow to upload or paste file URL)
32
- - heading
33
- - hidden
34
- - image, thickbox_image, plupload_image, image_advanced, image_select (or radio image)
35
- - map
36
- - password
37
- - post
38
- - radio
39
- - select, select_advanced (uses [select2](http://ivaynberg.github.com/select2/))
40
- - slider, range
41
- - taxonomy
42
- - taxonomy_advanced
43
- - text, url, email, number, oembed
44
- - textarea
45
- - wysiwyg
46
 
47
  ### Premium Extensions
48
 
@@ -56,7 +32,7 @@ See all premium extensions [here](http://metabox.io).
56
 
57
  ### Plugin Links
58
 
59
- - [Project Page](http://metabox.io)
60
  - [Documentation](http://metabox.io/docs/)
61
  - [Report Bugs/Issues](https://github.com/rilwis/meta-box/issues)
62
  - [Premium Extensions](http://metabox.io)
@@ -76,6 +52,12 @@ To getting started with the plugin API, please read [this tutorial](http://metab
76
 
77
  == Changelog ==
78
 
 
 
 
 
 
 
79
  = 4.3.10 =
80
  * Bug fix: upload & reorder for image fields
81
  * Bug fix: not saving meta caused by page template issue
4
  Tags: meta-box, custom-fields, custom-field, meta, meta-boxes
5
  Requires at least: 3.5
6
  Tested up to: 4.0
7
+ Stable tag: 4.3.11
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.
15
 
16
  ### Features
17
 
18
+ * Easily register multiple custom meta boxes for posts, pages or custom post types
19
+ * Supports a lot of [field types](http://metabox.io/docs/define-fields/)
20
  * Has built-in hooks which allow you to change the appearance and behavior of meta boxes
21
+ * Easily integrate with themes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  ### Premium Extensions
24
 
32
 
33
  ### Plugin Links
34
 
35
+ - [Project Page](http://metabox.io/meta-box/)
36
  - [Documentation](http://metabox.io/docs/)
37
  - [Report Bugs/Issues](https://github.com/rilwis/meta-box/issues)
38
  - [Premium Extensions](http://metabox.io)
52
 
53
  == Changelog ==
54
 
55
+ = 4.3.11 =
56
+ * Bug fix: use field id instead of field_name for wysiwyg field
57
+ * Improvement: allow to sort files
58
+ * Improvement: use 'meta-box' text domain instead of 'rwmb'
59
+ * Improvement: coding standards
60
+
61
  = 4.3.10 =
62
  * Bug fix: upload & reorder for image fields
63
  * Bug fix: not saving meta caused by page template issue