Version Description
- [IMPORTANT] Change field group option "Show on page" to "Hide on Screen" to allow for future proof adding new elements to list. Previously exported and registered field groups via PHP will still work as expected! This change will prompt you for a database upgrade.
- [Added] Add in edit button to upload image / file thickbox
- [Improved] Changed loading default values. Now behaves as expected!
- [Fixed] Test / Fix full screen mode dissapearing from editor - http://www.advancedcustomfields.com/support/discussion/2124/full-screen-button-for-zen-mode-is-gone
- [Fixed] get_field returning false for 0 - http://advancedcustomfields.com/support/discussion/2115/get_field-returns-false-if-field-has-value-0
- [Improved] Improve relationship sortable code with item param - http://www.advancedcustomfields.com/support/discussion/comment/3536#Comment_3536
- [Fixed] IE category js bug - http://www.advancedcustomfields.com/support/discussion/2127/ie-78-category-checkbox-bug
- [Fixed] Flexible content field row css bug - http://www.advancedcustomfields.com/support/discussion/2126/space-between-fields-is-a-little-tight-in-3.2.33.2.4
- [Fixed] Repeater row limit in flexible field bug - http://www.advancedcustomfields.com/support/discussion/1635/repeater-with-row-limit-of-1-inside-flexible-field-no-rows-show
- [Fixed] Fix update message - appears on first activation
- [Fixed] Fix options page sidebar drag area - no border needed
- [Fixed] Fix export options page activation - http://www.advancedcustomfields.com/support/discussion/2112/options-page-not-working-in-functions.php
Download this release
Release Info
Developer | elliotcondon |
Plugin | Advanced Custom Fields |
Version | 3.2.5 |
Comparing to | |
See all releases |
Code changes from version 3.2.4 to 3.2.5
- acf.php +51 -46
- core/actions/init.php +1 -1
- core/actions/save_fields.php +2 -2
- core/admin/meta_box_options.php +14 -12
- core/admin/page_settings.php +1 -1
- core/admin/upgrade.php +6 -2
- core/admin/upgrade_ajax.php +53 -1
- core/api.php +10 -0
- core/fields/acf_field.php +30 -11
- core/fields/file.php +67 -13
- core/fields/flexible_content.php +38 -18
- core/fields/image.php +71 -48
- core/fields/repeater.php +6 -1
- core/fields/wysiwyg.php +13 -52
- core/options_page.php +1 -1
- css/input.css +8 -0
- js/input-actions.js +1 -0
- js/input-ajax.js +21 -20
- readme.txt +14 -0
acf.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Advanced Custom Fields
|
4 |
Plugin URI: http://www.advancedcustomfields.com/
|
5 |
Description: Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress.Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker and more!
|
6 |
-
Version: 3.2.
|
7 |
Author: Elliot Condon
|
8 |
Author URI: http://www.elliotcondon.com/
|
9 |
License: GPL
|
@@ -44,8 +44,8 @@ class Acf
|
|
44 |
$this->dir = plugins_url('',__FILE__);
|
45 |
$this->siteurl = get_bloginfo('url');
|
46 |
$this->wpadminurl = admin_url();
|
47 |
-
$this->version = '3.2.
|
48 |
-
$this->upgrade_version = '3.
|
49 |
$this->cache = array(); // basic array cache to hold data throughout the page load
|
50 |
|
51 |
|
@@ -912,18 +912,14 @@ class Acf
|
|
912 |
|
913 |
function get_acf_options($post_id)
|
914 |
{
|
|
|
915 |
// defaults
|
916 |
$options = array(
|
917 |
-
'position'
|
918 |
-
'layout'
|
919 |
-
'
|
920 |
);
|
921 |
-
|
922 |
-
// If this is a new acf, there will be no custom keys!
|
923 |
-
if(!get_post_custom_keys($post_id))
|
924 |
-
{
|
925 |
-
$options['show_on_page'] = array('the_content', 'excerpt', 'discussion', 'custom_fields', 'comments', 'slug', 'author');
|
926 |
-
}
|
927 |
|
928 |
// return
|
929 |
return $options;
|
@@ -997,7 +993,7 @@ class Acf
|
|
997 |
{
|
998 |
if(!isset($this->fields[$field['type']]) || !is_object($this->fields[$field['type']]))
|
999 |
{
|
1000 |
-
return
|
1001 |
}
|
1002 |
|
1003 |
return $this->fields[$field['type']]->get_value($post_id, $field);
|
@@ -1251,41 +1247,50 @@ class Acf
|
|
1251 |
{
|
1252 |
foreach($acfs as $acf)
|
1253 |
{
|
1254 |
-
if($acf['id']
|
|
|
|
|
|
|
|
|
1255 |
{
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
}
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
}
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
}
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
}
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
}
|
1277 |
-
if(!in_array('slug',$acf['options']['show_on_page']))
|
1278 |
-
{
|
1279 |
-
$html .= '#slugdiv, #screen-meta label[for=slugdiv-hide] {display: none;} ';
|
1280 |
-
}
|
1281 |
-
if(!in_array('author',$acf['options']['show_on_page']))
|
1282 |
-
{
|
1283 |
-
$html .= '#authordiv, #screen-meta label[for=authordiv-hide] {display: none;} ';
|
1284 |
-
}
|
1285 |
-
|
1286 |
-
break;
|
1287 |
}
|
1288 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1289 |
}
|
1290 |
// foreach($acfs as $acf)
|
1291 |
}
|
3 |
Plugin Name: Advanced Custom Fields
|
4 |
Plugin URI: http://www.advancedcustomfields.com/
|
5 |
Description: Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress.Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker and more!
|
6 |
+
Version: 3.2.5
|
7 |
Author: Elliot Condon
|
8 |
Author URI: http://www.elliotcondon.com/
|
9 |
License: GPL
|
44 |
$this->dir = plugins_url('',__FILE__);
|
45 |
$this->siteurl = get_bloginfo('url');
|
46 |
$this->wpadminurl = admin_url();
|
47 |
+
$this->version = '3.2.5';
|
48 |
+
$this->upgrade_version = '3.2.5'; // this is the latest version which requires an upgrade
|
49 |
$this->cache = array(); // basic array cache to hold data throughout the page load
|
50 |
|
51 |
|
912 |
|
913 |
function get_acf_options($post_id)
|
914 |
{
|
915 |
+
|
916 |
// defaults
|
917 |
$options = array(
|
918 |
+
'position' => get_post_meta($post_id, 'position', true) ? get_post_meta($post_id, 'position', true) : 'normal',
|
919 |
+
'layout' => get_post_meta($post_id, 'layout', true) ? get_post_meta($post_id, 'layout', true) : 'default',
|
920 |
+
'hide_on_screen' => get_post_meta($post_id, 'hide_on_screen', true) ? get_post_meta($post_id, 'hide_on_screen', true) : array(),
|
921 |
);
|
922 |
+
|
|
|
|
|
|
|
|
|
|
|
923 |
|
924 |
// return
|
925 |
return $options;
|
993 |
{
|
994 |
if(!isset($this->fields[$field['type']]) || !is_object($this->fields[$field['type']]))
|
995 |
{
|
996 |
+
return false;
|
997 |
}
|
998 |
|
999 |
return $this->fields[$field['type']]->get_value($post_id, $field);
|
1247 |
{
|
1248 |
foreach($acfs as $acf)
|
1249 |
{
|
1250 |
+
if($acf['id'] != $acf_id) continue;
|
1251 |
+
|
1252 |
+
|
1253 |
+
// add style to html
|
1254 |
+
if( in_array('the_content',$acf['options']['hide_on_screen']) )
|
1255 |
{
|
1256 |
+
$html .= '#postdivrich {display: none;} ';
|
1257 |
+
}
|
1258 |
+
if( in_array('excerpt',$acf['options']['hide_on_screen']) )
|
1259 |
+
{
|
1260 |
+
$html .= '#postexcerpt, #screen-meta label[for=postexcerpt-hide] {display: none;} ';
|
1261 |
+
}
|
1262 |
+
if( in_array('custom_fields',$acf['options']['hide_on_screen']) )
|
1263 |
+
{
|
1264 |
+
$html .= '#postcustom, #screen-meta label[for=postcustom-hide] { display: none; } ';
|
1265 |
+
}
|
1266 |
+
if( in_array('discussion',$acf['options']['hide_on_screen']) )
|
1267 |
+
{
|
1268 |
+
$html .= '#commentstatusdiv, #screen-meta label[for=commentstatusdiv-hide] {display: none;} ';
|
1269 |
+
}
|
1270 |
+
if( in_array('comments',$acf['options']['hide_on_screen']) )
|
1271 |
+
{
|
1272 |
+
$html .= '#commentsdiv, #screen-meta label[for=commentsdiv-hide] {display: none;} ';
|
1273 |
+
}
|
1274 |
+
if( in_array('slug',$acf['options']['hide_on_screen']) )
|
1275 |
+
{
|
1276 |
+
$html .= '#slugdiv, #screen-meta label[for=slugdiv-hide] {display: none;} ';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1277 |
}
|
1278 |
+
if( in_array('author',$acf['options']['hide_on_screen']) )
|
1279 |
+
{
|
1280 |
+
$html .= '#authordiv, #screen-meta label[for=authordiv-hide] {display: none;} ';
|
1281 |
+
}
|
1282 |
+
if( in_array('format',$acf['options']['hide_on_screen']) )
|
1283 |
+
{
|
1284 |
+
$html .= '#formatdiv, #screen-meta label[for=formatdiv-hide] {display: none;} ';
|
1285 |
+
}
|
1286 |
+
if( in_array('featured_image',$acf['options']['hide_on_screen']) )
|
1287 |
+
{
|
1288 |
+
$html .= '#postimagediv, #screen-meta label[for=postimagediv-hide] {display: none;} ';
|
1289 |
+
}
|
1290 |
+
|
1291 |
+
|
1292 |
+
break;
|
1293 |
+
|
1294 |
}
|
1295 |
// foreach($acfs as $acf)
|
1296 |
}
|
core/actions/init.php
CHANGED
@@ -15,7 +15,7 @@ $this->setup_fields();
|
|
15 |
|
16 |
$version = get_option('acf_version', false);
|
17 |
|
18 |
-
if(
|
19 |
{
|
20 |
if( $version < $this->upgrade_version )
|
21 |
{
|
15 |
|
16 |
$version = get_option('acf_version', false);
|
17 |
|
18 |
+
if( $version )
|
19 |
{
|
20 |
if( $version < $this->upgrade_version )
|
21 |
{
|
core/actions/save_fields.php
CHANGED
@@ -64,10 +64,10 @@ $options = $_POST['options'];
|
|
64 |
|
65 |
if(!isset($options['position'])) { $options['position'] = 'normal'; }
|
66 |
if(!isset($options['layout'])) { $options['layout'] = 'default'; }
|
67 |
-
if(!isset($options['
|
68 |
|
69 |
update_post_meta($post_id, 'position', $options['position']);
|
70 |
update_post_meta($post_id, 'layout', $options['layout']);
|
71 |
-
update_post_meta($post_id, '
|
72 |
|
73 |
?>
|
64 |
|
65 |
if(!isset($options['position'])) { $options['position'] = 'normal'; }
|
66 |
if(!isset($options['layout'])) { $options['layout'] = 'default'; }
|
67 |
+
if(!isset($options['hide_on_screen'])) { $options['hide_on_screen'] = array(); }
|
68 |
|
69 |
update_post_meta($post_id, 'position', $options['position']);
|
70 |
update_post_meta($post_id, 'layout', $options['layout']);
|
71 |
+
update_post_meta($post_id, 'hide_on_screen', $options['hide_on_screen']);
|
72 |
|
73 |
?>
|
core/admin/meta_box_options.php
CHANGED
@@ -67,25 +67,27 @@ $options = $this->get_acf_options($post->ID);
|
|
67 |
</tr>
|
68 |
<tr>
|
69 |
<td class="label">
|
70 |
-
<label for="post_type"><?php _e("
|
71 |
-
<p class="description"><?php _e("
|
72 |
-
<p class="description"><?php _e("If multiple
|
73 |
</td>
|
74 |
<td>
|
75 |
<?php
|
76 |
|
77 |
$this->create_field(array(
|
78 |
'type' => 'checkbox',
|
79 |
-
'name' => 'options[
|
80 |
-
'value' => $options['
|
81 |
'choices' => array(
|
82 |
-
'the_content'
|
83 |
-
'excerpt'
|
84 |
-
'custom_fields'
|
85 |
-
'discussion'
|
86 |
-
'comments'
|
87 |
-
'slug'
|
88 |
-
'author'
|
|
|
|
|
89 |
)
|
90 |
));
|
91 |
|
67 |
</tr>
|
68 |
<tr>
|
69 |
<td class="label">
|
70 |
+
<label for="post_type"><?php _e("Hide on screen",'acf'); ?></label>
|
71 |
+
<p class="description"><?php _e("<b>Select</b> items to <b>hide</b> them from the edit screen",'acf'); ?></p>
|
72 |
+
<p class="description"><?php _e("If multiple field groups appear on an edit screen, the first field group's options will be used. (the one with the lowest order number)",'acf'); ?></p>
|
73 |
</td>
|
74 |
<td>
|
75 |
<?php
|
76 |
|
77 |
$this->create_field(array(
|
78 |
'type' => 'checkbox',
|
79 |
+
'name' => 'options[hide_on_screen]',
|
80 |
+
'value' => $options['hide_on_screen'],
|
81 |
'choices' => array(
|
82 |
+
'the_content' => __("Content Editor",'acf'),
|
83 |
+
'excerpt' => __("Excerpt"),
|
84 |
+
'custom_fields' => __("Custom Fields"),
|
85 |
+
'discussion' => __("Discussion"),
|
86 |
+
'comments' => __("Comments"),
|
87 |
+
'slug' => __("Slug"),
|
88 |
+
'author' => __("Author"),
|
89 |
+
'format' => __("Format"),
|
90 |
+
'featured_image' => __("Featured Image")
|
91 |
)
|
92 |
));
|
93 |
|
core/admin/page_settings.php
CHANGED
@@ -298,7 +298,7 @@ elseif($action == "export_php"):
|
|
298 |
*/",'acf'); ?>
|
299 |
|
300 |
// if(!get_option('acf_repeater_ac')) update_option('acf_repeater_ac', "xxxx-xxxx-xxxx-xxxx");
|
301 |
-
// if(!get_option('
|
302 |
// if(!get_option('acf_flexible_content_ac')) update_option('acf_flexible_content_ac', "xxxx-xxxx-xxxx-xxxx");
|
303 |
|
304 |
|
298 |
*/",'acf'); ?>
|
299 |
|
300 |
// if(!get_option('acf_repeater_ac')) update_option('acf_repeater_ac', "xxxx-xxxx-xxxx-xxxx");
|
301 |
+
// if(!get_option('acf_options_page_ac')) update_option('acf_options_page_ac', "xxxx-xxxx-xxxx-xxxx");
|
302 |
// if(!get_option('acf_flexible_content_ac')) update_option('acf_flexible_content_ac', "xxxx-xxxx-xxxx-xxxx");
|
303 |
|
304 |
|
core/admin/upgrade.php
CHANGED
@@ -13,14 +13,18 @@ $version = get_option('acf_version','1.0.5');
|
|
13 |
$next = false;
|
14 |
|
15 |
// list of starting points
|
16 |
-
if(
|
17 |
{
|
18 |
$next = '3.0.0';
|
19 |
}
|
20 |
-
elseif(
|
21 |
{
|
22 |
$next = '3.1.8';
|
23 |
}
|
|
|
|
|
|
|
|
|
24 |
?>
|
25 |
|
26 |
<script type="text/javascript">
|
13 |
$next = false;
|
14 |
|
15 |
// list of starting points
|
16 |
+
if( $version < '3.0.0' )
|
17 |
{
|
18 |
$next = '3.0.0';
|
19 |
}
|
20 |
+
elseif( $version < '3.1.8' )
|
21 |
{
|
22 |
$next = '3.1.8';
|
23 |
}
|
24 |
+
elseif( $version < '3.2.5' )
|
25 |
+
{
|
26 |
+
$next = '3.2.5';
|
27 |
+
}
|
28 |
?>
|
29 |
|
30 |
<script type="text/javascript">
|
core/admin/upgrade_ajax.php
CHANGED
@@ -319,7 +319,7 @@ switch($_POST['version'])
|
|
319 |
$return = array(
|
320 |
'status' => true,
|
321 |
'message' => $message,
|
322 |
-
'next' =>
|
323 |
);
|
324 |
|
325 |
break;
|
@@ -434,6 +434,58 @@ switch($_POST['version'])
|
|
434 |
// update version
|
435 |
update_option('acf_version','3.1.8');
|
436 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
437 |
$return = array(
|
438 |
'status' => true,
|
439 |
'message' => $message,
|
319 |
$return = array(
|
320 |
'status' => true,
|
321 |
'message' => $message,
|
322 |
+
'next' => '3.1.8',
|
323 |
);
|
324 |
|
325 |
break;
|
434 |
// update version
|
435 |
update_option('acf_version','3.1.8');
|
436 |
|
437 |
+
$return = array(
|
438 |
+
'status' => true,
|
439 |
+
'message' => $message,
|
440 |
+
'next' => '3.2.5',
|
441 |
+
);
|
442 |
+
|
443 |
+
break;
|
444 |
+
|
445 |
+
|
446 |
+
/*---------------------
|
447 |
+
*
|
448 |
+
* 3.1.8
|
449 |
+
*
|
450 |
+
*--------------------*/
|
451 |
+
|
452 |
+
case '3.2.5':
|
453 |
+
|
454 |
+
// vars
|
455 |
+
$message = __("Modifying field group options 'show on page'",'acf') . '...';
|
456 |
+
|
457 |
+
|
458 |
+
// get acf's
|
459 |
+
$result = get_pages(array(
|
460 |
+
'numberposts' => -1,
|
461 |
+
'post_type' => 'acf',
|
462 |
+
'sort_column' => 'menu_order',
|
463 |
+
'order' => 'ASC',
|
464 |
+
));
|
465 |
+
|
466 |
+
|
467 |
+
$show_all = array('the_content', 'discussion', 'custom_fields', 'comments', 'slug', 'author');
|
468 |
+
|
469 |
+
|
470 |
+
// populate acfs
|
471 |
+
if($result)
|
472 |
+
{
|
473 |
+
foreach($result as $acf)
|
474 |
+
{
|
475 |
+
$show_on_page = get_post_meta($acf->ID, 'show_on_page', true) ? get_post_meta($acf->ID, 'show_on_page', true) : array();
|
476 |
+
|
477 |
+
$hide_on_screen = array_diff($show_all, $show_on_page);
|
478 |
+
|
479 |
+
update_post_meta($acf->ID, 'hide_on_screen', $hide_on_screen);
|
480 |
+
delete_post_meta($acf->ID, 'show_on_page');
|
481 |
+
|
482 |
+
}
|
483 |
+
}
|
484 |
+
|
485 |
+
|
486 |
+
// update version
|
487 |
+
update_option('acf_version','3.2.5');
|
488 |
+
|
489 |
$return = array(
|
490 |
'status' => true,
|
491 |
'message' => $message,
|
core/api.php
CHANGED
@@ -306,6 +306,16 @@ function register_field_group($array)
|
|
306 |
$array['id'] = uniqid();
|
307 |
}
|
308 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
$GLOBALS['acf_register_field_group'][] = $array;
|
310 |
}
|
311 |
|
306 |
$array['id'] = uniqid();
|
307 |
}
|
308 |
|
309 |
+
|
310 |
+
// 3.2.5 - changed show_on_page option
|
311 |
+
if( !isset($array['options']['hide_on_screen']) && isset($array['options']['show_on_page']) )
|
312 |
+
{
|
313 |
+
$show_all = array('the_content', 'discussion', 'custom_fields', 'comments', 'slug', 'author');
|
314 |
+
$array['options']['hide_on_screen'] = array_diff($show_all, $array['options']['show_on_page']);
|
315 |
+
unset( $array['options']['show_on_page'] );
|
316 |
+
}
|
317 |
+
|
318 |
+
|
319 |
$GLOBALS['acf_register_field_group'][] = $array;
|
320 |
}
|
321 |
|
core/fields/acf_field.php
CHANGED
@@ -161,29 +161,48 @@ class acf_Field
|
|
161 |
|
162 |
function get_value($post_id, $field)
|
163 |
{
|
164 |
-
$value =
|
165 |
|
166 |
// if $post_id is a string, then it is used in the everything fields and can be found in the options table
|
167 |
if( is_numeric($post_id) )
|
168 |
{
|
169 |
-
$value = get_post_meta( $post_id, $field['name'],
|
170 |
|
171 |
-
//
|
172 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
{
|
174 |
-
|
175 |
}
|
176 |
}
|
177 |
else
|
178 |
{
|
179 |
-
$value = get_option( $post_id . '_' . $field['name'],
|
180 |
-
|
181 |
-
|
182 |
-
if( $value == "" && isset($field['default_value']) )
|
183 |
{
|
184 |
-
|
185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
}
|
|
|
187 |
|
188 |
return $value;
|
189 |
}
|
161 |
|
162 |
function get_value($post_id, $field)
|
163 |
{
|
164 |
+
$value = false;
|
165 |
|
166 |
// if $post_id is a string, then it is used in the everything fields and can be found in the options table
|
167 |
if( is_numeric($post_id) )
|
168 |
{
|
169 |
+
$value = get_post_meta( $post_id, $field['name'], false );
|
170 |
|
171 |
+
// value is an array, check and assign the real value / default value
|
172 |
+
if( empty($value) )
|
173 |
+
{
|
174 |
+
if( isset($field['default_value']) )
|
175 |
+
{
|
176 |
+
$value = $field['default_value'];
|
177 |
+
}
|
178 |
+
else
|
179 |
+
{
|
180 |
+
$value = false;
|
181 |
+
}
|
182 |
+
}
|
183 |
+
else
|
184 |
{
|
185 |
+
$value = $value[0];
|
186 |
}
|
187 |
}
|
188 |
else
|
189 |
{
|
190 |
+
$value = get_option( $post_id . '_' . $field['name'], null );
|
191 |
+
|
192 |
+
if( is_null($value) )
|
|
|
193 |
{
|
194 |
+
if( isset($field['default_value']) )
|
195 |
+
{
|
196 |
+
$value = $field['default_value'];
|
197 |
+
}
|
198 |
+
else
|
199 |
+
{
|
200 |
+
$value = false;
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
}
|
205 |
+
|
206 |
|
207 |
return $value;
|
208 |
}
|
core/fields/file.php
CHANGED
@@ -222,15 +222,36 @@ class acf_File extends acf_Field
|
|
222 |
---------------------------------------------------------------------------------------------*/
|
223 |
function popup_head()
|
224 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
225 |
if(isset($_GET["acf_type"]) && $_GET['acf_type'] == 'file')
|
226 |
{
|
227 |
-
$
|
|
|
228 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
229 |
?><style type="text/css">
|
230 |
#media-upload-header #sidemenu li#tab-type_url,
|
231 |
-
#media-upload-header #sidemenu li#tab-gallery,
|
232 |
-
#media-items .media-item
|
233 |
-
#media-items .media-item
|
|
|
|
|
|
|
234 |
display: none !important;
|
235 |
}
|
236 |
|
@@ -251,18 +272,17 @@ class acf_File extends acf_Field
|
|
251 |
|
252 |
#media-items .media-item .filename.new {
|
253 |
min-height: 0;
|
254 |
-
padding:
|
255 |
-
line-height:
|
256 |
-
|
257 |
}
|
258 |
|
259 |
#media-items .media-item .title {
|
260 |
line-height: 14px;
|
261 |
}
|
262 |
|
263 |
-
#media-items .media-item .
|
264 |
float: right;
|
265 |
-
margin:
|
266 |
}
|
267 |
|
268 |
#media-upload .ml-submit {
|
@@ -282,6 +302,7 @@ class acf_File extends acf_Field
|
|
282 |
margin: 0 10px 0 0;
|
283 |
}
|
284 |
|
|
|
285 |
</style>
|
286 |
<script type="text/javascript">
|
287 |
(function($){
|
@@ -292,7 +313,7 @@ class acf_File extends acf_Field
|
|
292 |
* @created : 29/03/2012
|
293 |
*/
|
294 |
|
295 |
-
$('#media-items .media-item
|
296 |
|
297 |
var id = $(this).attr('href');
|
298 |
|
@@ -405,6 +426,24 @@ class acf_File extends acf_Field
|
|
405 |
});
|
406 |
|
407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
|
409 |
// set a interval function to add buttons to media items
|
410 |
function acf_add_buttons()
|
@@ -441,8 +480,15 @@ class acf_File extends acf_Field
|
|
441 |
$(this).prepend('<input type="checkbox" class="acf-checkbox" value="' + id + '" <?php if($tab == "type"){echo 'checked="checked"';} ?> />');
|
442 |
}
|
443 |
|
444 |
-
|
445 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
|
447 |
});
|
448 |
}
|
@@ -464,9 +510,17 @@ class acf_File extends acf_Field
|
|
464 |
}, 1);
|
465 |
|
466 |
|
467 |
-
$('form#filter
|
468 |
|
469 |
$(this).append('<input type="hidden" name="acf_type" value="file" />');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
470 |
|
471 |
});
|
472 |
});
|
222 |
---------------------------------------------------------------------------------------------*/
|
223 |
function popup_head()
|
224 |
{
|
225 |
+
// defults
|
226 |
+
$access = false;
|
227 |
+
$tab = "type";
|
228 |
+
|
229 |
+
|
230 |
+
// GET
|
231 |
if(isset($_GET["acf_type"]) && $_GET['acf_type'] == 'file')
|
232 |
{
|
233 |
+
$access = true;
|
234 |
+
if( isset($_GET['tab']) ) $tab = $_GET['tab'];
|
235 |
|
236 |
+
if( isset($_POST["attachments"]) )
|
237 |
+
{
|
238 |
+
echo '<div class="updated"><p>' . __("Media attachment updated.") . '</p></div>';
|
239 |
+
}
|
240 |
+
|
241 |
+
}
|
242 |
+
|
243 |
+
|
244 |
+
if( $access )
|
245 |
+
{
|
246 |
+
|
247 |
?><style type="text/css">
|
248 |
#media-upload-header #sidemenu li#tab-type_url,
|
249 |
+
#media-upload-header #sidemenu li#tab-gallery,
|
250 |
+
#media-items .media-item a.toggle,
|
251 |
+
#media-items .media-item tr.image-size,
|
252 |
+
#media-items .media-item tr.align,
|
253 |
+
#media-items .media-item tr.url,
|
254 |
+
#media-items .media-item .slidetoggle {
|
255 |
display: none !important;
|
256 |
}
|
257 |
|
272 |
|
273 |
#media-items .media-item .filename.new {
|
274 |
min-height: 0;
|
275 |
+
padding: 20px 10px 10px 10px;
|
276 |
+
line-height: 15px;
|
|
|
277 |
}
|
278 |
|
279 |
#media-items .media-item .title {
|
280 |
line-height: 14px;
|
281 |
}
|
282 |
|
283 |
+
#media-items .media-item .acf-select {
|
284 |
float: right;
|
285 |
+
margin: 22px 12px 0 10px;
|
286 |
}
|
287 |
|
288 |
#media-upload .ml-submit {
|
302 |
margin: 0 10px 0 0;
|
303 |
}
|
304 |
|
305 |
+
|
306 |
</style>
|
307 |
<script type="text/javascript">
|
308 |
(function($){
|
313 |
* @created : 29/03/2012
|
314 |
*/
|
315 |
|
316 |
+
$('#media-items .media-item a.acf-select').live('click', function(){
|
317 |
|
318 |
var id = $(this).attr('href');
|
319 |
|
426 |
});
|
427 |
|
428 |
|
429 |
+
// edit toggle
|
430 |
+
$('#media-items .media-item a.acf-toggle-edit').live('click', function(){
|
431 |
+
|
432 |
+
if( $(this).hasClass('active') )
|
433 |
+
{
|
434 |
+
$(this).removeClass('active');
|
435 |
+
$(this).closest('.media-item').find('.slidetoggle').attr('style', 'display: none !important');
|
436 |
+
return false;
|
437 |
+
}
|
438 |
+
else
|
439 |
+
{
|
440 |
+
$(this).addClass('active');
|
441 |
+
$(this).closest('.media-item').find('.slidetoggle').attr('style', 'display: table !important');
|
442 |
+
return false;
|
443 |
+
}
|
444 |
+
|
445 |
+
});
|
446 |
+
|
447 |
|
448 |
// set a interval function to add buttons to media items
|
449 |
function acf_add_buttons()
|
480 |
$(this).prepend('<input type="checkbox" class="acf-checkbox" value="' + id + '" <?php if($tab == "type"){echo 'checked="checked"';} ?> />');
|
481 |
}
|
482 |
|
483 |
+
|
484 |
+
// Add edit button
|
485 |
+
$(this).find('.filename.new').append('<br /><a href="#" class="acf-toggle-edit">Edit</a>');
|
486 |
+
|
487 |
+
// Add select button
|
488 |
+
$(this).find('.filename.new').before('<a href="' + id + '" class="button acf-select"><?php _e("Select File",'acf'); ?></a>');
|
489 |
+
|
490 |
+
// add save changes button
|
491 |
+
$(this).find('tr.submit input.button').hide().before('<input type="submit" value="<?php _e("Update File",'acf'); ?>" class="button savebutton" />');
|
492 |
|
493 |
});
|
494 |
}
|
510 |
}, 1);
|
511 |
|
512 |
|
513 |
+
$('form#filter').each(function(){
|
514 |
|
515 |
$(this).append('<input type="hidden" name="acf_type" value="file" />');
|
516 |
+
|
517 |
+
});
|
518 |
+
|
519 |
+
$('form#image-form, form#library-form').each(function(){
|
520 |
+
|
521 |
+
var action = $(this).attr('action');
|
522 |
+
action += "&acf_type=file";
|
523 |
+
$(this).attr('action', action);
|
524 |
|
525 |
});
|
526 |
});
|
core/fields/flexible_content.php
CHANGED
@@ -65,43 +65,59 @@ class acf_Flexible_content extends acf_Field
|
|
65 |
<table class="widefat">
|
66 |
|
67 |
<tbody>
|
68 |
-
<tr
|
69 |
-
<?php if($layout['display'] == 'row'): ?><td><?php endif; ?>
|
70 |
|
71 |
-
|
|
|
|
|
72 |
|
73 |
-
|
|
|
74 |
|
75 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
|
79 |
if(!isset($sub_field['instructions']))
|
80 |
$sub_field['instructions'] = "";
|
81 |
|
82 |
echo $sub_field['instructions'];
|
83 |
|
84 |
-
|
85 |
-
</p>
|
86 |
|
87 |
-
<input type="hidden" name="<?php echo $field['name'] ?>[999][acf_fc_layout]" value="<?php echo $layout['name']; ?>" />
|
88 |
<?php
|
|
|
89 |
// add value
|
90 |
-
$sub_field['value'] = isset($sub_field['default_value']) ? $sub_field['default_value'] :
|
91 |
|
92 |
// add name
|
93 |
$sub_field['name'] = $field['name'] . '[999][' . $sub_field['key'] . ']';
|
94 |
|
95 |
// create field
|
96 |
$this->parent->create_field($sub_field);
|
97 |
-
?>
|
98 |
|
99 |
-
<?php if($layout['display'] == 'table'): ?></td><?php endif; ?>
|
100 |
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
-
|
104 |
-
</tr>
|
105 |
</tbody>
|
106 |
|
107 |
</table>
|
@@ -626,7 +642,7 @@ class acf_Flexible_content extends acf_Field
|
|
626 |
}
|
627 |
|
628 |
|
629 |
-
if($layout_order)
|
630 |
{
|
631 |
$i = -1;
|
632 |
// loop through rows
|
@@ -652,7 +668,11 @@ class acf_Flexible_content extends acf_Field
|
|
652 |
}
|
653 |
}
|
654 |
}
|
655 |
-
|
|
|
|
|
|
|
|
|
656 |
return $values;
|
657 |
}
|
658 |
|
65 |
<table class="widefat">
|
66 |
|
67 |
<tbody>
|
68 |
+
<tr><?php
|
|
|
69 |
|
70 |
+
if($layout['display'] == 'row'):
|
71 |
+
?><td><?php
|
72 |
+
endif;
|
73 |
|
74 |
+
$l = 0;
|
75 |
+
foreach($layout['sub_fields'] as $sub_field):
|
76 |
|
77 |
+
$l++;
|
78 |
+
|
79 |
+
if($layout['display'] == 'table'):
|
80 |
+
?><td style="width:<?php echo 100/count($layout['sub_fields']); ?>%;"><?php
|
81 |
+
else:
|
82 |
+
?><div class="row-layout-field"><?php
|
83 |
+
endif;
|
84 |
+
|
85 |
+
?><p class="label">
|
86 |
+
<label><?php echo $sub_field['label']; ?></label><?php
|
87 |
|
88 |
if(!isset($sub_field['instructions']))
|
89 |
$sub_field['instructions'] = "";
|
90 |
|
91 |
echo $sub_field['instructions'];
|
92 |
|
93 |
+
?></p>
|
|
|
94 |
|
95 |
+
<input type="hidden" name="<?php echo $field['name']; ?>[999][acf_fc_layout]" value="<?php echo $layout['name']; ?>" />
|
96 |
<?php
|
97 |
+
|
98 |
// add value
|
99 |
+
$sub_field['value'] = isset($sub_field['default_value']) ? $sub_field['default_value'] : false;
|
100 |
|
101 |
// add name
|
102 |
$sub_field['name'] = $field['name'] . '[999][' . $sub_field['key'] . ']';
|
103 |
|
104 |
// create field
|
105 |
$this->parent->create_field($sub_field);
|
|
|
106 |
|
|
|
107 |
|
108 |
+
if($layout['display'] == 'table'):
|
109 |
+
?></td><?php
|
110 |
+
else:
|
111 |
+
?></div><?php
|
112 |
+
endif;
|
113 |
+
|
114 |
+
endforeach;
|
115 |
+
|
116 |
+
if($layout['display'] == 'row'):
|
117 |
+
?></td><?php
|
118 |
+
endif;
|
119 |
|
120 |
+
?></tr>
|
|
|
121 |
</tbody>
|
122 |
|
123 |
</table>
|
642 |
}
|
643 |
|
644 |
|
645 |
+
if( !empty( $layout_order) )
|
646 |
{
|
647 |
$i = -1;
|
648 |
// loop through rows
|
668 |
}
|
669 |
}
|
670 |
}
|
671 |
+
else
|
672 |
+
{
|
673 |
+
$values = false;
|
674 |
+
}
|
675 |
+
|
676 |
return $values;
|
677 |
}
|
678 |
|
core/fields/image.php
CHANGED
@@ -226,17 +226,40 @@ class acf_Image extends acf_Field
|
|
226 |
*
|
227 |
---------------------------------------------------------------------------------------------*/
|
228 |
function popup_head()
|
229 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
if(isset($_GET["acf_type"]) && $_GET['acf_type'] == 'image')
|
231 |
{
|
232 |
-
$
|
233 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
|
235 |
?><style type="text/css">
|
236 |
#media-upload-header #sidemenu li#tab-type_url,
|
237 |
-
#media-upload-header #sidemenu li#tab-gallery,
|
238 |
-
#media-items .media-item
|
239 |
-
#media-items .media-item
|
|
|
|
|
|
|
240 |
display: none !important;
|
241 |
}
|
242 |
|
@@ -257,18 +280,17 @@ class acf_Image extends acf_Field
|
|
257 |
|
258 |
#media-items .media-item .filename.new {
|
259 |
min-height: 0;
|
260 |
-
padding:
|
261 |
-
line-height:
|
262 |
-
|
263 |
}
|
264 |
|
265 |
#media-items .media-item .title {
|
266 |
line-height: 14px;
|
267 |
}
|
268 |
|
269 |
-
#media-items .media-item .
|
270 |
float: right;
|
271 |
-
margin:
|
272 |
}
|
273 |
|
274 |
#media-upload .ml-submit {
|
@@ -299,39 +321,6 @@ class acf_Image extends acf_Field
|
|
299 |
// generate the preview size (150x150)
|
300 |
var preview_size = "<?php echo get_option($preview_size . '_size_w'); ?>x<?php echo get_option($preview_size . '_size_h'); ?>";
|
301 |
|
302 |
-
|
303 |
-
|
304 |
-
/*
|
305 |
-
* get_preview_image
|
306 |
-
*
|
307 |
-
* @created : 6/04/2012
|
308 |
-
|
309 |
-
function get_preview_image(options, callback)
|
310 |
-
{
|
311 |
-
// defaults
|
312 |
-
var defaults = {
|
313 |
-
id : [],
|
314 |
-
preview_size : "thumbnail",
|
315 |
-
};
|
316 |
-
|
317 |
-
|
318 |
-
// override deafault with options
|
319 |
-
$.extend(defaults, options);
|
320 |
-
|
321 |
-
|
322 |
-
// run ajax to get id urls
|
323 |
-
$.ajax({
|
324 |
-
url : ajaxurl
|
325 |
-
data : options,
|
326 |
-
dataType : "json",
|
327 |
-
type : "POST",
|
328 |
-
|
329 |
-
|
330 |
-
});
|
331 |
-
|
332 |
-
|
333 |
-
}
|
334 |
-
*/
|
335 |
|
336 |
/*
|
337 |
* Select Image
|
@@ -339,7 +328,7 @@ class acf_Image extends acf_Field
|
|
339 |
* @created : 28/03/2012
|
340 |
*/
|
341 |
|
342 |
-
$('#media-items .media-item
|
343 |
|
344 |
var id = $(this).attr('href');
|
345 |
|
@@ -465,6 +454,25 @@ class acf_Image extends acf_Field
|
|
465 |
});
|
466 |
|
467 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
468 |
// set a interval function to add buttons to media items
|
469 |
function acf_add_buttons()
|
470 |
{
|
@@ -500,8 +508,15 @@ class acf_Image extends acf_Field
|
|
500 |
$(this).prepend('<input type="checkbox" class="acf-checkbox" value="' + id + '" <?php if($tab == "type"){echo 'checked="checked"';} ?> />');
|
501 |
}
|
502 |
|
503 |
-
//
|
504 |
-
$(this).find('.filename.new').append('<a href="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
505 |
|
506 |
});
|
507 |
}
|
@@ -523,10 +538,18 @@ class acf_Image extends acf_Field
|
|
523 |
}, 1);
|
524 |
|
525 |
|
526 |
-
$('form#filter
|
527 |
|
528 |
$(this).append('<input type="hidden" name="acf_preview_size" value="<?php echo $preview_size; ?>" />');
|
529 |
$(this).append('<input type="hidden" name="acf_type" value="image" />');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
530 |
|
531 |
});
|
532 |
});
|
226 |
*
|
227 |
---------------------------------------------------------------------------------------------*/
|
228 |
function popup_head()
|
229 |
+
{
|
230 |
+
|
231 |
+
// defults
|
232 |
+
$access = false;
|
233 |
+
$tab = "type";
|
234 |
+
$preview_size = "thumbnail";
|
235 |
+
|
236 |
+
|
237 |
+
// GET
|
238 |
if(isset($_GET["acf_type"]) && $_GET['acf_type'] == 'image')
|
239 |
{
|
240 |
+
$access = true;
|
241 |
+
if( isset($_GET['tab']) ) $tab = $_GET['tab'];
|
242 |
+
if( isset($_GET['acf_preview_size']) ) $preview_size = $_GET['acf_preview_size'];
|
243 |
+
|
244 |
+
if( isset($_POST["attachments"]) )
|
245 |
+
{
|
246 |
+
echo '<div class="updated"><p>' . __("Media attachment updated.") . '</p></div>';
|
247 |
+
}
|
248 |
+
|
249 |
+
}
|
250 |
+
|
251 |
+
|
252 |
+
if( $access )
|
253 |
+
{
|
254 |
|
255 |
?><style type="text/css">
|
256 |
#media-upload-header #sidemenu li#tab-type_url,
|
257 |
+
#media-upload-header #sidemenu li#tab-gallery,
|
258 |
+
#media-items .media-item a.toggle,
|
259 |
+
#media-items .media-item tr.image-size,
|
260 |
+
#media-items .media-item tr.align,
|
261 |
+
#media-items .media-item tr.url,
|
262 |
+
#media-items .media-item .slidetoggle {
|
263 |
display: none !important;
|
264 |
}
|
265 |
|
280 |
|
281 |
#media-items .media-item .filename.new {
|
282 |
min-height: 0;
|
283 |
+
padding: 20px 10px 10px 10px;
|
284 |
+
line-height: 15px;
|
|
|
285 |
}
|
286 |
|
287 |
#media-items .media-item .title {
|
288 |
line-height: 14px;
|
289 |
}
|
290 |
|
291 |
+
#media-items .media-item .acf-select {
|
292 |
float: right;
|
293 |
+
margin: 22px 12px 0 10px;
|
294 |
}
|
295 |
|
296 |
#media-upload .ml-submit {
|
321 |
// generate the preview size (150x150)
|
322 |
var preview_size = "<?php echo get_option($preview_size . '_size_w'); ?>x<?php echo get_option($preview_size . '_size_h'); ?>";
|
323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
|
325 |
/*
|
326 |
* Select Image
|
328 |
* @created : 28/03/2012
|
329 |
*/
|
330 |
|
331 |
+
$('#media-items .media-item a.acf-select').live('click', function(){
|
332 |
|
333 |
var id = $(this).attr('href');
|
334 |
|
454 |
});
|
455 |
|
456 |
|
457 |
+
// edit toggle
|
458 |
+
$('#media-items .media-item a.acf-toggle-edit').live('click', function(){
|
459 |
+
|
460 |
+
if( $(this).hasClass('active') )
|
461 |
+
{
|
462 |
+
$(this).removeClass('active');
|
463 |
+
$(this).closest('.media-item').find('.slidetoggle').attr('style', 'display: none !important');
|
464 |
+
return false;
|
465 |
+
}
|
466 |
+
else
|
467 |
+
{
|
468 |
+
$(this).addClass('active');
|
469 |
+
$(this).closest('.media-item').find('.slidetoggle').attr('style', 'display: table !important');
|
470 |
+
return false;
|
471 |
+
}
|
472 |
+
|
473 |
+
});
|
474 |
+
|
475 |
+
|
476 |
// set a interval function to add buttons to media items
|
477 |
function acf_add_buttons()
|
478 |
{
|
508 |
$(this).prepend('<input type="checkbox" class="acf-checkbox" value="' + id + '" <?php if($tab == "type"){echo 'checked="checked"';} ?> />');
|
509 |
}
|
510 |
|
511 |
+
// Add edit button
|
512 |
+
$(this).find('.filename.new').append('<br /><a href="#" class="acf-toggle-edit">Edit</a>');
|
513 |
+
|
514 |
+
// Add select button
|
515 |
+
$(this).find('.filename.new').before('<a href="' + id + '" class="button acf-select"><?php _e("Select Image",'acf'); ?></a>');
|
516 |
+
|
517 |
+
// add save changes button
|
518 |
+
$(this).find('tr.submit input.button').hide().before('<input type="submit" value="<?php _e("Update Image",'acf'); ?>" class="button savebutton" />');
|
519 |
+
|
520 |
|
521 |
});
|
522 |
}
|
538 |
}, 1);
|
539 |
|
540 |
|
541 |
+
$('form#filter').each(function(){
|
542 |
|
543 |
$(this).append('<input type="hidden" name="acf_preview_size" value="<?php echo $preview_size; ?>" />');
|
544 |
$(this).append('<input type="hidden" name="acf_type" value="image" />');
|
545 |
+
|
546 |
+
});
|
547 |
+
|
548 |
+
$('form#image-form, form#library-form').each(function(){
|
549 |
+
|
550 |
+
var action = $(this).attr('action');
|
551 |
+
action += "&acf_type=image&acf_preview_size=<?php echo $preview_size; ?>";
|
552 |
+
$(this).attr('action', action);
|
553 |
|
554 |
});
|
555 |
});
|
core/fields/repeater.php
CHANGED
@@ -65,6 +65,11 @@ class acf_Repeater extends acf_Field
|
|
65 |
|
66 |
|
67 |
// add clone field
|
|
|
|
|
|
|
|
|
|
|
68 |
if($row_limit == 1 && count($field['value']) == 0)
|
69 |
{
|
70 |
$field['value'][] = array();
|
@@ -74,7 +79,7 @@ class acf_Repeater extends acf_Field
|
|
74 |
$field['value'][999] = array();
|
75 |
foreach($sub_fields as $sub_field)
|
76 |
{
|
77 |
-
$sub_value = isset($sub_field['default_value']) ? $sub_field['default_value'] :
|
78 |
$field['value'][999][$sub_field['name']] = $sub_value;
|
79 |
}
|
80 |
|
65 |
|
66 |
|
67 |
// add clone field
|
68 |
+
if( !$field['value'] )
|
69 |
+
{
|
70 |
+
$field['value'] = array();
|
71 |
+
}
|
72 |
+
|
73 |
if($row_limit == 1 && count($field['value']) == 0)
|
74 |
{
|
75 |
$field['value'][] = array();
|
79 |
$field['value'][999] = array();
|
80 |
foreach($sub_fields as $sub_field)
|
81 |
{
|
82 |
+
$sub_value = isset($sub_field['default_value']) ? $sub_field['default_value'] : false;
|
83 |
$field['value'][999][$sub_field['name']] = $sub_value;
|
84 |
}
|
85 |
|
core/fields/wysiwyg.php
CHANGED
@@ -20,48 +20,11 @@ class acf_Wysiwyg extends acf_Field
|
|
20 |
$this->name = 'wysiwyg';
|
21 |
$this->title = __("Wysiwyg Editor",'acf');
|
22 |
|
23 |
-
|
24 |
-
|
25 |
|
26 |
}
|
27 |
|
28 |
-
|
29 |
-
/*--------------------------------------------------------------------------------------
|
30 |
-
*
|
31 |
-
* admin_print_scripts / admin_print_styles
|
32 |
-
*
|
33 |
-
* @author Elliot Condon
|
34 |
-
* @since 3.0.0
|
35 |
-
*
|
36 |
-
*-------------------------------------------------------------------------------------*/
|
37 |
-
|
38 |
-
function admin_print_scripts()
|
39 |
-
{
|
40 |
-
wp_enqueue_script(array(
|
41 |
-
|
42 |
-
'jquery',
|
43 |
-
'jquery-ui-core',
|
44 |
-
'jquery-ui-tabs',
|
45 |
-
|
46 |
-
// wysiwyg
|
47 |
-
'editor',
|
48 |
-
'thickbox',
|
49 |
-
'media-upload',
|
50 |
-
'word-count',
|
51 |
-
'post',
|
52 |
-
'editor-functions',
|
53 |
-
'tiny_mce',
|
54 |
-
|
55 |
-
));
|
56 |
-
}
|
57 |
-
|
58 |
-
function admin_print_styles()
|
59 |
-
{
|
60 |
-
wp_enqueue_style(array(
|
61 |
-
'editor-buttons',
|
62 |
-
'thickbox',
|
63 |
-
));
|
64 |
-
}
|
65 |
|
66 |
|
67 |
/*--------------------------------------------------------------------------------------
|
@@ -76,19 +39,17 @@ class acf_Wysiwyg extends acf_Field
|
|
76 |
|
77 |
function acf_head()
|
78 |
{
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
_WP_Editors::editor_settings($editor_id, $set);
|
91 |
-
|
92 |
}
|
93 |
|
94 |
|
20 |
$this->name = 'wysiwyg';
|
21 |
$this->title = __("Wysiwyg Editor",'acf');
|
22 |
|
23 |
+
add_action( 'acf_head-input', array( $this, 'acf_head') );
|
24 |
+
add_action( 'wp_default_editor', array($this, 'my_default_editor') );
|
25 |
|
26 |
}
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
|
30 |
/*--------------------------------------------------------------------------------------
|
39 |
|
40 |
function acf_head()
|
41 |
{
|
42 |
+
add_action( 'admin_footer', array( $this, 'admin_footer') );
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
function admin_footer()
|
47 |
+
{
|
48 |
+
?>
|
49 |
+
<div style="display:none;">
|
50 |
+
<?php the_editor( '', 'acf_settings' ); ?>
|
51 |
+
</div>
|
52 |
+
<?php
|
|
|
|
|
53 |
}
|
54 |
|
55 |
|
core/options_page.php
CHANGED
@@ -170,7 +170,7 @@ class Options_page
|
|
170 |
// Style
|
171 |
echo '<link rel="stylesheet" type="text/css" href="'.$this->parent->dir.'/css/global.css?ver=' . $this->parent->version . '" />';
|
172 |
echo '<link rel="stylesheet" type="text/css" href="'.$this->parent->dir.'/css/input.css?ver=' . $this->parent->version . '" />';
|
173 |
-
|
174 |
|
175 |
// Javascript
|
176 |
echo '<script type="text/javascript" src="'.$this->parent->dir.'/js/input-actions.js?ver=' . $this->parent->version . '" ></script>';
|
170 |
// Style
|
171 |
echo '<link rel="stylesheet" type="text/css" href="'.$this->parent->dir.'/css/global.css?ver=' . $this->parent->version . '" />';
|
172 |
echo '<link rel="stylesheet" type="text/css" href="'.$this->parent->dir.'/css/input.css?ver=' . $this->parent->version . '" />';
|
173 |
+
echo '<style type="text/css">#side-sortables.empty-container { border: 0 none; }</style>';
|
174 |
|
175 |
// Javascript
|
176 |
echo '<script type="text/javascript" src="'.$this->parent->dir.'/js/input-actions.js?ver=' . $this->parent->version . '" ></script>';
|
css/input.css
CHANGED
@@ -729,6 +729,14 @@ ul.checkbox_list {
|
|
729 |
border-radius: 3px;
|
730 |
}
|
731 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
732 |
.acf-popup {
|
733 |
position: absolute;
|
734 |
bottom: 25px;
|
729 |
border-radius: 3px;
|
730 |
}
|
731 |
|
732 |
+
.acf_flexible_content td .row-layout-field {
|
733 |
+
padding: 30px 0 0;
|
734 |
+
}
|
735 |
+
|
736 |
+
.acf_flexible_content td .row-layout-field:first-child {
|
737 |
+
padding-top: 3px;
|
738 |
+
}
|
739 |
+
|
740 |
.acf-popup {
|
741 |
position: absolute;
|
742 |
bottom: 25px;
|
js/input-actions.js
CHANGED
@@ -352,6 +352,7 @@ var acf = {
|
|
352 |
|
353 |
$(this).find('.relationship_right .relationship_list').sortable({
|
354 |
axis: "y", // limit the dragging to up/down only
|
|
|
355 |
start: function(event, ui)
|
356 |
{
|
357 |
ui.item.addClass('sortable_active');
|
352 |
|
353 |
$(this).find('.relationship_right .relationship_list').sortable({
|
354 |
axis: "y", // limit the dragging to up/down only
|
355 |
+
items: 'a:not(.hide)',
|
356 |
start: function(event, ui)
|
357 |
{
|
358 |
ui.item.addClass('sortable_active');
|
js/input-ajax.js
CHANGED
@@ -163,20 +163,7 @@
|
|
163 |
update_fields();
|
164 |
|
165 |
});
|
166 |
-
|
167 |
-
$('#taxonomy-category input[type="checkbox"]').live('change', function(){
|
168 |
-
|
169 |
-
acf.data.post_category = ['0'];
|
170 |
-
|
171 |
-
$('#categorychecklist :checked').each(function(){
|
172 |
-
acf.data.post_category.push($(this).val())
|
173 |
-
});
|
174 |
-
|
175 |
-
//console.log(data.post_category);
|
176 |
-
update_fields();
|
177 |
-
|
178 |
-
});
|
179 |
-
|
180 |
|
181 |
$('#post-formats-select input[type="radio"]').live('change', function(){
|
182 |
|
@@ -185,17 +172,31 @@
|
|
185 |
|
186 |
});
|
187 |
|
188 |
-
|
189 |
-
|
|
|
|
|
190 |
|
191 |
-
//
|
192 |
-
|
|
|
193 |
|
194 |
-
acf.data.taxonomy = ['0'];
|
195 |
|
|
|
196 |
$(this).closest('ul').find('input[type="checkbox"]:checked').each(function(){
|
197 |
-
|
198 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
|
200 |
update_fields();
|
201 |
|
163 |
update_fields();
|
164 |
|
165 |
});
|
166 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
|
168 |
$('#post-formats-select input[type="radio"]').live('change', function(){
|
169 |
|
172 |
|
173 |
});
|
174 |
|
175 |
+
|
176 |
+
// taxonomy / category
|
177 |
+
$('.categorychecklist input[type="checkbox"]').live('change', function(){
|
178 |
+
|
179 |
|
180 |
+
// vars
|
181 |
+
var category = ( $(this).closest('#categorychecklist').exists() ) ? true : false;
|
182 |
+
var values = ['0'];
|
183 |
|
|
|
184 |
|
185 |
+
// populate values
|
186 |
$(this).closest('ul').find('input[type="checkbox"]:checked').each(function(){
|
187 |
+
values.push($(this).val())
|
188 |
});
|
189 |
+
|
190 |
+
|
191 |
+
if( category )
|
192 |
+
{
|
193 |
+
acf.data.post_category = values;
|
194 |
+
}
|
195 |
+
else
|
196 |
+
{
|
197 |
+
acf.data.taxonomy = values;
|
198 |
+
}
|
199 |
+
|
200 |
|
201 |
update_fields();
|
202 |
|
readme.txt
CHANGED
@@ -85,6 +85,20 @@ http://www.advancedcustomfields.com/support/
|
|
85 |
|
86 |
== Changelog ==
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
= 3.2.4 =
|
89 |
* [Fixed] Remove translation from validation class - http://www.advancedcustomfields.com/support/discussion/2110/custom-validation-broken-in-other-languages
|
90 |
* [Fixed] Test fix WYSIWYG insert media issues
|
85 |
|
86 |
== Changelog ==
|
87 |
|
88 |
+
= 3.2.5 =
|
89 |
+
* [IMPORTANT] Change field group option "Show on page" to "Hide on Screen" to allow for future proof adding new elements to list. Previously exported and registered field groups via PHP will still work as expected! This change will prompt you for a database upgrade.
|
90 |
+
* [Added] Add in edit button to upload image / file thickbox
|
91 |
+
* [Improved] Changed loading default values. Now behaves as expected!
|
92 |
+
* [Fixed] Test / Fix full screen mode dissapearing from editor - http://www.advancedcustomfields.com/support/discussion/2124/full-screen-button-for-zen-mode-is-gone
|
93 |
+
* [Fixed] get_field returning false for 0 - http://advancedcustomfields.com/support/discussion/2115/get_field-returns-false-if-field-has-value-0
|
94 |
+
* [Improved] Improve relationship sortable code with item param - http://www.advancedcustomfields.com/support/discussion/comment/3536#Comment_3536
|
95 |
+
* [Fixed] IE category js bug - http://www.advancedcustomfields.com/support/discussion/2127/ie-78-category-checkbox-bug
|
96 |
+
* [Fixed] Flexible content field row css bug - http://www.advancedcustomfields.com/support/discussion/2126/space-between-fields-is-a-little-tight-in-3.2.33.2.4
|
97 |
+
* [Fixed] Repeater row limit in flexible field bug - http://www.advancedcustomfields.com/support/discussion/1635/repeater-with-row-limit-of-1-inside-flexible-field-no-rows-show
|
98 |
+
* [Fixed] Fix update message - appears on first activation
|
99 |
+
* [Fixed] Fix options page sidebar drag area - no border needed
|
100 |
+
* [Fixed] Fix export options page activation - http://www.advancedcustomfields.com/support/discussion/2112/options-page-not-working-in-functions.php
|
101 |
+
|
102 |
= 3.2.4 =
|
103 |
* [Fixed] Remove translation from validation class - http://www.advancedcustomfields.com/support/discussion/2110/custom-validation-broken-in-other-languages
|
104 |
* [Fixed] Test fix WYSIWYG insert media issues
|