Version Description
- Changes registering the ACF field type using the acf_register_field_type methode.
- Removes support for ACF version 4.
Download this release
Release Info
Developer | Jonua |
Plugin | Advanced Custom Fields: Table Field |
Version | 1.3.17 |
Comparing to | |
See all releases |
Code changes from version 1.3.16 to 1.3.17
- acf-table-v4.php +0 -482
- acf-table.php +24 -15
- changelog.txt +4 -0
- acf-table-v5.php → class-jh-acf-field-table.php +2 -5
- js/input-v4.js +1 -1
- js/input-v5.js +1 -1
- lang/acf-table-da_DK.po +2 -2
- lang/acf-table-de_DE.po +2 -2
- lang/acf-table-pl_PL.po +2 -2
- lang/acf-table.pot +2 -2
- readme.txt +5 -1
acf-table-v4.php
DELETED
@@ -1,482 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class acf_table_add_on extends acf_field
|
4 |
-
{
|
5 |
-
// vars
|
6 |
-
var $settings, // will hold info such as dir / path
|
7 |
-
$defaults; // will hold default field options
|
8 |
-
|
9 |
-
/*
|
10 |
-
* __construct
|
11 |
-
*
|
12 |
-
* Set name / label needed for actions / filters
|
13 |
-
*
|
14 |
-
* @since 3.6
|
15 |
-
* @date 23/01/13
|
16 |
-
*/
|
17 |
-
|
18 |
-
function __construct()
|
19 |
-
{
|
20 |
-
// language
|
21 |
-
load_textdomain( 'acf-table', dirname(__FILE__) . '/lang/acf-table-' . get_locale() . '.mo' );
|
22 |
-
|
23 |
-
$this->name = 'table';
|
24 |
-
$this->label = __( 'Table','acf-table' );
|
25 |
-
$this->category = __( 'Layout', 'acf' ); // Basic, Content, Choice, etc
|
26 |
-
$this->defaults = array(
|
27 |
-
'use_header' => 0,
|
28 |
-
'use_caption' => 2,
|
29 |
-
// add default here to merge into your field.
|
30 |
-
// This makes life easy when creating the field options as you don't need to use any if( isset('') ) logic. eg:
|
31 |
-
//'preview_size' => 'thumbnail'
|
32 |
-
);
|
33 |
-
|
34 |
-
// do not delete!
|
35 |
-
parent::__construct();
|
36 |
-
|
37 |
-
// settings
|
38 |
-
$this->settings = array(
|
39 |
-
'dir_url' => plugins_url( '', __FILE__ ) . '/',
|
40 |
-
'version' => '1.3.16',
|
41 |
-
);
|
42 |
-
|
43 |
-
// PREVENTS SAVING INVALID TABLE FIELD JSON DATA {
|
44 |
-
|
45 |
-
if (
|
46 |
-
! defined( 'ACF_TABLEFIELD_FILTER_POSTMETA' ) OR
|
47 |
-
constant( 'ACF_TABLEFIELD_FILTER_POSTMETA' ) === true
|
48 |
-
) {
|
49 |
-
|
50 |
-
add_filter( 'update_post_metadata', function( $x, $object_id, $meta_key, $meta_value, $prev_value ) {
|
51 |
-
|
52 |
-
// detecting ACF table json
|
53 |
-
if (
|
54 |
-
is_string( $meta_value ) and
|
55 |
-
strpos( $meta_value, '"acftf":{' ) !== false
|
56 |
-
) {
|
57 |
-
|
58 |
-
// is new value a valid json string
|
59 |
-
json_decode( $meta_value );
|
60 |
-
|
61 |
-
if ( json_last_error() !== JSON_ERROR_NONE ) {
|
62 |
-
|
63 |
-
// canceling meta value uptdate
|
64 |
-
error_log( 'The plugin advanced-custom-fields-table-field prevented a third party update_post_meta( ' . $object_id . ', "' . $meta_key . '", $value ); action that would save a broken JSON string.' . "\n" . 'For details see https://codex.wordpress.org/Function_Reference/update_post_meta#Character_Escaping.' );
|
65 |
-
return true;
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
return $x;
|
70 |
-
|
71 |
-
}, 10, 5 );
|
72 |
-
}
|
73 |
-
|
74 |
-
// }
|
75 |
-
|
76 |
-
}
|
77 |
-
|
78 |
-
/*
|
79 |
-
* create_field()
|
80 |
-
*
|
81 |
-
* Create the HTML interface for your field
|
82 |
-
*
|
83 |
-
* @param $field - an array holding all the field's data
|
84 |
-
*
|
85 |
-
* @type action
|
86 |
-
* @since 3.6
|
87 |
-
* @date 23/01/13
|
88 |
-
*/
|
89 |
-
|
90 |
-
function create_field( $field )
|
91 |
-
{
|
92 |
-
|
93 |
-
$data_field['use_header'] = $field['use_header'];
|
94 |
-
$data_field['use_caption'] = $field['use_caption'];
|
95 |
-
|
96 |
-
$e = '';
|
97 |
-
|
98 |
-
$e .= '<div class="acf-table-root">';
|
99 |
-
|
100 |
-
$e .= '<div class="acf-table-optionwrap">';
|
101 |
-
|
102 |
-
// OPTION HEADER {
|
103 |
-
|
104 |
-
if ( $data_field['use_header'] === 0 ) {
|
105 |
-
|
106 |
-
$e .= '<div class="acf-table-optionbox">';
|
107 |
-
$e .= '<label>' . __( 'use table header', 'acf-table' ) . ' </label>';
|
108 |
-
$e .= '<select class="acf-table-optionbox-field acf-table-fc-opt-use-header" name="acf-table-opt-use-header">';
|
109 |
-
$e .= '<option value="0">' . __( 'No', 'acf-table' ) . '</option>';
|
110 |
-
$e .= '<option value="1">' . __( 'Yes', 'acf-table' ) . '</option>';
|
111 |
-
$e .= '</select>';
|
112 |
-
$e .= '</div>';
|
113 |
-
}
|
114 |
-
|
115 |
-
// }
|
116 |
-
|
117 |
-
// OPTION CAPTION {
|
118 |
-
|
119 |
-
if ( $data_field['use_caption'] === 1 ) {
|
120 |
-
|
121 |
-
$e .= '<div class="acf-table-optionbox">';
|
122 |
-
$e .= '<label for="acf-table-opt-caption">' . __( 'table caption', 'acf-table' ) . ' </label><br>';
|
123 |
-
$e .= '<input class="acf-table-optionbox-field acf-table-fc-opt-caption" id="acf-table-opt-caption" type="text" name="acf-table-opt-caption" value=""></input>';
|
124 |
-
$e .= '</div>';
|
125 |
-
}
|
126 |
-
|
127 |
-
// }
|
128 |
-
|
129 |
-
$e .= '</div>';
|
130 |
-
|
131 |
-
if ( is_array( $field['value'] ) ) {
|
132 |
-
|
133 |
-
$field['value'] = wp_json_encode( $field['value'] );
|
134 |
-
}
|
135 |
-
|
136 |
-
if ( is_string( $field['value'] ) ) {
|
137 |
-
|
138 |
-
if ( substr( $field['value'] , 0 , 1 ) === '{' ) {
|
139 |
-
|
140 |
-
$field['value'] = urlencode( $field['value'] );
|
141 |
-
}
|
142 |
-
}
|
143 |
-
|
144 |
-
$e .= '<div class="acf-input-wrap">';
|
145 |
-
$e .= '<input type="hidden" data-field-options="' . urlencode( wp_json_encode( $data_field ) ) . '" id="' . $field['id'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" value="' . $field['value'] . '"/>';
|
146 |
-
$e .= '</div>';
|
147 |
-
|
148 |
-
$e .= '</div>';
|
149 |
-
|
150 |
-
echo $e;
|
151 |
-
|
152 |
-
}
|
153 |
-
|
154 |
-
/*
|
155 |
-
* input_admin_enqueue_scripts()
|
156 |
-
*
|
157 |
-
* This action is called in the admin_enqueue_scripts action on the edit screen where your field is created.
|
158 |
-
* Use this action to add css + javascript to assist your create_field() action.
|
159 |
-
*
|
160 |
-
* $info http://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts
|
161 |
-
* @type action
|
162 |
-
* @since 3.6
|
163 |
-
* @date 23/01/13
|
164 |
-
*/
|
165 |
-
|
166 |
-
function input_admin_enqueue_scripts()
|
167 |
-
{
|
168 |
-
// Note: This function can be removed if not used
|
169 |
-
|
170 |
-
/// scripts
|
171 |
-
wp_enqueue_script( 'acf-input-table', $this->settings['dir_url'] . 'js/input-v4.js', array( 'jquery', 'acf-input' ), $this->settings['version'], true );
|
172 |
-
|
173 |
-
// styles
|
174 |
-
wp_register_style( 'acf-input-table', $this->settings['dir_url'] . 'css/input.css', array( 'acf-input' ), $this->settings['version'] );
|
175 |
-
wp_enqueue_style(array(
|
176 |
-
'acf-input-table',
|
177 |
-
));
|
178 |
-
}
|
179 |
-
|
180 |
-
/*
|
181 |
-
* create_options()
|
182 |
-
*
|
183 |
-
* Create extra options for your field. This is rendered when editing a field.
|
184 |
-
* The value of $field['name'] can be used (like bellow) to save extra data to the $field
|
185 |
-
*
|
186 |
-
* @type action
|
187 |
-
* @since 3.6
|
188 |
-
* @date 23/01/13
|
189 |
-
*
|
190 |
-
* @param $field - an array holding all the field's data
|
191 |
-
*/
|
192 |
-
|
193 |
-
function create_options($field)
|
194 |
-
{
|
195 |
-
// defaults?
|
196 |
-
/*
|
197 |
-
$field = array_merge($this->defaults, $field);
|
198 |
-
*/
|
199 |
-
|
200 |
-
// key is needed in the field names to correctly save the data
|
201 |
-
$key = $field['name'];
|
202 |
-
|
203 |
-
if ( empty( $field['use_header'] ) ) {
|
204 |
-
|
205 |
-
$field['use_header'] = 0;
|
206 |
-
}
|
207 |
-
|
208 |
-
if ( empty( $field['use_caption'] ) ) {
|
209 |
-
|
210 |
-
$field['use_caption'] = 2;
|
211 |
-
}
|
212 |
-
|
213 |
-
// Create Field Options HTML
|
214 |
-
|
215 |
-
// USE HEADER
|
216 |
-
|
217 |
-
echo '<tr class="field_option field_option_' . $this->name . '">';
|
218 |
-
echo '<td class="label">';
|
219 |
-
echo '<label>' . __( "Table Header", 'acf-table' ) . '</label>';
|
220 |
-
echo '<p class="description">' . __( "Presetting the usage of table header", 'acf-table' ) . '</p>';
|
221 |
-
echo '</td>';
|
222 |
-
echo '<td>';
|
223 |
-
|
224 |
-
do_action('acf/create_field', array(
|
225 |
-
'type' => 'radio',
|
226 |
-
'name' => 'fields[' . $key . '][use_header]',
|
227 |
-
'value' => $field['use_header'],
|
228 |
-
'choices' => array(
|
229 |
-
0 => __( "Optional", 'acf-table' ),
|
230 |
-
1 => __( "Yes", 'acf-table' ),
|
231 |
-
2 => __( "No", 'acf-table' ),
|
232 |
-
),
|
233 |
-
'layout' => 'horizontal',
|
234 |
-
'default_value' => 0,
|
235 |
-
));
|
236 |
-
|
237 |
-
echo '</td>';
|
238 |
-
echo '</tr>';
|
239 |
-
|
240 |
-
// USER CAPTION
|
241 |
-
|
242 |
-
echo '<tr class="field_option field_option_' . $this->name . '">';
|
243 |
-
echo '<td class="label">';
|
244 |
-
echo '<label>' . __( "Table Caption", 'acf-table' ) . '</label>';
|
245 |
-
echo '<p class="description">' . __( "Presetting the usage of table caption", 'acf-table' ) . '</p>';
|
246 |
-
echo '</td>';
|
247 |
-
echo '<td>';
|
248 |
-
|
249 |
-
do_action('acf/create_field', array(
|
250 |
-
'type' => 'radio',
|
251 |
-
'name' => 'fields[' . $key . '][use_caption]',
|
252 |
-
'value' => $field['use_caption'],
|
253 |
-
'choices' => array(
|
254 |
-
1 => __( "Yes", 'acf-table' ),
|
255 |
-
2 => __( "No", 'acf-table' ),
|
256 |
-
),
|
257 |
-
'layout' => 'horizontal',
|
258 |
-
'default_value' => 2,
|
259 |
-
));
|
260 |
-
|
261 |
-
echo '</td>';
|
262 |
-
echo '</tr>';
|
263 |
-
|
264 |
-
}
|
265 |
-
|
266 |
-
/*
|
267 |
-
* format_value()
|
268 |
-
*
|
269 |
-
* This filter is appied to the $value after it is loaded from the db and before it is passed to the create_field action
|
270 |
-
*
|
271 |
-
* @type filter
|
272 |
-
* @since 3.6
|
273 |
-
* @date 23/01/13
|
274 |
-
*
|
275 |
-
* @param $value - the value which was loaded from the database
|
276 |
-
* @param $post_id - the $post_id from which the value was loaded
|
277 |
-
* @param $field - the field array holding all the field options
|
278 |
-
*
|
279 |
-
* @return $value - the modified value
|
280 |
-
*/
|
281 |
-
|
282 |
-
function format_value_for_api( $value, $post_id, $field )
|
283 |
-
{
|
284 |
-
if ( is_string( $value ) ) {
|
285 |
-
|
286 |
-
// CHECK FOR GUTENBERG BLOCK CONTENT (URL ENCODED JSON) {
|
287 |
-
|
288 |
-
if ( substr( $value , 0 , 1 ) === '%' ) {
|
289 |
-
|
290 |
-
$value = urldecode( $value );
|
291 |
-
}
|
292 |
-
|
293 |
-
// }
|
294 |
-
|
295 |
-
$value = json_decode( $value, true ); // decode gutenberg JSONs, but also old table JSONs strings to array
|
296 |
-
}
|
297 |
-
|
298 |
-
$a = $value;
|
299 |
-
|
300 |
-
$value = false;
|
301 |
-
|
302 |
-
// IF BODY DATA
|
303 |
-
|
304 |
-
if (
|
305 |
-
! empty( $a['b'] ) AND
|
306 |
-
count( $a['b'] ) > 0
|
307 |
-
) {
|
308 |
-
|
309 |
-
// IF HEADER DATA
|
310 |
-
|
311 |
-
if ( ! empty( $a['p']['o']['uh'] ) ) {
|
312 |
-
|
313 |
-
$value['header'] = $a['h'];
|
314 |
-
}
|
315 |
-
else {
|
316 |
-
|
317 |
-
$value['header'] = false;
|
318 |
-
}
|
319 |
-
|
320 |
-
// IF CAPTION DATA
|
321 |
-
|
322 |
-
if (
|
323 |
-
! empty( $field['use_caption'] ) AND
|
324 |
-
$field['use_caption'] === 1 AND
|
325 |
-
! empty( $a['p']['ca'] )
|
326 |
-
) {
|
327 |
-
|
328 |
-
$value['caption'] = $a['p']['ca'];
|
329 |
-
}
|
330 |
-
else {
|
331 |
-
|
332 |
-
$value['caption'] = false;
|
333 |
-
}
|
334 |
-
|
335 |
-
// BODY
|
336 |
-
|
337 |
-
$value['body'] = $a['b'];
|
338 |
-
|
339 |
-
// IF SINGLE EMPTY CELL, THEN DO NOT RETURN TABLE DATA
|
340 |
-
|
341 |
-
if (
|
342 |
-
count( $a['b'] ) === 1
|
343 |
-
AND count( $a['b'][0] ) === 1
|
344 |
-
AND trim( $a['b'][0][0]['c'] ) === ''
|
345 |
-
) {
|
346 |
-
|
347 |
-
$value = false;
|
348 |
-
}
|
349 |
-
}
|
350 |
-
|
351 |
-
return $value;
|
352 |
-
}
|
353 |
-
|
354 |
-
/*
|
355 |
-
* update_value()
|
356 |
-
*
|
357 |
-
* This filter is appied to the $value before it is updated in the db
|
358 |
-
*
|
359 |
-
* @type filter
|
360 |
-
* @since 3.6
|
361 |
-
* @date 23/01/13
|
362 |
-
*
|
363 |
-
* @param $value - the value which will be saved in the database
|
364 |
-
* @param $post_id - the $post_id of which the value will be saved
|
365 |
-
* @param $field - the field array holding all the field options
|
366 |
-
*
|
367 |
-
* @return $value - the modified value
|
368 |
-
*/
|
369 |
-
|
370 |
-
function update_value($value, $post_id, $field)
|
371 |
-
{
|
372 |
-
if ( is_string( $value ) ) {
|
373 |
-
|
374 |
-
$value = wp_unslash( $value );
|
375 |
-
$value = urldecode( $value );
|
376 |
-
$value = json_decode( $value, true );
|
377 |
-
}
|
378 |
-
|
379 |
-
// UPDATE via update_field() {
|
380 |
-
|
381 |
-
if (
|
382 |
-
isset( $value['header'] ) OR
|
383 |
-
isset( $value['body'] )
|
384 |
-
) {
|
385 |
-
|
386 |
-
// try post_meta
|
387 |
-
$data = get_post_meta( $post_id, $field['name'], true );
|
388 |
-
|
389 |
-
// try term_meta
|
390 |
-
if ( empty( $data ) ) {
|
391 |
-
|
392 |
-
$data = get_term_meta( str_replace('term_', '', $post_id ), $field['name'], true );
|
393 |
-
}
|
394 |
-
|
395 |
-
// prevents updating a field, thats data are not defined yet
|
396 |
-
if ( empty( $data ) ) {
|
397 |
-
|
398 |
-
return false;
|
399 |
-
}
|
400 |
-
|
401 |
-
if ( is_string( $data ) ) {
|
402 |
-
|
403 |
-
$data = json_decode( $data, true );
|
404 |
-
}
|
405 |
-
|
406 |
-
if ( isset( $value['use_header'] ) ) {
|
407 |
-
|
408 |
-
$data['p']['o']['uh'] = 1;
|
409 |
-
}
|
410 |
-
|
411 |
-
if ( isset( $value['caption'] ) ) {
|
412 |
-
|
413 |
-
$data['p']['ca'] = $value['caption'];
|
414 |
-
}
|
415 |
-
|
416 |
-
if (
|
417 |
-
isset( $value['header'] ) AND
|
418 |
-
$value['header'] !== false
|
419 |
-
) {
|
420 |
-
|
421 |
-
$data['h'] = $value['header'];
|
422 |
-
}
|
423 |
-
|
424 |
-
if ( isset( $value['body'] ) ) {
|
425 |
-
|
426 |
-
$data['b'] = $value['body'];
|
427 |
-
}
|
428 |
-
|
429 |
-
$value = $data;
|
430 |
-
}
|
431 |
-
|
432 |
-
// }
|
433 |
-
|
434 |
-
$value = $this->table_slash( $value );
|
435 |
-
|
436 |
-
return $value;
|
437 |
-
}
|
438 |
-
|
439 |
-
/**
|
440 |
-
* table_slash()
|
441 |
-
*
|
442 |
-
* Add slashes to a string or strings in an array.
|
443 |
-
*
|
444 |
-
* This should be used instead of wp_slash() because wp_slash() convertes all
|
445 |
-
* array values to strings which affects also the table object values of
|
446 |
-
* type number converting to string.
|
447 |
-
*/
|
448 |
-
|
449 |
-
function table_slash( $value ) {
|
450 |
-
|
451 |
-
if ( is_array( $value ) ) {
|
452 |
-
|
453 |
-
foreach ( $value as $k => $v ) {
|
454 |
-
|
455 |
-
if (
|
456 |
-
is_array( $v ) OR
|
457 |
-
is_object( $v )
|
458 |
-
) {
|
459 |
-
$value[ $k ] = $this->table_slash( $v );
|
460 |
-
}
|
461 |
-
else if( is_string( $v ) ) {
|
462 |
-
|
463 |
-
$value[ $k ] = addslashes( $v );
|
464 |
-
}
|
465 |
-
else {
|
466 |
-
|
467 |
-
$value[ $k ] = $v;
|
468 |
-
}
|
469 |
-
}
|
470 |
-
|
471 |
-
} else {
|
472 |
-
|
473 |
-
$value = addslashes( $value );
|
474 |
-
}
|
475 |
-
|
476 |
-
return $value;
|
477 |
-
}
|
478 |
-
|
479 |
-
}
|
480 |
-
|
481 |
-
// create field
|
482 |
-
new acf_table_add_on();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
acf-table.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Advanced Custom Fields: Table Field
|
4 |
Plugin URI: http://www.johannheyne.de/
|
5 |
Description: This free Add-on adds a table field type for the Advanced Custom Fields plugin.
|
6 |
-
Version: 1.3.
|
7 |
Author: Johann Heyne
|
8 |
Author URI: http://www.johannheyne.de/
|
9 |
License: GPLv2 or later
|
@@ -12,29 +12,38 @@ Text Domain: acf-table
|
|
12 |
Domain Path: /lang/
|
13 |
*/
|
14 |
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
function acf_table_load_plugin_textdomain( $version ) {
|
18 |
|
19 |
load_plugin_textdomain( 'acf-table', false, dirname( plugin_basename(__FILE__) ) . '/lang/' );
|
20 |
}
|
21 |
|
22 |
-
add_action('plugins_loaded', 'acf_table_load_plugin_textdomain');
|
23 |
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
|
29 |
-
|
30 |
-
}
|
31 |
|
32 |
-
add_action('acf/include_field_types', 'include_field_types_table');
|
33 |
|
34 |
-
|
35 |
-
function register_fields_table() {
|
36 |
|
37 |
-
|
38 |
-
|
|
|
|
|
39 |
|
40 |
-
|
|
|
|
|
|
3 |
Plugin Name: Advanced Custom Fields: Table Field
|
4 |
Plugin URI: http://www.johannheyne.de/
|
5 |
Description: This free Add-on adds a table field type for the Advanced Custom Fields plugin.
|
6 |
+
Version: 1.3.17
|
7 |
Author: Johann Heyne
|
8 |
Author URI: http://www.johannheyne.de/
|
9 |
License: GPLv2 or later
|
12 |
Domain Path: /lang/
|
13 |
*/
|
14 |
|
15 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
16 |
+
exit;
|
17 |
+
}
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Loads plugin textdomain.
|
21 |
+
* https://codex.wordpress.org/Function_Reference/load_plugin_textdomain
|
22 |
+
*/
|
23 |
+
|
24 |
function acf_table_load_plugin_textdomain( $version ) {
|
25 |
|
26 |
load_plugin_textdomain( 'acf-table', false, dirname( plugin_basename(__FILE__) ) . '/lang/' );
|
27 |
}
|
28 |
|
29 |
+
add_action( 'plugins_loaded', 'acf_table_load_plugin_textdomain' );
|
30 |
|
31 |
|
32 |
+
/**
|
33 |
+
* Registers the ACF field type.
|
34 |
+
*/
|
35 |
|
36 |
+
add_action( 'init', 'jh_include_acf_field_table' );
|
|
|
37 |
|
|
|
38 |
|
39 |
+
function jh_include_acf_field_table() {
|
|
|
40 |
|
41 |
+
if ( ! function_exists( 'acf_register_field_type' ) ) {
|
42 |
+
|
43 |
+
return;
|
44 |
+
}
|
45 |
|
46 |
+
require_once __DIR__ . '/class-jh-acf-field-table.php';
|
47 |
+
|
48 |
+
acf_register_field_type( 'jh_acf_field_table' );
|
49 |
+
}
|
changelog.txt
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
== Changelog ==
|
2 |
|
|
|
|
|
|
|
|
|
3 |
= 1.3.16 =
|
4 |
* Fixes an logical error causing PHP warnings
|
5 |
|
1 |
== Changelog ==
|
2 |
|
3 |
+
= 1.3.17 =
|
4 |
+
* Changes registering the ACF field type using the acf_register_field_type methode.
|
5 |
+
* Removes support for ACF version 4.
|
6 |
+
|
7 |
= 1.3.16 =
|
8 |
* Fixes an logical error causing PHP warnings
|
9 |
|
acf-table-v5.php → class-jh-acf-field-table.php
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class
|
4 |
|
5 |
/*
|
6 |
* __construct
|
@@ -21,7 +21,7 @@ class acf_field_table extends acf_field {
|
|
21 |
* settings (array) Array of settings
|
22 |
*/
|
23 |
$this->settings = array(
|
24 |
-
'version' => '1.3.
|
25 |
'dir_url' => plugins_url( '', __FILE__ ) . '/',
|
26 |
);
|
27 |
|
@@ -789,6 +789,3 @@ class acf_field_table extends acf_field {
|
|
789 |
}
|
790 |
|
791 |
}
|
792 |
-
|
793 |
-
// create field
|
794 |
-
new acf_field_table();
|
1 |
<?php
|
2 |
|
3 |
+
class jh_acf_field_table extends acf_field {
|
4 |
|
5 |
/*
|
6 |
* __construct
|
21 |
* settings (array) Array of settings
|
22 |
*/
|
23 |
$this->settings = array(
|
24 |
+
'version' => '1.3.17',
|
25 |
'dir_url' => plugins_url( '', __FILE__ ) . '/',
|
26 |
);
|
27 |
|
789 |
}
|
790 |
|
791 |
}
|
|
|
|
|
|
js/input-v4.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
var t = this;
|
6 |
|
7 |
-
t.version = '1.3.
|
8 |
|
9 |
t.param = {};
|
10 |
|
4 |
|
5 |
var t = this;
|
6 |
|
7 |
+
t.version = '1.3.17';
|
8 |
|
9 |
t.param = {};
|
10 |
|
js/input-v5.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
var t = this;
|
6 |
|
7 |
-
t.version = '1.3.
|
8 |
|
9 |
t.param = {};
|
10 |
|
4 |
|
5 |
var t = this;
|
6 |
|
7 |
+
t.version = '1.3.17';
|
8 |
|
9 |
t.param = {};
|
10 |
|
lang/acf-table-da_DK.po
CHANGED
@@ -38,10 +38,10 @@ msgid ""
|
|
38 |
msgstr ""
|
39 |
|
40 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
41 |
-
#. Fields: Table Field 1.3.
|
42 |
#. Plugin URI of the plugin/theme
|
43 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
44 |
-
#. Fields: Table Field 1.3.
|
45 |
#. Author URI of the plugin/theme
|
46 |
msgid "http://www.johannheyne.de/"
|
47 |
msgstr "http://www.johannheyne.de/"
|
38 |
msgstr ""
|
39 |
|
40 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
41 |
+
#. Fields: Table Field 1.3.17) #-#-#-#-#
|
42 |
#. Plugin URI of the plugin/theme
|
43 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
44 |
+
#. Fields: Table Field 1.3.17) #-#-#-#-#
|
45 |
#. Author URI of the plugin/theme
|
46 |
msgid "http://www.johannheyne.de/"
|
47 |
msgstr "http://www.johannheyne.de/"
|
lang/acf-table-de_DE.po
CHANGED
@@ -38,10 +38,10 @@ msgstr ""
|
|
38 |
"Tabellen Feldtype hinzu."
|
39 |
|
40 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
41 |
-
#. Fields: Table Field 1.3.
|
42 |
#. Plugin URI of the plugin/theme
|
43 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
44 |
-
#. Fields: Table Field 1.3.
|
45 |
#. Author URI of the plugin/theme
|
46 |
msgid "http://www.johannheyne.de/"
|
47 |
msgstr "http://www.johannheyne.de/"
|
38 |
"Tabellen Feldtype hinzu."
|
39 |
|
40 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
41 |
+
#. Fields: Table Field 1.3.17) #-#-#-#-#
|
42 |
#. Plugin URI of the plugin/theme
|
43 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
44 |
+
#. Fields: Table Field 1.3.17) #-#-#-#-#
|
45 |
#. Author URI of the plugin/theme
|
46 |
msgid "http://www.johannheyne.de/"
|
47 |
msgstr "http://www.johannheyne.de/"
|
lang/acf-table-pl_PL.po
CHANGED
@@ -36,10 +36,10 @@ msgid ""
|
|
36 |
msgstr ""
|
37 |
|
38 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
39 |
-
#. Fields: Table Field 1.3.
|
40 |
#. Plugin URI of the plugin/theme
|
41 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
42 |
-
#. Fields: Table Field 1.3.
|
43 |
#. Author URI of the plugin/theme
|
44 |
msgid "http://www.johannheyne.de/"
|
45 |
msgstr ""
|
36 |
msgstr ""
|
37 |
|
38 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
39 |
+
#. Fields: Table Field 1.3.17) #-#-#-#-#
|
40 |
#. Plugin URI of the plugin/theme
|
41 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
42 |
+
#. Fields: Table Field 1.3.17) #-#-#-#-#
|
43 |
#. Author URI of the plugin/theme
|
44 |
msgid "http://www.johannheyne.de/"
|
45 |
msgstr ""
|
lang/acf-table.pot
CHANGED
@@ -32,10 +32,10 @@ msgid "This free Add-on adds a table field type for the Advanced Custom Fields p
|
|
32 |
msgstr ""
|
33 |
|
34 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
35 |
-
#. Fields: Table Field 1.3.
|
36 |
#. Plugin URI of the plugin/theme
|
37 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
38 |
-
#. Fields: Table Field 1.3.
|
39 |
#. Author URI of the plugin/theme
|
40 |
msgid "http://www.johannheyne.de/"
|
41 |
msgstr ""
|
32 |
msgstr ""
|
33 |
|
34 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
35 |
+
#. Fields: Table Field 1.3.17) #-#-#-#-#
|
36 |
#. Plugin URI of the plugin/theme
|
37 |
#. #-#-#-#-# advanced-custom-fields-table-field-code.pot (Advanced Custom
|
38 |
+
#. Fields: Table Field 1.3.17) #-#-#-#-#
|
39 |
#. Author URI of the plugin/theme
|
40 |
msgid "http://www.johannheyne.de/"
|
41 |
msgstr ""
|
readme.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
Contributors: jonua
|
3 |
Tags: acf table
|
4 |
Requires at least: 5.3
|
5 |
-
Tested up to: 6.0
|
6 |
Stable tag: 1.3.16
|
7 |
Requires PHP: 7.3
|
8 |
License: GPLv2 or later
|
@@ -357,6 +357,10 @@ However, only when activated as a plugin will updates be available.
|
|
357 |
|
358 |
== Changelog ==
|
359 |
|
|
|
|
|
|
|
|
|
360 |
= 1.3.16 =
|
361 |
* Fixes an logical error causing PHP warnings
|
362 |
|
2 |
Contributors: jonua
|
3 |
Tags: acf table
|
4 |
Requires at least: 5.3
|
5 |
+
Tested up to: 6.1.0
|
6 |
Stable tag: 1.3.16
|
7 |
Requires PHP: 7.3
|
8 |
License: GPLv2 or later
|
357 |
|
358 |
== Changelog ==
|
359 |
|
360 |
+
= 1.3.17 =
|
361 |
+
* Changes registering the ACF field type using the acf_register_field_type methode.
|
362 |
+
* Removes support for ACF version 4.
|
363 |
+
|
364 |
= 1.3.16 =
|
365 |
* Fixes an logical error causing PHP warnings
|
366 |
|