Advanced Custom Fields - Version 3.5.1

Version Description

  • [Added] Add Conditional logic for fields (toggle fields are select, checkbox, radio and true / false)
  • [Added] More hooks + filters - acf_options_page_title, acf_load_field, acf_update_value - http://support.advancedcustomfields.com/discussion/3454/more-hooks-filters-ability-for-inheritance
  • [Removed] Remove public param from post types list - http://support.advancedcustomfields.com/discussion/3251/fields-on-a-non-public-post-type
  • [Added] Add field group headings into the acf_form function
  • [Updated] Update button design to match WP 3.5
  • [Fixed] Test / Fix XML export issue - http://support.advancedcustomfields.com/discussion/3415/can039t-export-xml-since-upgrade-to-3-5-0
  • [Added] Add more options to the "hide on screen" - http://support.advancedcustomfields.com/discussion/3418/screen-options
  • [Added] Add compatibility for Tabify plugin - http://wordpress.org/support/topic/plugin-tabify-edit-screen-compatibility-with-other-custom-fields-plugins/page/2?replies=36#post-3238051
  • [Added] Add compatibility for Duplicate Post plugin
  • [Added] Add new params to acf_form function - http://support.advancedcustomfields.com/discussion/3445/issue-with-the-acf_form-array
  • [Updated] Increase date picker range to 100
  • [Fixed] WYSIWYG looses formatting when it's row gets reordered (in a repeater / flexible content field)
  • [Fixed] Fix has_sub_field break issue - http://support.advancedcustomfields.com/discussion/3528/ability-to-reset-has_sub_field
  • [Fixed] Fix Textarea / Text encoding bugs - http://support.advancedcustomfields.com/discussion/comment/5147#Comment_5147
  • [Added] Add publish status for field groups - http://support.advancedcustomfields.com/discussion/3695/draft-status-for-field-groups
  • [Updated] General tidy up & improvement of HTML / CSS / Javascript
Download this release

Release Info

Developer elliotcondon
Plugin Icon 128x128 Advanced Custom Fields
Version 3.5.1
Comparing to
See all releases

Code changes from version 3.5.0 to 3.5.1

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, repeater, flexible content, gallery and more!
6
- Version: 3.5.0
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  License: GPL
@@ -30,7 +30,8 @@ class Acf
30
  $field_group,
31
  $input,
32
  $options_page,
33
- $everything_fields;
 
34
 
35
 
36
  /*
@@ -47,7 +48,7 @@ class Acf
47
  // vars
48
  $this->path = plugin_dir_path(__FILE__);
49
  $this->dir = plugins_url('',__FILE__);
50
- $this->version = '3.5.0';
51
  $this->upgrade_version = '3.4.1'; // this is the latest version which requires an upgrade
52
  $this->cache = array(); // basic array cache to hold data throughout the page load
53
 
@@ -69,6 +70,7 @@ class Acf
69
  add_action('admin_head', array($this,'admin_head'));
70
  add_action('acf_save_post', array($this, 'acf_save_post'), 10); // save post, called from many places (api, input, everything, options)
71
 
 
72
 
73
  // ajax
74
  add_action('wp_ajax_get_input_metabox_ids', array($this, 'get_input_metabox_ids'));
@@ -269,6 +271,11 @@ class Acf
269
  // everthing fields
270
  include_once('core/controllers/everything_fields.php');
271
  $this->everything_fields = new acf_everything_fields($this);
 
 
 
 
 
272
  }
273
 
274
 
@@ -531,6 +538,8 @@ class Acf
531
 
532
  function get_acf_field( $field_key, $post_id = false )
533
  {
 
 
534
  // return cache
535
  $cache = $this->get_cache('acf_field_' . $field_key);
536
  if($cache != false)
@@ -554,6 +563,7 @@ class Acf
554
  $row = $wpdb->get_results( $sql, ARRAY_A );
555
 
556
 
 
557
  if( $row )
558
  {
559
  $row = $row[0];
@@ -565,11 +575,18 @@ class Acf
565
  $row['meta_value'] = maybe_unserialize( $row['meta_value'] );
566
  $row['meta_value'] = maybe_unserialize( $row['meta_value'] ); // run again for WPML
567
 
 
 
 
 
 
 
 
568
 
569
  // set cache
570
- $this->set_cache('acf_field_' . $field_key, $row['meta_value']);
571
 
572
- return $row['meta_value'];
573
  }
574
  }
575
 
@@ -577,6 +594,7 @@ class Acf
577
 
578
  // hook to load in registered field groups
579
  $acfs = apply_filters('acf_register_field_group', array());
 
580
  if($acfs)
581
  {
582
  // loop through acfs
@@ -589,9 +607,14 @@ class Acf
589
  {
590
  if($field['key'] == $field_key)
591
  {
 
 
 
 
 
592
  // set cache
593
  $this->set_cache('acf_field_' . $field_key, $field);
594
-
595
  return $field;
596
  }
597
  }
@@ -607,6 +630,36 @@ class Acf
607
  }
608
 
609
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
610
  /*--------------------------------------------------------------------------------------
611
  *
612
  * create_field
@@ -618,6 +671,7 @@ class Acf
618
 
619
  function create_field($field)
620
  {
 
621
  if(!isset($this->fields[$field['type']]) || !is_object($this->fields[$field['type']]))
622
  {
623
  _e('Error: Field Type does not exist!','acf');
@@ -625,14 +679,85 @@ class Acf
625
  }
626
 
627
 
628
- // defaults
629
  if( !isset($field['class']) )
630
  {
631
  $field['class'] = $field['type'];
632
  }
633
 
634
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
635
  $this->fields[ $field['type'] ]->create_field($field);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
636
  }
637
 
638
 
@@ -870,29 +995,12 @@ class Acf
870
 
871
  function render_fields_for_input($fields, $post_id)
872
  {
873
- // vars
874
- $defaults = array(
875
- 'key' => '',
876
- 'label' => '',
877
- 'name' => '',
878
- 'type' => '',
879
- 'instructions' => '',
880
- 'required' => '0',
881
- 'order_no' => '0',
882
- 'value' => '',
883
- );
884
-
885
 
886
  // create fields
887
  if($fields)
888
  {
889
  foreach($fields as $field)
890
  {
891
- // give defaults
892
-
893
- $field = array_merge($defaults, $field);
894
-
895
-
896
  // if they didn't select a type, skip this field
897
  if(!$field['type'] || $field['type'] == 'null') continue;
898
 
@@ -909,7 +1017,7 @@ class Acf
909
  $required_label = ' <span class="required">*</span>';
910
  }
911
 
912
- echo '<div id="acf-' . $field['name'] . '" class="field field-' . $field['type'] . $required_class . '">';
913
 
914
  echo '<p class="label">';
915
  echo '<label for="fields[' . $field['key'] . ']">' . $field['label'] . $required_label . '</label>';
@@ -1345,14 +1453,24 @@ class Acf
1345
  return false;
1346
  }
1347
 
 
1348
  // value has changed in 3.2.6 to a sanitized string
1349
- if( strpos( $rule['value'] ,'options-') === false )
 
 
 
 
 
 
 
1350
  {
1351
- $rule['value'] = 'options-' . sanitize_title( $rule['value'] );
1352
  }
1353
 
 
1354
  // generate the page title to match against
1355
- $page_title = 'options-' . sanitize_title( get_admin_page_title() );
 
1356
 
1357
  if($rule['operator'] == "==")
1358
  {
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, repeater, flexible content, gallery and more!
6
+ Version: 3.5.1
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  License: GPL
30
  $field_group,
31
  $input,
32
  $options_page,
33
+ $everything_fields,
34
+ $third_party;
35
 
36
 
37
  /*
48
  // vars
49
  $this->path = plugin_dir_path(__FILE__);
50
  $this->dir = plugins_url('',__FILE__);
51
+ $this->version = '3.5.1';
52
  $this->upgrade_version = '3.4.1'; // this is the latest version which requires an upgrade
53
  $this->cache = array(); // basic array cache to hold data throughout the page load
54
 
70
  add_action('admin_head', array($this,'admin_head'));
71
  add_action('acf_save_post', array($this, 'acf_save_post'), 10); // save post, called from many places (api, input, everything, options)
72
 
73
+ add_filter('acf_load_field', array($this, 'acf_load_field_defaults'), 5);
74
 
75
  // ajax
76
  add_action('wp_ajax_get_input_metabox_ids', array($this, 'get_input_metabox_ids'));
271
  // everthing fields
272
  include_once('core/controllers/everything_fields.php');
273
  $this->everything_fields = new acf_everything_fields($this);
274
+
275
+
276
+ // Third Party Compatibility
277
+ include_once('core/controllers/third_party.php');
278
+ $this->third_party = new acf_third_party($this);
279
  }
280
 
281
 
538
 
539
  function get_acf_field( $field_key, $post_id = false )
540
  {
541
+
542
+
543
  // return cache
544
  $cache = $this->get_cache('acf_field_' . $field_key);
545
  if($cache != false)
563
  $row = $wpdb->get_results( $sql, ARRAY_A );
564
 
565
 
566
+
567
  if( $row )
568
  {
569
  $row = $row[0];
575
  $row['meta_value'] = maybe_unserialize( $row['meta_value'] );
576
  $row['meta_value'] = maybe_unserialize( $row['meta_value'] ); // run again for WPML
577
 
578
+
579
+ // run filters
580
+ $field = $row['meta_value'];
581
+ $field = apply_filters('acf_load_field', $field);
582
+ $field = apply_filters('acf_load_field-' . $field['name'], $field);
583
+ $field = apply_filters('acf_load_field-' . $field['key'], $field);
584
+
585
 
586
  // set cache
587
+ $this->set_cache('acf_field_' . $field_key, $field);
588
 
589
+ return $field;
590
  }
591
  }
592
 
594
 
595
  // hook to load in registered field groups
596
  $acfs = apply_filters('acf_register_field_group', array());
597
+
598
  if($acfs)
599
  {
600
  // loop through acfs
607
  {
608
  if($field['key'] == $field_key)
609
  {
610
+ // run filters
611
+ $field = apply_filters('acf_load_field', $field);
612
+ $field = apply_filters('acf_load_field-' . $field['name'], $field);
613
+ $field = apply_filters('acf_load_field-' . $field['key'], $field);
614
+
615
  // set cache
616
  $this->set_cache('acf_field_' . $field_key, $field);
617
+
618
  return $field;
619
  }
620
  }
630
  }
631
 
632
 
633
+ /*
634
+ * acf_load_field_defaults
635
+ *
636
+ * @description:
637
+ * @since 3.5.1
638
+ * @created: 14/10/12
639
+ */
640
+
641
+ function acf_load_field_defaults( $field )
642
+ {
643
+ $defaults = array(
644
+ 'key' => '',
645
+ 'label' => '',
646
+ 'name' => '',
647
+ 'type' => 'text',
648
+ 'order_no' => '1',
649
+ 'instructions' => '',
650
+ 'required' => '0',
651
+ 'conditional_logic' => array(
652
+ 'status' => '0',
653
+ 'allorany' => 'all',
654
+ 'rules' => false
655
+ ),
656
+ );
657
+
658
+ $field = array_merge($defaults, $field);
659
+
660
+ return $field;
661
+ }
662
+
663
  /*--------------------------------------------------------------------------------------
664
  *
665
  * create_field
671
 
672
  function create_field($field)
673
  {
674
+
675
  if(!isset($this->fields[$field['type']]) || !is_object($this->fields[$field['type']]))
676
  {
677
  _e('Error: Field Type does not exist!','acf');
679
  }
680
 
681
 
682
+ // defaults - class
683
  if( !isset($field['class']) )
684
  {
685
  $field['class'] = $field['type'];
686
  }
687
 
688
 
689
+ // defaults - id
690
+ // - isset is needed for the edit field group page where fields are created without many parameters
691
+ if( !isset($field['id']) )
692
+ {
693
+ if( isset($field['key']) )
694
+ {
695
+ $field['id'] = 'acf-' . $field['key'];
696
+ }
697
+ else
698
+ {
699
+ $field['id'] = 'acf-' . $field['name'];
700
+ }
701
+ }
702
+
703
+
704
  $this->fields[ $field['type'] ]->create_field($field);
705
+
706
+
707
+ // conditional logic
708
+ // - isset is needed for the edit field group page where fields are created without many parameters
709
+ if( isset($field['conditional_logic']) && $field['conditional_logic']['status'] == '1' ):
710
+
711
+ $join = ' && ';
712
+ if( $field['conditional_logic']['allorany'] == "any" )
713
+ {
714
+ $join = ' || ';
715
+ }
716
+
717
+ ?>
718
+ <script type="text/javascript">
719
+ (function($){
720
+
721
+ // create the conditional function
722
+ $(document).live('acf/conditional_logic/<?php echo $field['key']; ?>', function(){
723
+
724
+ var field = $('.field-<?php echo $field['key']; ?>');
725
+ <?php
726
+
727
+ $if = array();
728
+ foreach( $field['conditional_logic']['rules'] as $rule )
729
+ {
730
+ $if[] = 'acf.conditional_logic.calculate({ field : "'. $field['key'] .'", toggle : "' . $rule['field'] . '", operator : "' . $rule['operator'] .'", value : "' . $rule['value'] . '"})' ;
731
+ }
732
+
733
+ ?>
734
+ if(<?php echo implode( $join, $if ); ?>)
735
+ {
736
+ field.show();
737
+ }
738
+ else
739
+ {
740
+ field.hide();
741
+ }
742
+
743
+ });
744
+
745
+
746
+ // add change events to all fields
747
+ <?php foreach( $field['conditional_logic']['rules'] as $rule ): ?>
748
+ $('.field-<?php echo $rule['field']; ?> *[name]').live('change', function(){
749
+ $(document).trigger('acf/conditional_logic/<?php echo $field['key']; ?>');
750
+ });
751
+ <?php endforeach; ?>
752
+
753
+ $(document).live('acf/setup_fields', function(e, postbox){
754
+ $(document).trigger('acf/conditional_logic/<?php echo $field['key']; ?>');
755
+ });
756
+
757
+ })(jQuery);
758
+ </script>
759
+ <?php
760
+ endif;
761
  }
762
 
763
 
995
 
996
  function render_fields_for_input($fields, $post_id)
997
  {
 
 
 
 
 
 
 
 
 
 
 
 
998
 
999
  // create fields
1000
  if($fields)
1001
  {
1002
  foreach($fields as $field)
1003
  {
 
 
 
 
 
1004
  // if they didn't select a type, skip this field
1005
  if(!$field['type'] || $field['type'] == 'null') continue;
1006
 
1017
  $required_label = ' <span class="required">*</span>';
1018
  }
1019
 
1020
+ echo '<div id="acf-' . $field['name'] . '" class="field field-' . $field['type'] . ' field-'.$field['key'] . $required_class . '">';
1021
 
1022
  echo '<p class="label">';
1023
  echo '<label for="fields[' . $field['key'] . ']">' . $field['label'] . $required_label . '</label>';
1453
  return false;
1454
  }
1455
 
1456
+
1457
  // value has changed in 3.2.6 to a sanitized string
1458
+ //if( substr($rule['value'], 0, 7) != 'options' )
1459
+ //{
1460
+ // $rule['value'] = 'options-' . sanitize_title( $rule['value'] );
1461
+ //}
1462
+
1463
+
1464
+ // value has changed in 3.5.1 to a acf-options-$title
1465
+ if( substr($rule['value'], 0, 12) != 'acf-options-' )
1466
  {
1467
+ $rule['value'] = 'acf-options-' . sanitize_title( $rule['value'] );
1468
  }
1469
 
1470
+
1471
  // generate the page title to match against
1472
+ $page_title = 'acf-options-' . sanitize_title( get_admin_page_title() );
1473
+
1474
 
1475
  if($rule['operator'] == "==")
1476
  {
core/actions/export.php CHANGED
@@ -10,18 +10,17 @@
10
 
11
  // vars
12
  $defaults = array(
13
- 'acf_abspath' => '../../../../..',
14
  'acf_posts' => array()
15
  );
16
- $options = array_merge( $defaults, $_POST );
17
 
18
-
19
- require_once( $options['acf_abspath'] . '/wp-load.php');
20
- require_once( $options['acf_abspath'] . '/wp-admin/admin.php');
21
 
22
 
23
  // check for posts
24
- if( !$options['acf_posts'] )
25
  {
26
  wp_die(__("No ACF groups selected",'acf'));
27
  }
@@ -183,12 +182,12 @@ echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . "\" ?>\n";
183
  <wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
184
  <wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
185
  <?php wxr_authors_list(); ?>
186
- <?php if ( $_POST['acf_posts'] ) {
187
 
188
  global $wp_query;
189
  $wp_query->in_the_loop = true; // Fake being in the loop.
190
 
191
- $where = 'WHERE ID IN (' . join( ',', $_POST['acf_posts'] ) . ')';
192
  $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
193
 
194
  // Begin Loop
10
 
11
  // vars
12
  $defaults = array(
13
+ 'acf_abspath' => '../../../../../',
14
  'acf_posts' => array()
15
  );
16
+ $my_options = array_merge( $defaults, $_POST );
17
 
18
+ require_once( $my_options['acf_abspath'] . 'wp-load.php');
19
+ require_once( $my_options['acf_abspath'] . 'wp-admin/admin.php');
 
20
 
21
 
22
  // check for posts
23
+ if( !$my_options['acf_posts'] )
24
  {
25
  wp_die(__("No ACF groups selected",'acf'));
26
  }
182
  <wp:base_site_url><?php echo wxr_site_url(); ?></wp:base_site_url>
183
  <wp:base_blog_url><?php bloginfo_rss( 'url' ); ?></wp:base_blog_url>
184
  <?php wxr_authors_list(); ?>
185
+ <?php if ( $my_options['acf_posts'] ) {
186
 
187
  global $wp_query;
188
  $wp_query->in_the_loop = true; // Fake being in the loop.
189
 
190
+ $where = 'WHERE ID IN (' . join( ',', $my_options['acf_posts'] ) . ')';
191
  $posts = $wpdb->get_results( "SELECT * FROM {$wpdb->posts} $where" );
192
 
193
  // Begin Loop
core/api.php CHANGED
@@ -255,14 +255,18 @@ function has_sub_field($field_name, $post_id = false)
255
  'post_id' => $post_id,
256
  );
257
  }
258
-
259
-
260
- // if someone used break; We should see if the parent value has this field_name as a value.
261
- if( isset($GLOBALS['acf_field'][$depth-1]) && $GLOBALS['acf_field'][$depth-1]['name'] == $field_name )
262
  {
 
263
  unset( $GLOBALS['acf_field'][$depth] );
264
  $GLOBALS['acf_field'] = array_values($GLOBALS['acf_field']);
265
  }
 
 
 
 
 
 
266
 
267
  }
268
 
@@ -457,7 +461,7 @@ function register_options_page($title = "")
457
  {
458
  $GLOBALS['acf_register_options_page'][] = array(
459
  'title' => $title,
460
- 'slug' => 'options-' . sanitize_title( $title ),
461
  );
462
  }
463
 
@@ -628,8 +632,6 @@ function acf_form($options = null)
628
  'class' => ''
629
  ),
630
  'return' => add_query_arg( 'updated', 'true', get_permalink() ), // return url
631
- 'html_field_open' => '<div class="field">', // field wrapper open
632
- 'html_field_close' => '</div>', // field wrapper close
633
  'html_before_fields' => '', // html inside form before fields
634
  'html_after_fields' => '', // html inside form after fields
635
  'submit_value' => 'Update', // vale for submit field
@@ -695,7 +697,9 @@ function acf_form($options = null)
695
 
696
  if($field_group['fields'])
697
  {
698
- echo '<div id="acf_' . $field_group['id'] . '" class="postbox acf_postbox"><div class="inside">';
 
 
699
  echo '<div class="options" data-layout="' . $field_group['options']['layout'] . '" data-show="true"></div>';
700
  $acf->render_fields_for_input($field_group['fields'], $options['post_id']);
701
  echo '</div></div>';
255
  'post_id' => $post_id,
256
  );
257
  }
258
+ elseif( isset($GLOBALS['acf_field'][$depth-1]) && $GLOBALS['acf_field'][$depth-1]['name'] == $field_name )
 
 
 
259
  {
260
+ // if someone used break; We should see if the parent value has this field_name as a value.
261
  unset( $GLOBALS['acf_field'][$depth] );
262
  $GLOBALS['acf_field'] = array_values($GLOBALS['acf_field']);
263
  }
264
+ else
265
+ {
266
+ // this was a break; (probably to get the first row only). Clear the repeater
267
+ $GLOBALS['acf_field'] = array();
268
+ return has_sub_field($field_name, $post_id);
269
+ }
270
 
271
  }
272
 
461
  {
462
  $GLOBALS['acf_register_options_page'][] = array(
463
  'title' => $title,
464
+ 'slug' => 'acf-options-' . sanitize_title( $title ),
465
  );
466
  }
467
 
632
  'class' => ''
633
  ),
634
  'return' => add_query_arg( 'updated', 'true', get_permalink() ), // return url
 
 
635
  'html_before_fields' => '', // html inside form before fields
636
  'html_after_fields' => '', // html inside form after fields
637
  'submit_value' => 'Update', // vale for submit field
697
 
698
  if($field_group['fields'])
699
  {
700
+ echo '<div id="acf_' . $field_group['id'] . '" class="postbox acf_postbox">';
701
+ echo '<h3 class="hndle"><span>' . $field_group['title'] . '</span></h3>';
702
+ echo '<div class="inside">';
703
  echo '<div class="options" data-layout="' . $field_group['options']['layout'] . '" data-show="true"></div>';
704
  $acf->render_fields_for_input($field_group['fields'], $options['post_id']);
705
  echo '</div></div>';
core/controllers/everything_fields.php CHANGED
@@ -221,8 +221,8 @@ class acf_everything_fields
221
  type: 'post',
222
  dataType: 'html',
223
  success: function(html){
224
- <?php
225
 
 
226
  if($this->data['page_type'] == "user")
227
  {
228
  if($this->data['page_action'] == "add")
@@ -256,10 +256,12 @@ class acf_everything_fields
256
  echo "$('#media-single-form table tbody tr.submit').before( html );";
257
  }
258
  }
259
-
260
- echo "setTimeout( function(){ $(document).trigger('acf/setup_fields', $('#wpbody') ); }, 200);";
 
 
 
261
 
262
- ?>
263
  }
264
  });
265
 
@@ -426,7 +428,7 @@ class acf_everything_fields
426
 
427
  if( $options['page_type'] == "taxonomy" && $options['page_action'] == "add")
428
  {
429
- echo '<div id="acf-' . $field['name'] . '" class="form-field' . $required_class . '">';
430
  echo '<label for="fields[' . $field['key'] . ']">' . $field['label'] . $required_label . '</label>';
431
  $field['name'] = 'fields[' . $field['key'] . ']';
432
  $this->parent->create_field($field);
@@ -435,11 +437,12 @@ class acf_everything_fields
435
  }
436
  else
437
  {
438
- echo '<tr id="acf-' . $field['name'] . '" class="field form-field' . $required_class . '">';
439
  echo '<th valign="top" scope="row"><label for="fields[' . $field['key'] . ']">' . $field['label'] . $required_label . '</label></th>';
440
  echo '<td>';
441
  $field['name'] = 'fields[' . $field['key'] . ']';
442
  $this->parent->create_field($field);
 
443
  if($field['instructions']) echo '<span class="description">' . $field['instructions'] . '</span>';
444
  echo '</td>';
445
  echo '</tr>';
221
  type: 'post',
222
  dataType: 'html',
223
  success: function(html){
 
224
 
225
+ <?php
226
  if($this->data['page_type'] == "user")
227
  {
228
  if($this->data['page_action'] == "add")
256
  echo "$('#media-single-form table tbody tr.submit').before( html );";
257
  }
258
  }
259
+ ?>
260
+
261
+ setTimeout( function(){
262
+ $(document).trigger('acf/setup_fields', $('#wpbody') );
263
+ }, 200);
264
 
 
265
  }
266
  });
267
 
428
 
429
  if( $options['page_type'] == "taxonomy" && $options['page_action'] == "add")
430
  {
431
+ echo '<div id="acf-' . $field['name'] . '" class="form-field field field-' . $field['type'] . ' field-'.$field['key'] . $required_class . '">';
432
  echo '<label for="fields[' . $field['key'] . ']">' . $field['label'] . $required_label . '</label>';
433
  $field['name'] = 'fields[' . $field['key'] . ']';
434
  $this->parent->create_field($field);
437
  }
438
  else
439
  {
440
+ echo '<tr id="acf-' . $field['name'] . '" class="form-field field field-' . $field['type'] . ' field-'.$field['key'] . $required_class . '">';
441
  echo '<th valign="top" scope="row"><label for="fields[' . $field['key'] . ']">' . $field['label'] . $required_label . '</label></th>';
442
  echo '<td>';
443
  $field['name'] = 'fields[' . $field['key'] . ']';
444
  $this->parent->create_field($field);
445
+
446
  if($field['instructions']) echo '<span class="description">' . $field['instructions'] . '</span>';
447
  echo '</td>';
448
  echo '</tr>';
core/controllers/field_group.php CHANGED
@@ -302,10 +302,10 @@ class acf_field_group
302
  case "post_type":
303
 
304
  $choices = get_post_types(array(
305
- 'public' => true
306
  ));
307
 
308
- unset($choices['attachment']);
309
 
310
  break;
311
 
@@ -423,8 +423,10 @@ class acf_field_group
423
 
424
  case "options_page" :
425
 
 
 
426
  $choices = array(
427
- __('Options','acf') => __('Options','acf'),
428
  );
429
 
430
  $custom = apply_filters('acf_register_options_page',array());
@@ -535,7 +537,7 @@ class acf_field_group
535
 
536
 
537
  // only for save acf
538
- if( ! isset($_POST['save_fields']) || $_POST['save_fields'] != 'true')
539
  {
540
  return $post_id;
541
  }
@@ -552,31 +554,29 @@ class acf_field_group
552
  * save fields
553
  */
554
 
555
- $fields = $_POST['fields'];
556
-
557
  // get all keys to find fields
558
  $dont_delete = array();
559
 
560
- if($fields)
561
  {
562
  $i = -1;
563
 
564
- // remove dummy field
565
- unset($fields['999']);
566
 
567
  // loop through and save fields
568
- foreach($fields as $field)
569
  {
570
  $i++;
571
 
572
- // each field has a unique id!
573
- if(!isset($field['key'])) $field['key'] = 'field_' . uniqid();
574
-
575
  // add to dont delete array
576
- $dont_delete[] = $field['key'];
577
 
578
  // order
579
  $field['order_no'] = $i;
 
 
580
 
581
  // update field
582
  $this->parent->update_field($post_id, $field);
@@ -584,9 +584,10 @@ class acf_field_group
584
  }
585
 
586
  // delete all other field
587
- foreach(get_post_custom_keys($post_id) as $key)
 
588
  {
589
- if(strpos($key, 'field_') !== false && !in_array($key, $dont_delete))
590
  {
591
  // this is a field, and it wasn't found in the dont_delete array
592
  delete_post_meta($post_id, $key);
@@ -635,6 +636,8 @@ class acf_field_group
635
 
636
  }
637
 
 
 
638
  }
639
 
640
  ?>
302
  case "post_type":
303
 
304
  $choices = get_post_types(array(
305
+ //'public' => true
306
  ));
307
 
308
+ unset( $choices['attachment'], $choices['revision'] , $choices['nav_menu_item'] );
309
 
310
  break;
311
 
423
 
424
  case "options_page" :
425
 
426
+ $parent_title = apply_filters('acf_options_page_title', __('Options','acf'));
427
+
428
  $choices = array(
429
+ $parent_title => $parent_title,
430
  );
431
 
432
  $custom = apply_filters('acf_register_options_page',array());
537
 
538
 
539
  // only for save acf
540
+ if( ! isset($_POST['acf_save_post']) || $_POST['acf_save_post'] != 'field_group')
541
  {
542
  return $post_id;
543
  }
554
  * save fields
555
  */
556
 
557
+
 
558
  // get all keys to find fields
559
  $dont_delete = array();
560
 
561
+ if( $_POST['fields'] )
562
  {
563
  $i = -1;
564
 
565
+ // remove clone field
566
+ unset( $_POST['fields']['field_clone'] );
567
 
568
  // loop through and save fields
569
+ foreach( $_POST['fields'] as $key => $field )
570
  {
571
  $i++;
572
 
 
 
 
573
  // add to dont delete array
574
+ $dont_delete[] = $key;
575
 
576
  // order
577
  $field['order_no'] = $i;
578
+ $field['key'] = $key;
579
+
580
 
581
  // update field
582
  $this->parent->update_field($post_id, $field);
584
  }
585
 
586
  // delete all other field
587
+ $keys = get_post_custom_keys($post_id);
588
+ foreach( $keys as $key )
589
  {
590
+ if( strpos($key, 'field_') !== false && !in_array($key, $dont_delete) )
591
  {
592
  // this is a field, and it wasn't found in the dont_delete array
593
  delete_post_meta($post_id, $key);
636
 
637
  }
638
 
639
+
640
+
641
  }
642
 
643
  ?>
core/controllers/input.php CHANGED
@@ -296,6 +296,18 @@ class acf_input
296
  {
297
  $html .= '#revisionsdiv, #screen-meta label[for=revisionsdiv-hide] {display: none;} ';
298
  }
 
 
 
 
 
 
 
 
 
 
 
 
299
 
300
 
301
  break;
@@ -447,9 +459,11 @@ class acf_input
447
  {
448
  $this->save_post_revision( $parent_id, $post_id );
449
  }
 
 
 
 
450
 
451
-
452
- do_action('acf_save_post', $post_id);
453
  }
454
 
455
 
296
  {
297
  $html .= '#revisionsdiv, #screen-meta label[for=revisionsdiv-hide] {display: none;} ';
298
  }
299
+ if( in_array('categories',$acf['options']['hide_on_screen']) )
300
+ {
301
+ $html .= '#categorydiv, #screen-meta label[for=categorydiv-hide] {display: none;} ';
302
+ }
303
+ if( in_array('tags',$acf['options']['hide_on_screen']) )
304
+ {
305
+ $html .= '#tagsdiv-post_tag, #screen-meta label[for=tagsdiv-post_tag-hide] {display: none;} ';
306
+ }
307
+ if( in_array('send-trackbacks',$acf['options']['hide_on_screen']) )
308
+ {
309
+ $html .= '#trackbacksdiv, #screen-meta label[for=trackbacksdiv-hide] {display: none;} ';
310
+ }
311
 
312
 
313
  break;
459
  {
460
  $this->save_post_revision( $parent_id, $post_id );
461
  }
462
+ else
463
+ {
464
+ do_action('acf_save_post', $post_id);
465
+ }
466
 
 
 
467
  }
468
 
469
 
core/controllers/options_page.php CHANGED
@@ -58,29 +58,40 @@ class acf_options_page
58
  return true;
59
  }
60
 
 
 
61
  $parent_slug = 'acf-options';
62
  $parent_title = __('Options','acf');
 
 
63
 
64
- // set parent slug
65
  $custom = apply_filters('acf_register_options_page',array());
66
- if(!empty($custom))
67
  {
68
  $parent_slug = $custom[0]['slug'];
69
  $parent_title = $custom[0]['title'];
70
  }
71
 
72
 
 
 
 
 
73
  // Parent
74
- $parent_page = add_menu_page($parent_title, __('Options','acf'), 'edit_posts', $parent_slug, array($this, 'html'));
 
75
 
76
  // some fields require js + css
77
  add_action('admin_print_scripts-'.$parent_page, array($this, 'admin_print_scripts'));
78
  add_action('admin_print_styles-'.$parent_page, array($this, 'admin_print_styles'));
79
 
 
80
  // Add admin head
81
  add_action('admin_head-'.$parent_page, array($this,'admin_head'));
82
  add_action('admin_footer-'.$parent_page, array($this,'admin_footer'));
83
 
 
84
  if(!empty($custom))
85
  {
86
  foreach($custom as $c)
58
  return true;
59
  }
60
 
61
+
62
+ // vars
63
  $parent_slug = 'acf-options';
64
  $parent_title = __('Options','acf');
65
+ $parent_menu = __('Options','acf');
66
+
67
 
68
+ // redirect to first child
69
  $custom = apply_filters('acf_register_options_page',array());
70
+ if( !empty($custom) )
71
  {
72
  $parent_slug = $custom[0]['slug'];
73
  $parent_title = $custom[0]['title'];
74
  }
75
 
76
 
77
+ // allow override of title
78
+ $parent_menu = apply_filters('acf_options_page_title', $parent_menu);
79
+
80
+
81
  // Parent
82
+ $parent_page = add_menu_page($parent_title, $parent_menu, 'edit_posts', $parent_slug, array($this, 'html'));
83
+
84
 
85
  // some fields require js + css
86
  add_action('admin_print_scripts-'.$parent_page, array($this, 'admin_print_scripts'));
87
  add_action('admin_print_styles-'.$parent_page, array($this, 'admin_print_styles'));
88
 
89
+
90
  // Add admin head
91
  add_action('admin_head-'.$parent_page, array($this,'admin_head'));
92
  add_action('admin_footer-'.$parent_page, array($this,'admin_footer'));
93
 
94
+
95
  if(!empty($custom))
96
  {
97
  foreach($custom as $c)
core/controllers/third_party.php ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * third_party
5
+ *
6
+ * @description:
7
+ * @since 3.5.1
8
+ * @created: 23/06/12
9
+ */
10
+
11
+ class acf_third_party
12
+ {
13
+
14
+ var $parent,
15
+ $data;
16
+
17
+
18
+ /*
19
+ * __construct
20
+ *
21
+ * @description:
22
+ * @since 3.1.8
23
+ * @created: 23/06/12
24
+ */
25
+
26
+ function __construct($parent)
27
+ {
28
+ // vars
29
+ $this->parent = $parent;
30
+ $this->data['metaboxes'] = array();
31
+
32
+
33
+ // Tabify Edit Screen - http://wordpress.org/extend/plugins/tabify-edit-screen/
34
+ add_action('admin_head-settings_page_tabify-edit-screen', array($this,'admin_head_tabify'));
35
+
36
+
37
+ // Duplicate Post - http://wordpress.org/extend/plugins/duplicate-post/
38
+ add_action( 'dp_duplicate_page', array($this, 'dp_duplicate_page'), 11, 2);
39
+ }
40
+
41
+
42
+ /*
43
+ * admin_head_tabify
44
+ *
45
+ * @description:
46
+ * @since 3.5.1
47
+ * @created: 9/10/12
48
+ */
49
+
50
+ function admin_head_tabify()
51
+ {
52
+ // remove ACF from the tabs
53
+ add_filter('tabify_posttypes', array($this, 'tabify_posttypes'));
54
+
55
+
56
+ // add acf metaboxes to list
57
+ add_action('tabify_add_meta_boxes' , array($this,'tabify_add_meta_boxes'));
58
+
59
+ }
60
+
61
+
62
+ /*
63
+ * tabify_posttypes
64
+ *
65
+ * @description:
66
+ * @since 3.5.1
67
+ * @created: 9/10/12
68
+ */
69
+
70
+ function tabify_posttypes( $posttypes )
71
+ {
72
+ if( isset($posttypes['acf']) )
73
+ {
74
+ unset( $posttypes['acf'] );
75
+ }
76
+
77
+ return $posttypes;
78
+ }
79
+
80
+
81
+ /*
82
+ * tabify_add_meta_boxes
83
+ *
84
+ * @description:
85
+ * @since 3.5.1
86
+ * @created: 9/10/12
87
+ */
88
+
89
+ function tabify_add_meta_boxes( $post_type )
90
+ {
91
+ // get acf's
92
+ $acfs = $this->parent->get_field_groups();
93
+
94
+ if($acfs)
95
+ {
96
+ foreach($acfs as $acf)
97
+ {
98
+ // add meta box
99
+ add_meta_box(
100
+ 'acf_' . $acf['id'],
101
+ $acf['title'],
102
+ array($this, 'dummy'),
103
+ $post_type
104
+ );
105
+
106
+ }
107
+ // foreach($acfs as $acf)
108
+ }
109
+ // if($acfs)
110
+ }
111
+
112
+ function dummy(){ /* Do Nothing */ }
113
+
114
+
115
+
116
+ /*
117
+ * dp_duplicate_page
118
+ *
119
+ * @description:
120
+ * @since 3.5.1
121
+ * @created: 9/10/12
122
+ */
123
+
124
+ function dp_duplicate_page( $new_post_id, $old_post_object )
125
+ {
126
+ // only for acf
127
+ if( $old_post_object->post_type != "acf" )
128
+ {
129
+ return;
130
+ }
131
+
132
+
133
+ // update keys
134
+ $metas = get_post_custom( $new_post_id );
135
+
136
+ if( $metas )
137
+ {
138
+ foreach( $metas as $field_key => $field )
139
+ {
140
+ if( strpos($field_key, 'field_') !== false )
141
+ {
142
+ $field = maybe_unserialize($field[0]);
143
+
144
+ // delete old field
145
+ delete_post_meta($new_post_id, $field_key);
146
+
147
+
148
+ // set new keys (recursive for sub fields)
149
+ $field = $this->create_new_field_keys( $field );
150
+
151
+
152
+ // save it!
153
+ update_post_meta($new_post_id, $field['key'], $field);
154
+
155
+ }
156
+ // if( strpos($field_key, 'field_') !== false )
157
+ }
158
+ // foreach( $metas as $field_key => $field )
159
+ }
160
+ // if( $metas )
161
+
162
+ }
163
+
164
+
165
+ /*
166
+ * create_new_field_keys
167
+ *
168
+ * @description:
169
+ * @since 3.5.1
170
+ * @created: 9/10/12
171
+ */
172
+
173
+ function create_new_field_keys( $field )
174
+ {
175
+ if( isset( $field['key']) )
176
+ {
177
+ $field['key'] = 'field_' . uniqid();
178
+ }
179
+
180
+
181
+ if( isset( $field['sub_fields'] ) )
182
+ {
183
+ foreach( $field['sub_fields'] as &$sub_field )
184
+ {
185
+ $sub_field = $this->create_new_field_keys( $sub_field );
186
+ }
187
+ }
188
+
189
+
190
+ return $field;
191
+ }
192
+
193
+ }
194
+
195
+ ?>
core/fields/acf_field.php CHANGED
@@ -114,6 +114,11 @@ class acf_Field
114
  // strip slashes
115
  $value = stripslashes_deep($value);
116
 
 
 
 
 
 
117
 
118
  // if $post_id is a string, then it is used in the everything fields and can be found in the options table
119
  if( is_numeric($post_id) )
114
  // strip slashes
115
  $value = stripslashes_deep($value);
116
 
117
+ // apply filters
118
+ $value = apply_filters('acf_update_value', $value, $field, $post_id );
119
+ $value = apply_filters('acf_update_value-' . $field['name'], $value, $field, $post_id);
120
+ $value = apply_filters('acf_update_value-' . $field['key'], $value, $field, $post_id);
121
+
122
 
123
  // if $post_id is a string, then it is used in the everything fields and can be found in the options table
124
  if( is_numeric($post_id) )
core/fields/checkbox.php CHANGED
@@ -71,7 +71,7 @@ class acf_Checkbox extends acf_Field
71
  {
72
  $selected = 'checked="yes"';
73
  }
74
- echo '<li><label><input type="checkbox" class="' . $field['class'] . '" name="' . $field['name'] . '" value="' . $key . '" ' . $selected . ' />' . $value . '</label></li>';
75
  }
76
 
77
  echo '</ul>';
@@ -121,7 +121,7 @@ class acf_Checkbox extends acf_Field
121
  </p>
122
  </td>
123
  <td>
124
- <textarea rows="5" name="fields[<?php echo $key; ?>][choices]" id=""><?php echo $field['choices']; ?></textarea>
125
  </td>
126
  </tr>
127
  <?php
71
  {
72
  $selected = 'checked="yes"';
73
  }
74
+ echo '<li><label><input id="' . $field['id'] . '-' . $key . '" type="checkbox" class="' . $field['class'] . '" name="' . $field['name'] . '" value="' . $key . '" ' . $selected . ' />' . $value . '</label></li>';
75
  }
76
 
77
  echo '</ul>';
121
  </p>
122
  </td>
123
  <td>
124
+ <textarea class="texarea field_option-choices" rows="5" name="fields[<?php echo $key; ?>][choices]" id=""><?php echo $field['choices']; ?></textarea>
125
  </td>
126
  </tr>
127
  <?php
core/fields/color_picker.php CHANGED
@@ -61,7 +61,7 @@ class acf_Color_picker extends acf_Field
61
  function create_field($field)
62
  {
63
  // html
64
- echo '<input type="text" value="' . $field['value'] . '" class="acf_color_picker" name="' . $field['name'] . '" id="' . $field['name'] . '" />';
65
 
66
  }
67
 
61
  function create_field($field)
62
  {
63
  // html
64
+ echo '<input type="text" value="' . $field['value'] . '" class="acf_color_picker" name="' . $field['name'] . '" id="' . $field['id'] . '" />';
65
 
66
  }
67
 
core/fields/file.php CHANGED
@@ -613,6 +613,14 @@ class acf_File extends acf_Field
613
  {
614
  $attachment = get_post( $value );
615
 
 
 
 
 
 
 
 
 
616
  // create array to hold value data
617
  $value = array(
618
  'id' => $attachment->ID,
613
  {
614
  $attachment = get_post( $value );
615
 
616
+
617
+ // validate
618
+ if( !$attachment )
619
+ {
620
+ return false;
621
+ }
622
+
623
+
624
  // create array to hold value data
625
  $value = array(
626
  'id' => $attachment->ID,
core/fields/flexible_content.php CHANGED
@@ -282,9 +282,14 @@ class acf_Flexible_content extends acf_Field
282
  {
283
  // vars
284
  $fields_names = array();
285
- $field['layouts'] = isset($field['layouts']) ? $field['layouts'] : array();
286
- $field['button_label'] = (isset($field['button_label']) && $field['button_label'] != "") ? $field['button_label'] : __("+ Add Row",'acf');
 
 
287
 
 
 
 
288
  // load default layout
289
  if(empty($field['layouts']))
290
  {
@@ -296,28 +301,30 @@ class acf_Flexible_content extends acf_Field
296
  );
297
  }
298
 
 
299
  // get name of all fields for use in field type
300
  foreach($this->parent->fields as $f)
301
  {
302
  $fields_names[$f->name] = $f->title;
303
  }
304
- //unset($fields_names['repeater']);
305
  unset($fields_names['flexible_content']);
306
 
 
307
  // loop through layouts and create the options for them
308
  if($field['layouts']):
309
  foreach($field['layouts'] as $layout_key => $layout):
310
 
311
- // add clone field
312
- $layout['sub_fields'][999] = array(
313
- 'label' => __("New Field",'acf'),
314
- 'name' => 'new_field',
315
- 'type' => 'text',
316
- 'order_no' => '1',
317
- 'instructions' => '',
318
  );
319
- ?>
320
- <tr class="field_option field_option_<?php echo $this->name; ?>">
 
321
  <td class="label">
322
  <label><?php _e("Layout",'acf'); ?></label>
323
  <p class="desription">
@@ -330,7 +337,7 @@ class acf_Flexible_content extends acf_Field
330
  <div class="repeater">
331
 
332
  <table class="acf_cf_meta">
333
- <body>
334
  <tr>
335
  <td class="acf_fc_label" style="padding-left:0;">
336
  <label><?php _e('Label','acf'); ?></label>
@@ -367,7 +374,7 @@ class acf_Flexible_content extends acf_Field
367
  ?>
368
  </td>
369
  </tr>
370
- </body>
371
  </table>
372
 
373
  <div class="fields_header">
@@ -383,22 +390,17 @@ class acf_Flexible_content extends acf_Field
383
  </table>
384
  </div>
385
  <div class="fields">
386
-
387
  <div class="no_fields_message" <?php if(count($layout['sub_fields']) > 1){ echo 'style="display:none;"'; } ?>>
388
  <?php _e("No fields. Click the \"+ Add Sub Field button\" to create your first field.",'acf'); ?>
389
  </div>
390
 
391
- <?php foreach($layout['sub_fields'] as $key2 => $sub_field): ?>
392
- <div class="<?php if($key2 == 999){echo "field_clone";}else{echo "field";} ?> sub_field" data-id="<?php echo $key2; ?>">
393
-
394
- <?php if(isset($sub_field['key'])): ?>
395
- <input type="hidden" name="fields[<?php echo $key; ?>][sub_fields][<?php echo $key2; ?>][key]" value="<?php echo $sub_field['key']; ?>" />
396
- <?php endif; ?>
397
-
398
  <div class="field_meta">
399
  <table class="acf widefat">
400
  <tr>
401
- <td class="field_order"><span class="circle"><?php echo ($key2+1); ?></span></td>
402
  <td class="field_label">
403
  <strong>
404
  <a class="acf_edit_field" title="<?php _e("Edit this Field",'acf'); ?>" href="javascript:;"><?php echo $sub_field['label']; ?></a>
@@ -429,7 +431,7 @@ class acf_Flexible_content extends acf_Field
429
  <?php
430
  $this->parent->create_field(array(
431
  'type' => 'text',
432
- 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$key2.'][label]',
433
  'value' => $sub_field['label'],
434
  'class' => 'label',
435
  ));
@@ -445,7 +447,7 @@ class acf_Flexible_content extends acf_Field
445
  <?php
446
  $this->parent->create_field(array(
447
  'type' => 'text',
448
- 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$key2.'][name]',
449
  'value' => $sub_field['name'],
450
  'class' => 'name',
451
  ));
@@ -458,7 +460,7 @@ class acf_Flexible_content extends acf_Field
458
  <?php
459
  $this->parent->create_field(array(
460
  'type' => 'select',
461
- 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$key2.'][type]',
462
  'value' => $sub_field['type'],
463
  'class' => 'type',
464
  'choices' => $fields_names
@@ -468,7 +470,7 @@ class acf_Flexible_content extends acf_Field
468
  </tr>
469
  <?php
470
 
471
- $this->parent->fields[$sub_field['type']]->create_options($key.'][layouts][' . $layout_key . '][sub_fields]['.$key2, $sub_field);
472
 
473
  ?>
474
  <tr class="field_save">
@@ -614,46 +616,36 @@ class acf_Flexible_content extends acf_Field
614
  // format sub_fields
615
  if($field['layouts'])
616
  {
617
-
618
- $layouts = array();
619
-
620
  // loop through and save fields
621
- foreach($field['layouts'] as $l)
622
  {
623
  // remove dummy field
624
- unset($l['sub_fields'][999]);
625
 
626
  // loop through and save fields
627
  $i = -1;
628
 
629
- $sub_fields = array();
630
-
631
- if($l['sub_fields'])
632
  {
633
- foreach($l['sub_fields'] as $f)
634
- {
635
- $i++;
636
-
637
- // each field has a unique id!
638
- if(!isset($f['key'])) $f['key'] = 'field_' . uniqid();
639
-
640
- // order
641
- $f['order_no'] = $i;
642
-
643
- // format
644
- $f = $this->parent->pre_save_field($f);
645
-
646
- $sub_fields[] = $f;
647
- }
648
  }
649
- $l['sub_fields'] = $sub_fields;
650
 
651
- $layouts[] = $l;
 
652
 
653
  }
654
-
655
- $field['layouts'] = $layouts;
656
-
657
  }
658
 
659
  // return updated repeater field
282
  {
283
  // vars
284
  $fields_names = array();
285
+ $defaults = array(
286
+ 'layouts' => array(),
287
+ 'button_label' => __("Add Row",'acf'),
288
+ );
289
 
290
+ $field = array_merge($defaults, $field);
291
+
292
+
293
  // load default layout
294
  if(empty($field['layouts']))
295
  {
301
  );
302
  }
303
 
304
+
305
  // get name of all fields for use in field type
306
  foreach($this->parent->fields as $f)
307
  {
308
  $fields_names[$f->name] = $f->title;
309
  }
 
310
  unset($fields_names['flexible_content']);
311
 
312
+
313
  // loop through layouts and create the options for them
314
  if($field['layouts']):
315
  foreach($field['layouts'] as $layout_key => $layout):
316
 
317
+ $layout['sub_fields'][] = array(
318
+ 'key' => 'field_clone',
319
+ 'label' => __("New Field",'acf'),
320
+ 'name' => __("new_field",'acf'),
321
+ 'type' => 'text',
322
+ 'order_no' => '1',
323
+ 'instructions' => '',
324
  );
325
+
326
+ ?>
327
+ <tr class="field_option field_option_<?php echo $this->name; ?>" data-id="<?php echo $layout_key; ?>">
328
  <td class="label">
329
  <label><?php _e("Layout",'acf'); ?></label>
330
  <p class="desription">
337
  <div class="repeater">
338
 
339
  <table class="acf_cf_meta">
340
+ <tbody>
341
  <tr>
342
  <td class="acf_fc_label" style="padding-left:0;">
343
  <label><?php _e('Label','acf'); ?></label>
374
  ?>
375
  </td>
376
  </tr>
377
+ </tbody>
378
  </table>
379
 
380
  <div class="fields_header">
390
  </table>
391
  </div>
392
  <div class="fields">
393
+
394
  <div class="no_fields_message" <?php if(count($layout['sub_fields']) > 1){ echo 'style="display:none;"'; } ?>>
395
  <?php _e("No fields. Click the \"+ Add Sub Field button\" to create your first field.",'acf'); ?>
396
  </div>
397
 
398
+ <?php foreach($layout['sub_fields'] as $sub_field): ?>
399
+ <div class="field field-<?php echo $sub_field['key']; ?> sub_field" data-id="<?php echo $sub_field['key']; ?>">
 
 
 
 
 
400
  <div class="field_meta">
401
  <table class="acf widefat">
402
  <tr>
403
+ <td class="field_order"><span class="circle"><?php echo (int)$sub_field['order_no'] + 1; ?></span></td>
404
  <td class="field_label">
405
  <strong>
406
  <a class="acf_edit_field" title="<?php _e("Edit this Field",'acf'); ?>" href="javascript:;"><?php echo $sub_field['label']; ?></a>
431
  <?php
432
  $this->parent->create_field(array(
433
  'type' => 'text',
434
+ 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$sub_field['key'].'][label]',
435
  'value' => $sub_field['label'],
436
  'class' => 'label',
437
  ));
447
  <?php
448
  $this->parent->create_field(array(
449
  'type' => 'text',
450
+ 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$sub_field['key'].'][name]',
451
  'value' => $sub_field['name'],
452
  'class' => 'name',
453
  ));
460
  <?php
461
  $this->parent->create_field(array(
462
  'type' => 'select',
463
+ 'name' => 'fields['.$key.'][layouts][' . $layout_key . '][sub_fields]['.$sub_field['key'].'][type]',
464
  'value' => $sub_field['type'],
465
  'class' => 'type',
466
  'choices' => $fields_names
470
  </tr>
471
  <?php
472
 
473
+ $this->parent->fields[$sub_field['type']]->create_options($key.'][layouts][' . $layout_key . '][sub_fields]['.$sub_field['key'], $sub_field);
474
 
475
  ?>
476
  <tr class="field_save">
616
  // format sub_fields
617
  if($field['layouts'])
618
  {
 
 
 
619
  // loop through and save fields
620
+ foreach($field['layouts'] as $layout_key => $layout)
621
  {
622
  // remove dummy field
623
+ unset( $layout['sub_fields']['field_clone'] );
624
 
625
  // loop through and save fields
626
  $i = -1;
627
 
628
+ if( $layout['sub_fields'] )
 
 
629
  {
630
+ foreach( $layout['sub_fields'] as $key => $f )
631
+ {
632
+ $i++;
633
+
634
+ // order
635
+ $f['order_no'] = $i;
636
+ $f['key'] = $key;
637
+
638
+ // format
639
+ $f = $this->parent->pre_save_field( $f );
640
+
641
+ $layout['sub_fields'][ $key ] = $f;
642
+ }
 
 
643
  }
 
644
 
645
+ // update $layout
646
+ $field['layouts'][ $layout_key ] = $layout;
647
 
648
  }
 
 
 
649
  }
650
 
651
  // return updated repeater field
core/fields/gallery.php CHANGED
@@ -259,10 +259,10 @@ class acf_Gallery extends acf_Field
259
 
260
  <div class="toolbar">
261
  <ul class="hl clearfix">
262
- <li class="add-image-li"><a class="add-image" href="#"><?php _e("Add Image",'acf'); ?></a><div class="divider"></div></li>
263
- <li class="view-grid-li active"><div class="divider divider-left"></div><a class="ir view-grid" href="#"><?php _e("Grid",'acf'); ?></a><div class="divider"></div></li>
264
- <li class="view-list-li"><a class="ir view-list" href="#"><?php _e("List",'acf'); ?></a><div class="divider"></div></li>
265
- <li class="count-li right">
266
  <span class="count" data-0="<?php _e("No images selected",'acf'); ?>" data-1="<?php _e("1 image selected",'acf'); ?>" data-2="<?php _e("{count} images selected",'acf'); ?>"></span>
267
  </li>
268
  </ul>
259
 
260
  <div class="toolbar">
261
  <ul class="hl clearfix">
262
+ <li class="add-image-li"><a class="acf-button add-image" href="#"><?php _e("Add Image",'acf'); ?></a></li>
263
+ <li class="gallery-li view-grid-li active"><div class="divider divider-left"></div><a class="ir view-grid" href="#"><?php _e("Grid",'acf'); ?></a><div class="divider"></div></li>
264
+ <li class="gallery-li view-list-li"><a class="ir view-list" href="#"><?php _e("List",'acf'); ?></a><div class="divider"></div></li>
265
+ <li class="gallery-li count-li right">
266
  <span class="count" data-0="<?php _e("No images selected",'acf'); ?>" data-1="<?php _e("1 image selected",'acf'); ?>" data-2="<?php _e("{count} images selected",'acf'); ?>"></span>
267
  </li>
268
  </ul>
core/fields/image.php CHANGED
@@ -647,6 +647,14 @@ class acf_Image extends acf_Field
647
  {
648
  $attachment = get_post( $value );
649
 
 
 
 
 
 
 
 
 
650
  // create array to hold value data
651
  $value = array(
652
  'id' => $attachment->ID,
647
  {
648
  $attachment = get_post( $value );
649
 
650
+
651
+ // validate
652
+ if( !$attachment )
653
+ {
654
+ return false;
655
+ }
656
+
657
+
658
  // create array to hold value data
659
  $value = array(
660
  'id' => $attachment->ID,
core/fields/number.php CHANGED
@@ -35,7 +35,7 @@ class acf_Number extends acf_Field
35
 
36
  function create_field($field)
37
  {
38
- echo '<input type="number" step="any" value="' . $field['value'] . '" id="' . $field['name'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" />';
39
  }
40
 
41
 
35
 
36
  function create_field($field)
37
  {
38
+ echo '<input type="number" step="any" value="' . $field['value'] . '" id="' . $field['id'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" />';
39
  }
40
 
41
 
core/fields/radio.php CHANGED
@@ -67,7 +67,7 @@ class acf_Radio extends acf_Field
67
  $selected = 'checked="checked" data-checked="checked"';
68
  }
69
 
70
- echo '<li><label><input type="radio" name="' . $field['name'] . '" value="' . $key . '" ' . $selected . ' />' . $value . '</label></li>';
71
  }
72
 
73
  echo '</ul>';
@@ -122,7 +122,7 @@ class acf_Radio extends acf_Field
122
  </p>
123
  </td>
124
  <td>
125
- <textarea rows="5" name="fields[<?php echo $key; ?>][choices]" id=""><?php echo $field['choices']; ?></textarea>
126
  </td>
127
  </tr>
128
  <tr class="field_option field_option_<?php echo $this->name; ?>">
67
  $selected = 'checked="checked" data-checked="checked"';
68
  }
69
 
70
+ echo '<li><label><input id="' . $field['id'] . '-' . $key . '" type="radio" name="' . $field['name'] . '" value="' . $key . '" ' . $selected . ' />' . $value . '</label></li>';
71
  }
72
 
73
  echo '</ul>';
122
  </p>
123
  </td>
124
  <td>
125
+ <textarea class="texarea field_option-choices" rows="5" name="fields[<?php echo $key; ?>][choices]" id=""><?php echo $field['choices']; ?></textarea>
126
  </td>
127
  </tr>
128
  <tr class="field_option field_option_<?php echo $this->name; ?>">
core/fields/relationship.php CHANGED
@@ -265,7 +265,7 @@ class acf_Relationship extends acf_Field
265
 
266
 
267
  ?>
268
- <div class="acf_relationship" data-max="<?php echo $field['max']; ?>" data-s="" data-paged="1" data-post_type="<?php echo implode(',', $field['post_type']); ?>" data-taxonomy="<?php echo implode(',', $field['taxonomy']); ?>" <?php if( defined('ICL_LANGUAGE_CODE') ){ echo 'data-lang="' . ICL_LANGUAGE_CODE . '"';} ?>">
269
 
270
  <!-- Hidden Blank default value -->
271
  <input type="hidden" name="<?php echo $field['name']; ?>" value="" />
265
 
266
 
267
  ?>
268
+ <div class="acf_relationship" data-max="<?php echo $field['max']; ?>" data-s="" data-paged="1" data-post_type="<?php echo implode(',', $field['post_type']); ?>" data-taxonomy="<?php echo implode(',', $field['taxonomy']); ?>" <?php if( defined('ICL_LANGUAGE_CODE') ){ echo 'data-lang="' . ICL_LANGUAGE_CODE . '"';} ?>>
269
 
270
  <!-- Hidden Blank default value -->
271
  <input type="hidden" name="<?php echo $field['name']; ?>" value="" />
core/fields/repeater.php CHANGED
@@ -142,7 +142,7 @@ class acf_Repeater extends acf_Field
142
  }
143
 
144
  ?>
145
- <th class="<?php echo $sub_field['name']; ?>" <?php echo $attr; ?>>
146
  <span><?php echo $sub_field['label']; ?></span>
147
  <?php if( isset($sub_field['instructions']) ): ?>
148
  <span class="sub-field-instructions"><?php echo $sub_field['instructions']; ?></span>
@@ -297,15 +297,16 @@ class acf_Repeater extends acf_Field
297
  $field['row_min'] = (int) $field['row_min'];
298
 
299
 
300
- // add clone field
301
- $field['sub_fields'][999] = array(
302
- 'label' => __("New Field",'acf'),
303
- 'name' => 'new_field',
304
- 'type' => 'text',
305
- 'order_no' => '1',
306
- 'instructions' => '',
307
- 'column_width' => ''
308
  );
 
309
 
310
  // get name of all fields for use in field type
311
  foreach($this->parent->fields as $f)
@@ -338,16 +339,12 @@ class acf_Repeater extends acf_Field
338
  <?php _e("No fields. Click the \"+ Add Sub Field button\" to create your first field.",'acf'); ?>
339
  </div>
340
 
341
- <?php foreach($field['sub_fields'] as $key2 => $sub_field): ?>
342
- <div class="<?php if($key2 == 999){echo "field_clone";}else{echo "field";} ?> sub_field" data-id="<?php echo $key2; ?>">
343
-
344
- <?php if(isset($sub_field['key'])): ?>
345
- <input type="hidden" name="fields[<?php echo $key; ?>][sub_fields][<?php echo $key2; ?>][key]" value="<?php echo $sub_field['key']; ?>" />
346
- <?php endif; ?>
347
  <div class="field_meta">
348
  <table class="acf widefat">
349
  <tr>
350
- <td class="field_order"><span class="circle"><?php echo ($key2+1); ?></span></td>
351
  <td class="field_label">
352
  <strong>
353
  <a class="acf_edit_field" title="<?php _e("Edit this Field",'acf'); ?>" href="javascript:;"><?php echo $sub_field['label']; ?></a>
@@ -379,7 +376,7 @@ class acf_Repeater extends acf_Field
379
  <?php
380
  $this->parent->create_field(array(
381
  'type' => 'text',
382
- 'name' => 'fields['.$key.'][sub_fields]['.$key2.'][label]',
383
  'value' => $sub_field['label'],
384
  'class' => 'label',
385
  ));
@@ -395,7 +392,7 @@ class acf_Repeater extends acf_Field
395
  <?php
396
  $this->parent->create_field(array(
397
  'type' => 'text',
398
- 'name' => 'fields['.$key.'][sub_fields]['.$key2.'][name]',
399
  'value' => $sub_field['name'],
400
  'class' => 'name',
401
  ));
@@ -408,7 +405,7 @@ class acf_Repeater extends acf_Field
408
  <?php
409
  $this->parent->create_field(array(
410
  'type' => 'select',
411
- 'name' => 'fields['.$key.'][sub_fields]['.$key2.'][type]',
412
  'value' => $sub_field['type'],
413
  'class' => 'type',
414
  'choices' => $fields_names
@@ -428,7 +425,7 @@ class acf_Repeater extends acf_Field
428
 
429
  $this->parent->create_field(array(
430
  'type' => 'text',
431
- 'name' => 'fields['.$key.'][sub_fields]['.$key2.'][instructions]',
432
  'value' => $sub_field['instructions'],
433
  'class' => 'instructions',
434
  ));
@@ -450,7 +447,7 @@ class acf_Repeater extends acf_Field
450
 
451
  $this->parent->create_field(array(
452
  'type' => 'number',
453
- 'name' => 'fields['.$key.'][sub_fields]['.$key2.'][column_width]',
454
  'value' => $sub_field['column_width'],
455
  'class' => 'column_width',
456
  ));
@@ -459,7 +456,7 @@ class acf_Repeater extends acf_Field
459
  </tr>
460
  <?php
461
 
462
- $this->parent->fields[$sub_field['type']]->create_options($key.'][sub_fields]['.$key2, $sub_field);
463
 
464
  ?>
465
  <tr class="field_save">
@@ -568,33 +565,27 @@ class acf_Repeater extends acf_Field
568
  function pre_save_field($field)
569
  {
570
  // format sub_fields
571
- if($field['sub_fields'])
572
  {
573
  // remove dummy field
574
- unset($field['sub_fields'][999]);
575
 
576
  // loop through and save fields
577
  $i = -1;
578
-
579
- $sub_fields = array();
580
-
581
- foreach($field['sub_fields'] as $f)
582
  {
583
  $i++;
584
 
585
- // each field has a unique id!
586
- if(!isset($f['key'])) $f['key'] = 'field_' . uniqid();
587
-
588
  // order
589
  $f['order_no'] = $i;
 
590
 
591
  // format
592
  $f = $this->parent->pre_save_field($f);
593
 
594
- $sub_fields[] = $f;
595
  }
596
-
597
- $field['sub_fields'] = $sub_fields;
598
  }
599
 
600
  // return updated repeater field
142
  }
143
 
144
  ?>
145
+ <th class="acf-th-<?php echo $sub_field['name']; ?>" <?php echo $attr; ?>>
146
  <span><?php echo $sub_field['label']; ?></span>
147
  <?php if( isset($sub_field['instructions']) ): ?>
148
  <span class="sub-field-instructions"><?php echo $sub_field['instructions']; ?></span>
297
  $field['row_min'] = (int) $field['row_min'];
298
 
299
 
300
+ // add clone
301
+ $field['sub_fields'][] = array(
302
+ 'key' => 'field_clone',
303
+ 'label' => __("New Field",'acf'),
304
+ 'name' => __("new_field",'acf'),
305
+ 'type' => 'text',
306
+ 'order_no' => '1',
307
+ 'instructions' => '',
308
  );
309
+
310
 
311
  // get name of all fields for use in field type
312
  foreach($this->parent->fields as $f)
339
  <?php _e("No fields. Click the \"+ Add Sub Field button\" to create your first field.",'acf'); ?>
340
  </div>
341
 
342
+ <?php foreach($field['sub_fields'] as $sub_field): ?>
343
+ <div class="field field-<?php echo $sub_field['key']; ?> sub_field" data-id="<?php echo $sub_field['key']; ?>">
 
 
 
 
344
  <div class="field_meta">
345
  <table class="acf widefat">
346
  <tr>
347
+ <td class="field_order"><span class="circle"><?php echo (int)$sub_field['order_no'] + 1; ?></span></td>
348
  <td class="field_label">
349
  <strong>
350
  <a class="acf_edit_field" title="<?php _e("Edit this Field",'acf'); ?>" href="javascript:;"><?php echo $sub_field['label']; ?></a>
376
  <?php
377
  $this->parent->create_field(array(
378
  'type' => 'text',
379
+ 'name' => 'fields['.$key.'][sub_fields]['.$sub_field['key'].'][label]',
380
  'value' => $sub_field['label'],
381
  'class' => 'label',
382
  ));
392
  <?php
393
  $this->parent->create_field(array(
394
  'type' => 'text',
395
+ 'name' => 'fields['.$key.'][sub_fields]['.$sub_field['key'].'][name]',
396
  'value' => $sub_field['name'],
397
  'class' => 'name',
398
  ));
405
  <?php
406
  $this->parent->create_field(array(
407
  'type' => 'select',
408
+ 'name' => 'fields['.$key.'][sub_fields]['.$sub_field['key'].'][type]',
409
  'value' => $sub_field['type'],
410
  'class' => 'type',
411
  'choices' => $fields_names
425
 
426
  $this->parent->create_field(array(
427
  'type' => 'text',
428
+ 'name' => 'fields['.$key.'][sub_fields]['.$sub_field['key'].'][instructions]',
429
  'value' => $sub_field['instructions'],
430
  'class' => 'instructions',
431
  ));
447
 
448
  $this->parent->create_field(array(
449
  'type' => 'number',
450
+ 'name' => 'fields['.$key.'][sub_fields]['.$sub_field['key'].'][column_width]',
451
  'value' => $sub_field['column_width'],
452
  'class' => 'column_width',
453
  ));
456
  </tr>
457
  <?php
458
 
459
+ $this->parent->fields[$sub_field['type']]->create_options($key.'][sub_fields]['.$sub_field['key'], $sub_field);
460
 
461
  ?>
462
  <tr class="field_save">
565
  function pre_save_field($field)
566
  {
567
  // format sub_fields
568
+ if( $field['sub_fields'] )
569
  {
570
  // remove dummy field
571
+ unset( $field['sub_fields']['field_clone'] );
572
 
573
  // loop through and save fields
574
  $i = -1;
575
+
576
+ foreach( $field['sub_fields'] as $key => $f )
 
 
577
  {
578
  $i++;
579
 
 
 
 
580
  // order
581
  $f['order_no'] = $i;
582
+ $f['key'] = $key;
583
 
584
  // format
585
  $f = $this->parent->pre_save_field($f);
586
 
587
+ $field['sub_fields'][ $key ] = $f;
588
  }
 
 
589
  }
590
 
591
  // return updated repeater field
core/fields/select.php CHANGED
@@ -69,7 +69,7 @@ class acf_Select extends acf_Field
69
 
70
 
71
  // html
72
- echo '<select id="' . $field['name'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" ' . $multiple . ' >';
73
 
74
 
75
  // null
@@ -182,7 +182,7 @@ class acf_Select extends acf_Field
182
  </p>
183
  </td>
184
  <td>
185
- <textarea rows="5" name="fields[<?php echo $key; ?>][choices]" id=""><?php echo $field['choices']; ?></textarea>
186
  </td>
187
  </tr>
188
  <tr class="field_option field_option_<?php echo $this->name; ?>">
@@ -274,33 +274,37 @@ class acf_Select extends acf_Field
274
 
275
 
276
  // explode choices from each line
277
- if(strpos($field['choices'], "\n") !== false)
278
  {
279
- // found multiple lines, explode it
280
- $field['choices'] = explode("\n", $field['choices']);
281
- }
282
- else
283
- {
284
- // no multiple lines!
285
- $field['choices'] = array($field['choices']);
286
- }
287
-
288
-
289
- // key => value
290
- foreach($field['choices'] as $choice)
291
- {
292
- if(strpos($choice, ' : ') !== false)
293
  {
294
- $choice = explode(' : ', $choice);
295
- $new_choices[trim($choice[0])] = trim($choice[1]);
296
  }
297
  else
298
  {
299
- $new_choices[trim($choice)] = trim($choice);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  }
301
  }
302
 
303
 
 
304
  // update choices
305
  $field['choices'] = $new_choices;
306
 
69
 
70
 
71
  // html
72
+ echo '<select id="' . $field['id'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" ' . $multiple . ' >';
73
 
74
 
75
  // null
182
  </p>
183
  </td>
184
  <td>
185
+ <textarea class="texarea field_option-choices" rows="5" name="fields[<?php echo $key; ?>][choices]" id=""><?php echo $field['choices']; ?></textarea>
186
  </td>
187
  </tr>
188
  <tr class="field_option field_option_<?php echo $this->name; ?>">
274
 
275
 
276
  // explode choices from each line
277
+ if( $field['choices'] )
278
  {
279
+ if(strpos($field['choices'], "\n") !== false)
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  {
281
+ // found multiple lines, explode it
282
+ $field['choices'] = explode("\n", $field['choices']);
283
  }
284
  else
285
  {
286
+ // no multiple lines!
287
+ $field['choices'] = array($field['choices']);
288
+ }
289
+
290
+
291
+ // key => value
292
+ foreach($field['choices'] as $choice)
293
+ {
294
+ if(strpos($choice, ' : ') !== false)
295
+ {
296
+ $choice = explode(' : ', $choice);
297
+ $new_choices[trim($choice[0])] = trim($choice[1]);
298
+ }
299
+ else
300
+ {
301
+ $new_choices[trim($choice)] = trim($choice);
302
+ }
303
  }
304
  }
305
 
306
 
307
+
308
  // update choices
309
  $field['choices'] = $new_choices;
310
 
core/fields/text.php CHANGED
@@ -35,7 +35,7 @@ class acf_Text extends acf_Field
35
 
36
  function create_field($field)
37
  {
38
- echo '<input type="text" value="' . $field['value'] . '" id="' . $field['name'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" />';
39
  }
40
 
41
 
@@ -137,7 +137,9 @@ class acf_Text extends acf_Field
137
  }
138
  elseif($format == 'html')
139
  {
140
- $value = html_entity_decode($value);
 
 
141
  }
142
 
143
  return $value;
35
 
36
  function create_field($field)
37
  {
38
+ echo '<input type="text" value="' . $field['value'] . '" id="' . $field['id'] . '" class="' . $field['class'] . '" name="' . $field['name'] . '" />';
39
  }
40
 
41
 
137
  }
138
  elseif($format == 'html')
139
  {
140
+ //$value = html_entity_decode($value);
141
+ $value = nl2br($value);
142
+
143
  }
144
 
145
  return $value;
core/fields/textarea.php CHANGED
@@ -36,8 +36,10 @@ class acf_Textarea extends acf_Field
36
  function create_field($field)
37
  {
38
  // remove unwanted <br /> tags
39
- $field['value'] = str_replace('<br />','',$field['value']);
40
- echo '<textarea id="' . $field['name'] . '" rows="4" class="' . $field['class'] . '" name="' . $field['name'] . '" >' . $field['value'] . '</textarea>';
 
 
41
  }
42
 
43
 
@@ -117,7 +119,8 @@ class acf_Textarea extends acf_Field
117
  }
118
  elseif($format == 'html')
119
  {
120
- $value = html_entity_decode($value);
 
121
  }
122
  elseif($format == 'br')
123
  {
36
  function create_field($field)
37
  {
38
  // remove unwanted <br /> tags
39
+ //$field['value'] = str_replace('<br />','',$field['value']);
40
+ $field['value'] = esc_textarea($field['value']);
41
+
42
+ echo '<textarea id="' . $field['id'] . '" rows="4" class="' . $field['class'] . '" name="' . $field['name'] . '" >' . $field['value'] . '</textarea>';
43
  }
44
 
45
 
119
  }
120
  elseif($format == 'html')
121
  {
122
+ //$value = html_entity_decode($value);
123
+ //$value = nl2br($value);
124
  }
125
  elseif($format == 'br')
126
  {
core/fields/true_false.php CHANGED
@@ -42,7 +42,7 @@ class acf_True_false extends acf_Field
42
  echo '<ul class="checkbox_list ' . $field['class'] . '">';
43
  echo '<input type="hidden" name="'.$field['name'].'" value="0" />';
44
  $selected = ($field['value'] == 1) ? 'checked="yes"' : '';
45
- echo '<li><label><input type="checkbox" name="'.$field['name'].'" value="1" ' . $selected . ' />' . $field['message'] . '</label></li>';
46
 
47
  echo '</ul>';
48
 
42
  echo '<ul class="checkbox_list ' . $field['class'] . '">';
43
  echo '<input type="hidden" name="'.$field['name'].'" value="0" />';
44
  $selected = ($field['value'] == 1) ? 'checked="yes"' : '';
45
+ echo '<li><label><input id="' . $field['id'] . '-1" type="checkbox" name="'.$field['name'].'" value="1" ' . $selected . ' />' . $field['message'] . '</label></li>';
46
 
47
  echo '</ul>';
48
 
core/views/meta_box_fields.php CHANGED
@@ -21,13 +21,19 @@ $fields = $this->parent->get_acf_fields( $post->ID );
21
 
22
 
23
  // add clone
24
- $fields[999] = array(
25
- 'label' => __("New Field",'acf'),
26
- 'name' => __("new_field",'acf'),
27
- 'type' => 'text',
28
- 'order_no' => '1',
29
- 'instructions' => '',
 
30
  'required' => '0',
 
 
 
 
 
31
  );
32
 
33
 
@@ -37,17 +43,16 @@ foreach( $this->parent->fields as $field )
37
  $fields_names[$field->name] = $field->title;
38
  }
39
 
40
-
41
  ?>
42
 
43
  <!-- Hidden Fields -->
44
  <div style="display:none;">
45
  <script type="text/javascript">
46
- var acf_messages = {
47
- move_to_trash : "<?php _e("Move to trash. Are you sure?",'acf'); ?>"
48
- };
49
  </script>
50
- <input type="hidden" name="save_fields" value="true" />
51
  </div>
52
  <!-- / Hidden Fields -->
53
 
@@ -70,12 +75,15 @@ foreach( $this->parent->fields as $field )
70
 
71
 
72
  <div class="fields">
73
- <div class="no_fields_message" <?php if(sizeof($fields) > 1){ echo 'style="display:none;"'; } ?>>
 
 
74
  <?php _e("No fields. Click the <strong>+ Add Field</strong> button to create your first field.",'acf'); ?>
75
  </div>
76
- <?php foreach($fields as $key => $field): ?>
77
- <div class="<?php echo ($key == 999) ? "field_clone" : "field"; ?>" data-id="<?php echo $key; ?>">
78
- <?php if(isset($field['key'])): ?><input type="hidden" name="fields[<?php echo $key; ?>][key]" value="<?php echo $field['key']; ?>" /><?php endif; ?>
 
79
  <div class="field_meta">
80
  <table class="acf widefat">
81
  <tr>
@@ -111,7 +119,7 @@ foreach( $this->parent->fields as $field )
111
  <?php
112
  $this->parent->create_field(array(
113
  'type' => 'text',
114
- 'name' => 'fields['.$key.'][label]',
115
  'value' => $field['label'],
116
  'class' => 'label',
117
  ));
@@ -127,7 +135,7 @@ foreach( $this->parent->fields as $field )
127
  <?php
128
  $this->parent->create_field(array(
129
  'type' => 'text',
130
- 'name' => 'fields['.$key.'][name]',
131
  'value' => $field['name'],
132
  'class' => 'name',
133
  ));
@@ -140,7 +148,7 @@ foreach( $this->parent->fields as $field )
140
  <?php
141
  $this->parent->create_field(array(
142
  'type' => 'select',
143
- 'name' => 'fields['.$key.'][type]',
144
  'value' => $field['type'],
145
  'choices' => $fields_names,
146
  ));
@@ -154,7 +162,7 @@ foreach( $this->parent->fields as $field )
154
  <?php
155
  $this->parent->create_field(array(
156
  'type' => 'textarea',
157
- 'name' => 'fields['.$key.'][instructions]',
158
  'value' => $field['instructions'],
159
  ));
160
  ?>
@@ -166,7 +174,7 @@ foreach( $this->parent->fields as $field )
166
  <?php
167
  $this->parent->create_field(array(
168
  'type' => 'radio',
169
- 'name' => 'fields['.$key.'][required]',
170
  'value' => $field['required'],
171
  'choices' => array(
172
  '1' => __("Yes",'acf'),
@@ -179,9 +187,91 @@ foreach( $this->parent->fields as $field )
179
  </tr>
180
  <?php
181
 
182
- $this->parent->fields[$field['type']]->create_options($key, $field);
183
 
184
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  <tr class="field_save">
186
  <td class="label"></td>
187
  <td>
21
 
22
 
23
  // add clone
24
+ $fields[] = array(
25
+ 'key' => 'field_clone',
26
+ 'label' => __("New Field",'acf'),
27
+ 'name' => __("new_field",'acf'),
28
+ 'type' => 'text',
29
+ 'order_no' => '1',
30
+ 'instructions' => '',
31
  'required' => '0',
32
+ 'conditional_logic' => array(
33
+ 'status' => '0',
34
+ 'allorany' => 'all',
35
+ 'rules' => false
36
+ )
37
  );
38
 
39
 
43
  $fields_names[$field->name] = $field->title;
44
  }
45
 
 
46
  ?>
47
 
48
  <!-- Hidden Fields -->
49
  <div style="display:none;">
50
  <script type="text/javascript">
51
+ acf.text.move_to_trash = "<?php _e("Move to trash. Are you sure?",'acf'); ?>";
52
+ acf.text.checked = "<?php _e("checked",'acf'); ?>";
53
+ acf.text.conditional_no_fields = "<?php _e('No toggle fields available','acf'); ?>";
54
  </script>
55
+ <input type="hidden" name="acf_save_post" value="field_group" />
56
  </div>
57
  <!-- / Hidden Fields -->
58
 
75
 
76
 
77
  <div class="fields">
78
+
79
+ <!-- No Fields Message -->
80
+ <div class="no_fields_message" <?php if(count($fields) > 1){ echo 'style="display:none;"'; } ?>>
81
  <?php _e("No fields. Click the <strong>+ Add Field</strong> button to create your first field.",'acf'); ?>
82
  </div>
83
+ <!-- / No Fields Message -->
84
+
85
+ <?php foreach($fields as $field): ?>
86
+ <div class="field field-<?php echo $field['key']; ?>" data-id="<?php echo $field['key']; ?>">
87
  <div class="field_meta">
88
  <table class="acf widefat">
89
  <tr>
119
  <?php
120
  $this->parent->create_field(array(
121
  'type' => 'text',
122
+ 'name' => 'fields['.$field['key'].'][label]',
123
  'value' => $field['label'],
124
  'class' => 'label',
125
  ));
135
  <?php
136
  $this->parent->create_field(array(
137
  'type' => 'text',
138
+ 'name' => 'fields['.$field['key'].'][name]',
139
  'value' => $field['name'],
140
  'class' => 'name',
141
  ));
148
  <?php
149
  $this->parent->create_field(array(
150
  'type' => 'select',
151
+ 'name' => 'fields['.$field['key'].'][type]',
152
  'value' => $field['type'],
153
  'choices' => $fields_names,
154
  ));
162
  <?php
163
  $this->parent->create_field(array(
164
  'type' => 'textarea',
165
+ 'name' => 'fields['.$field['key'].'][instructions]',
166
  'value' => $field['instructions'],
167
  ));
168
  ?>
174
  <?php
175
  $this->parent->create_field(array(
176
  'type' => 'radio',
177
+ 'name' => 'fields['.$field['key'].'][required]',
178
  'value' => $field['required'],
179
  'choices' => array(
180
  '1' => __("Yes",'acf'),
187
  </tr>
188
  <?php
189
 
190
+ $this->parent->fields[$field['type']]->create_options($field['key'], $field);
191
 
192
  ?>
193
+ <tr class="conditional-logic" data-field_name="<?php echo $field['key']; ?>">
194
+ <td class="label"><label><?php _e("Conditional Logic",'acf'); ?></label></td>
195
+ <td>
196
+ <?php
197
+ $this->parent->create_field(array(
198
+ 'type' => 'radio',
199
+ 'name' => 'fields['.$field['key'].'][conditional_logic][status]',
200
+ 'value' => $field['conditional_logic']['status'],
201
+ 'choices' => array(
202
+ '1' => __("Yes",'acf'),
203
+ '0' => __("No",'acf'),
204
+ ),
205
+ 'layout' => 'horizontal',
206
+ ));
207
+ ?>
208
+ <div class="contional-logic-rules-wrapper" <?php if( $field['conditional_logic']['status'] == '0') echo 'style="display:none"'; ?>>
209
+
210
+ <?php
211
+
212
+ // set defaults
213
+ if( !$field['conditional_logic']['rules'] )
214
+ {
215
+ $field['conditional_logic']['rules'] = array(
216
+ array(
217
+ 'field' => '',
218
+ 'operator' => '==',
219
+ 'value' => ''
220
+ )
221
+ );
222
+ }
223
+
224
+ ?>
225
+ <table class="conditional-logic-rules widefat acf-rules <?php if( count($field['conditional_logic']['rules']) == 1) echo 'remove-disabled'; ?>">
226
+ <tbody>
227
+ <?php foreach( $field['conditional_logic']['rules'] as $rule_i => $rule ): ?>
228
+ <tr data-i="<?php echo $rule_i; ?>">
229
+ <td>
230
+ <input class="conditional-logic-field" type="hidden" name="fields[<?php echo $field['key']; ?>][conditional_logic][rules][<?php echo $rule_i; ?>][field]" value="<?php echo $rule['field']; ?>" />
231
+ </td>
232
+ <td width="25%">
233
+ <?php
234
+ $this->parent->create_field(array(
235
+ 'type' => 'select',
236
+ 'name' => 'fields['.$field['key'].'][conditional_logic][rules][' . $rule_i . '][operator]',
237
+ 'value' => $rule['operator'],
238
+ 'choices' => array(
239
+ '==' => __("is equal to",'acf'),
240
+ '!=' => __("is not equal to",'acf'),
241
+ ),
242
+ ));
243
+ ?>
244
+ </td>
245
+ <td><input class="conditional-logic-value" type="hidden" name="fields[<?php echo $field['key']; ?>][conditional_logic][rules][<?php echo $rule_i; ?>][value]" value="<?php echo $rule['value']; ?>" /></td>
246
+ <td class="buttons">
247
+ <a class="remove disabled" href="javascript:;"></a>
248
+ <a class="add" href="javascript:;"></a>
249
+ </td>
250
+ </tr>
251
+ <?php endforeach; ?>
252
+ </tbody>
253
+ </table>
254
+
255
+ <ul class="hl clearfix">
256
+ <li style="padding:4px 4px 0 0;"><?php _e("Show this field when",'acf'); ?></li>
257
+ <li><?php $this->parent->create_field(array(
258
+ 'type' => 'select',
259
+ 'name' => 'fields['.$field['key'].'][conditional_logic][allorany]',
260
+ 'value' => $field['conditional_logic']['allorany'],
261
+ 'choices' => array(
262
+ 'all' => __("all",'acf'),
263
+ 'any' => __("any",'acf'),
264
+ ),
265
+ )); ?></li>
266
+ <li style="padding:4px 0 0 4px;"><?php _e("these rules are met",'acf'); ?></li>
267
+ </ul>
268
+
269
+ </div>
270
+
271
+
272
+
273
+ </td>
274
+ </tr>
275
  <tr class="field_save">
276
  <td class="label"></td>
277
  <td>
core/views/meta_box_location.php CHANGED
@@ -37,10 +37,10 @@ if( empty($location['rules']) )
37
  </td>
38
  <td>
39
  <div class="location_rules">
40
- <table class="acf_input widefat" id="location_rules">
41
  <tbody>
42
  <?php foreach($location['rules'] as $k => $rule): ?>
43
- <tr>
44
  <td class="param"><?php
45
 
46
  $choices = array(
37
  </td>
38
  <td>
39
  <div class="location_rules">
40
+ <table class="acf_input widefat acf-rules <?php if( count($location['rules']) == 1) echo 'remove-disabled'; ?>" id="location_rules">
41
  <tbody>
42
  <?php foreach($location['rules'] as $k => $rule): ?>
43
+ <tr data-i="<?php echo $k; ?>">
44
  <td class="param"><?php
45
 
46
  $choices = array(
core/views/meta_box_options.php CHANGED
@@ -98,7 +98,10 @@ $options = $this->parent->get_acf_options($post->ID);
98
  'slug' => __("Slug"),
99
  'author' => __("Author"),
100
  'format' => __("Format"),
101
- 'featured_image' => __("Featured Image")
 
 
 
102
  )
103
  ));
104
 
98
  'slug' => __("Slug"),
99
  'author' => __("Author"),
100
  'format' => __("Format"),
101
+ 'featured_image' => __("Featured Image"),
102
+ 'categories' => __("Categories"),
103
+ 'tags' => __("Tags"),
104
+ 'send-trackbacks' => __("Send Trackbacks"),
105
  )
106
  ));
107
 
css/fields.css CHANGED
@@ -32,11 +32,25 @@
32
  text-decoration: none;
33
  }
34
 
35
- #minor-publishing,
36
- #misc-publishing-actions {
 
37
  display: none;
38
  }
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  .postbox {
41
  background: #FFFFFF;
42
  border: 1px solid #E1E1E1;
@@ -245,7 +259,7 @@ table.widefat.acf td {
245
  background: #FCFCFC;
246
  }
247
 
248
- .fields .field_clone {
249
  display: none;
250
  }
251
 
@@ -341,6 +355,11 @@ table.widefat.acf td {
341
  .field_save td {
342
  line-height: 25px;
343
  }
 
 
 
 
 
344
  /*---------------------------------------------------------------------------------------------
345
  Repeater
346
  ---------------------------------------------------------------------------------------------*/
@@ -427,33 +446,33 @@ td.operator {
427
 
428
  }
429
 
430
- table#location_rules {
431
 
432
  }
433
 
434
- table#location_rules tr {
435
 
436
  }
437
 
438
- table#location_rules tr td {
439
  padding: 4px;
440
  border: 0 none;
441
  }
442
 
443
- table#location_rules tr td:first-child {
444
  padding-left: 0;
445
  }
446
 
447
- table#location_rules tr td:last-child {
448
  padding-right: 0;
449
  }
450
 
451
- table#location_rules tr td.buttons {
452
  width: 40px;
453
  vertical-align: middle;
454
  }
455
 
456
- table#location_rules a.remove {
457
  display: block;
458
  width: 16px;
459
  height: 16px;
@@ -462,17 +481,17 @@ table#location_rules a.remove {
462
  margin-right: 4px;
463
  }
464
 
465
- table#location_rules a.remove:hover {
466
  background-position: 0 100%;
467
  }
468
 
469
- table#location_rules a.remove.disabled {
470
  opacity: 0.4;
471
  background-position: 0 0 !important;
472
  cursor: default;
473
  }
474
 
475
- table#location_rules a.add {
476
  display: block;
477
  width: 16px;
478
  height: 16px;
@@ -480,11 +499,11 @@ table#location_rules a.add {
480
  float: left;
481
  }
482
 
483
- table#location_rules a.add:hover {
484
  background-position: 0 100%;
485
  }
486
 
487
- table#location_rules .acf-loading {
488
  margin: 0 auto;
489
  margin-top: -2px;
490
  }
@@ -626,6 +645,7 @@ table.acf_input table.acf_cf_meta select {
626
  * Select with Optgroup
627
  *
628
  *---------------------------------------------------------------------------------------------*/
 
629
  #acf_fields select optgroup,
630
  #acf_location select optgroup {
631
  padding: 5px 2px;
@@ -650,4 +670,22 @@ table.acf_input table.acf_cf_meta select {
650
  #acf_fields select optgroup:nth-child(2n),
651
  #acf_location select optgroup:nth-child(2n) {
652
  background: #F9F9F9;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
653
  }
32
  text-decoration: none;
33
  }
34
 
35
+ #minor-publishing-actions,
36
+ #misc-publishing-actions #visibility,
37
+ #misc-publishing-actions .curtime {
38
  display: none;
39
  }
40
 
41
+ #minor-publishing {
42
+ border-bottom: 0 none;
43
+ }
44
+ #misc-pub-section {
45
+ border-bottom: 0 none;
46
+ }
47
+
48
+ #misc-publishing-actions .misc-pub-section {
49
+ border-bottom-color: #F5F5F5;
50
+ }
51
+
52
+
53
+
54
  .postbox {
55
  background: #FFFFFF;
56
  border: 1px solid #E1E1E1;
259
  background: #FCFCFC;
260
  }
261
 
262
+ .fields .field-field_clone {
263
  display: none;
264
  }
265
 
355
  .field_save td {
356
  line-height: 25px;
357
  }
358
+
359
+ .field_instructions textarea {
360
+ height: 70px;
361
+ }
362
+
363
  /*---------------------------------------------------------------------------------------------
364
  Repeater
365
  ---------------------------------------------------------------------------------------------*/
446
 
447
  }
448
 
449
+ table.acf-rules {
450
 
451
  }
452
 
453
+ table.acf-rules tbody tr {
454
 
455
  }
456
 
457
+ table.acf-rules tbody tr td {
458
  padding: 4px;
459
  border: 0 none;
460
  }
461
 
462
+ table.acf-rules tbody tr td:first-child {
463
  padding-left: 0;
464
  }
465
 
466
+ table.acf-rules tbody tr td:last-child {
467
  padding-right: 0;
468
  }
469
 
470
+ table.acf-rules tbody tr td.buttons {
471
  width: 40px;
472
  vertical-align: middle;
473
  }
474
 
475
+ table.acf-rules tbody a.remove {
476
  display: block;
477
  width: 16px;
478
  height: 16px;
481
  margin-right: 4px;
482
  }
483
 
484
+ table.acf-rules tbody a.remove:hover {
485
  background-position: 0 100%;
486
  }
487
 
488
+ table.acf-rules.remove-disabled tbody a.remove {
489
  opacity: 0.4;
490
  background-position: 0 0 !important;
491
  cursor: default;
492
  }
493
 
494
+ table.acf-rules tbody a.add {
495
  display: block;
496
  width: 16px;
497
  height: 16px;
499
  float: left;
500
  }
501
 
502
+ table.acf-rules tbody a.add:hover {
503
  background-position: 0 100%;
504
  }
505
 
506
+ table.acf-rules tbody .acf-loading {
507
  margin: 0 auto;
508
  margin-top: -2px;
509
  }
645
  * Select with Optgroup
646
  *
647
  *---------------------------------------------------------------------------------------------*/
648
+
649
  #acf_fields select optgroup,
650
  #acf_location select optgroup {
651
  padding: 5px 2px;
670
  #acf_fields select optgroup:nth-child(2n),
671
  #acf_location select optgroup:nth-child(2n) {
672
  background: #F9F9F9;
673
+ }
674
+
675
+
676
+ /*---------------------------------------------------------------------------------------------
677
+ *
678
+ * Conditional Logic
679
+ *
680
+ *---------------------------------------------------------------------------------------------*/
681
+
682
+ table.conditional-logic-rules {
683
+ background: transparent;
684
+ border: 0 none;
685
+ border-radius: 0;
686
+ }
687
+
688
+ table.conditional-logic-rules tbody td {
689
+ background: transparent;
690
+ border: 0 none;
691
  }
css/global.css CHANGED
@@ -272,14 +272,18 @@ ul.checkbox_list input {
272
  a.acf-button,
273
  input[type="submit"].acf-button {
274
  display: block;
275
- border-radius: 4px;
276
 
277
- background: #2c8bbe;
278
- background-image: -webkit-gradient(linear, left top, left bottom, from(#2c8bbe), to(#246f99)); /* Safari 4+, Chrome */
279
- background-image: -webkit-linear-gradient(top, #2c8bbe, #246f99); /* Chrome 10+, Safari 5.1+, iOS 5+ */
280
- background-image: -moz-linear-gradient(top, #2c8bbe, #246f99); /* Firefox 3.6-15 */
281
- background-image: -o-linear-gradient(top, #2c8bbe, #246f99); /* Opera 11.10+ */
282
- background-image: linear-gradient(to bottom, #2c8bbe, #246f99); /* Firefox 16+ */
 
 
 
 
283
 
284
  color: #FFFFFF;
285
  font-weight: normal;
@@ -287,8 +291,7 @@ input[type="submit"].acf-button {
287
  font-size: 13px;
288
  line-height: 1em;
289
  padding: 6px 11px;
290
- border: 0 none;
291
- box-shadow: 0 1px 3px rgba(0,0,0,0.2);
292
  cursor: pointer;
293
  position: relative;
294
  text-align: center;
@@ -297,14 +300,19 @@ input[type="submit"].acf-button {
297
 
298
  a.acf-button:hover,
299
  input[type="submit"].acf-button:hover {
300
- box-shadow: 0 1px 3px rgba(0,0,0,0.4);
301
-
302
- background: #3b97c9;
303
  background-image: -webkit-gradient(linear, left top, left bottom, from(#3b97c9), to(#246f99)); /* Safari 4+, Chrome */
304
  background-image: -webkit-linear-gradient(top, #3b97c9, #246f99); /* Chrome 10+, Safari 5.1+, iOS 5+ */
305
  background-image: -moz-linear-gradient(top, #3b97c9, #246f99); /* Firefox 3.6-15 */
306
  background-image: -o-linear-gradient(top, #3b97c9, #246f99); /* Opera 11.10+ */
307
  background-image: linear-gradient(to bottom, #3b97c9, #246f99); /* Firefox 16+ */
 
 
 
 
 
 
308
  }
309
 
310
  a.acf-button:active,
@@ -316,9 +324,12 @@ input[type="submit"].acf-button:active {
316
 
317
  a.acf-button.grey,
318
  input[type="submit"].acf-button.grey {
 
319
  text-shadow: 0 1px 0 #fff;
320
  color: #454545;
321
 
 
 
322
  background: #fff;
323
  background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#ececec)); /* Safari 4+, Chrome */
324
  background-image: -webkit-linear-gradient(top, #ffffff, #ececec); /* Chrome 10+, Safari 5.1+, iOS 5+ */
@@ -328,6 +339,13 @@ input[type="submit"].acf-button.grey {
328
 
329
  }
330
 
 
 
 
 
 
 
 
331
  a.acf-button[disabled],
332
  .disabled a.acf-button,
333
  input[type="submit"].acf-button[disabled] {
272
  a.acf-button,
273
  input[type="submit"].acf-button {
274
  display: block;
275
+ border-radius: 3px;
276
 
277
+ border: #21759B solid 1px;
278
+ border-color: #21759B #21759B #1E6A8D;
279
+
280
+
281
+ background: #21759B;
282
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#2A95C5), to(#21759B)); /* Safari 4+, Chrome */
283
+ background-image: -webkit-linear-gradient(top, #2A95C5, #21759B); /* Chrome 10+, Safari 5.1+, iOS 5+ */
284
+ background-image: -moz-linear-gradient(top, #2A95C5, #21759B); /* Firefox 3.6-15 */
285
+ background-image: -o-linear-gradient(top, #2A95C5, #21759B); /* Opera 11.10+ */
286
+ background-image: linear-gradient(to bottom, #2A95C5, #21759B); /* Firefox 16+ */
287
 
288
  color: #FFFFFF;
289
  font-weight: normal;
291
  font-size: 13px;
292
  line-height: 1em;
293
  padding: 6px 11px;
294
+ box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 1px 0 rgba(120, 200, 230, 0.5) inset;
 
295
  cursor: pointer;
296
  position: relative;
297
  text-align: center;
300
 
301
  a.acf-button:hover,
302
  input[type="submit"].acf-button:hover {
303
+
304
+ background-color: #3b97c9;
 
305
  background-image: -webkit-gradient(linear, left top, left bottom, from(#3b97c9), to(#246f99)); /* Safari 4+, Chrome */
306
  background-image: -webkit-linear-gradient(top, #3b97c9, #246f99); /* Chrome 10+, Safari 5.1+, iOS 5+ */
307
  background-image: -moz-linear-gradient(top, #3b97c9, #246f99); /* Firefox 3.6-15 */
308
  background-image: -o-linear-gradient(top, #3b97c9, #246f99); /* Opera 11.10+ */
309
  background-image: linear-gradient(to bottom, #3b97c9, #246f99); /* Firefox 16+ */
310
+
311
+ border-color: #1B607F;
312
+
313
+ color: #FFFFFF;
314
+
315
+ box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 0 rgba(120, 200, 230, 0.6) inset;
316
  }
317
 
318
  a.acf-button:active,
324
 
325
  a.acf-button.grey,
326
  input[type="submit"].acf-button.grey {
327
+ border-color: #bbb;
328
  text-shadow: 0 1px 0 #fff;
329
  color: #454545;
330
 
331
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 1px rgba(255, 255, 255, 1) inset;
332
+
333
  background: #fff;
334
  background-image: -webkit-gradient(linear, left top, left bottom, from(#ffffff), to(#ececec)); /* Safari 4+, Chrome */
335
  background-image: -webkit-linear-gradient(top, #ffffff, #ececec); /* Chrome 10+, Safari 5.1+, iOS 5+ */
339
 
340
  }
341
 
342
+ a.acf-button.grey:hover,
343
+ input[type="submit"].acf-button.grey:hover {
344
+ border-color: #aaa;
345
+
346
+ box-shadow: 0 1px 3px rgba(0,0,0,0.2), 0 1px 1px rgba(255, 255, 255, 1) inset;
347
+ }
348
+
349
  a.acf-button[disabled],
350
  .disabled a.acf-button,
351
  input[type="submit"].acf-button[disabled] {
css/input.css CHANGED
@@ -2,6 +2,15 @@
2
  Post Box
3
  ---------------------------------------------------------------------------------------------*/
4
 
 
 
 
 
 
 
 
 
 
5
  #poststuff .acf_postbox .widefat th,
6
  #poststuff .acf_postbox .widefat td {
7
  overflow: visible;
@@ -316,7 +325,6 @@
316
 
317
  .acf-file-uploader img {
318
  margin: 0 5px 0 0;
319
- height:
320
  }
321
 
322
  .acf-file-uploader input.button {
@@ -1096,10 +1104,13 @@ ul.checkbox_list {
1096
  font-size: 12px;
1097
  line-height: 1em;
1098
  position: relative;
 
1099
  }
1100
 
1101
- .acf-gallery .toolbar li:hover,
1102
- .acf-gallery .toolbar li.active {
 
 
1103
  background-color: #F9F9F9;
1104
  background-image: -webkit-gradient(linear, left top, left bottom, from(#ECECEC), to(#F9F9F9)); /* Saf4+, Chrome */
1105
  background-image: -webkit-linear-gradient(top, #ECECEC, #F9F9F9); /* Chrome 10+, Saf5.1+, iOS 5+ */
@@ -1108,12 +1119,8 @@ ul.checkbox_list {
1108
  background-image: linear-gradient(to bottom, #ECECEC, #F9F9F9);
1109
  }
1110
 
1111
- .acf-gallery .toolbar li.count-li:hover {
1112
- background: transparent;
1113
- }
1114
-
1115
- .acf-gallery .toolbar li a,
1116
- .acf-gallery .toolbar li span {
1117
  display: block;
1118
  padding: 1em;
1119
 
@@ -1123,7 +1130,7 @@ ul.checkbox_list {
1123
  text-decoration: none;
1124
  }
1125
 
1126
- .acf-gallery .toolbar li span {
1127
  color: #8d8d8d;
1128
  }
1129
 
@@ -1169,6 +1176,10 @@ ul.checkbox_list {
1169
  margin-left: -36px;
1170
  }
1171
 
 
 
 
 
1172
 
1173
  /*
1174
  * Hover
2
  Post Box
3
  ---------------------------------------------------------------------------------------------*/
4
 
5
+
6
+ #poststuff .acf_postbox {
7
+ display: block;
8
+ }
9
+
10
+ #poststuff .acf_postbox.acf-hidden {
11
+ display: none !important;
12
+ }
13
+
14
  #poststuff .acf_postbox .widefat th,
15
  #poststuff .acf_postbox .widefat td {
16
  overflow: visible;
325
 
326
  .acf-file-uploader img {
327
  margin: 0 5px 0 0;
 
328
  }
329
 
330
  .acf-file-uploader input.button {
1104
  font-size: 12px;
1105
  line-height: 1em;
1106
  position: relative;
1107
+ min-height: 36px;
1108
  }
1109
 
1110
+ .acf-gallery .toolbar li.view-grid-li:hover,
1111
+ .acf-gallery .toolbar li.view-grid-li.active,
1112
+ .acf-gallery .toolbar li.view-list-li:hover,
1113
+ .acf-gallery .toolbar li.view-list-li.active {
1114
  background-color: #F9F9F9;
1115
  background-image: -webkit-gradient(linear, left top, left bottom, from(#ECECEC), to(#F9F9F9)); /* Saf4+, Chrome */
1116
  background-image: -webkit-linear-gradient(top, #ECECEC, #F9F9F9); /* Chrome 10+, Saf5.1+, iOS 5+ */
1119
  background-image: linear-gradient(to bottom, #ECECEC, #F9F9F9);
1120
  }
1121
 
1122
+ .acf-gallery .toolbar li.gallery-li a,
1123
+ .acf-gallery .toolbar li.gallery-li span {
 
 
 
 
1124
  display: block;
1125
  padding: 1em;
1126
 
1130
  text-decoration: none;
1131
  }
1132
 
1133
+ .acf-gallery .toolbar li.gallery-li span {
1134
  color: #8d8d8d;
1135
  }
1136
 
1176
  margin-left: -36px;
1177
  }
1178
 
1179
+ .acf-gallery .toolbar .acf-button {
1180
+ margin: 4px 0 0 4px;
1181
+ }
1182
+
1183
 
1184
  /*
1185
  * Hover
js/fields.js CHANGED
@@ -1,3 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
1
  (function($){
2
 
3
  /*
@@ -17,13 +28,56 @@
17
  * uniqid
18
  *
19
  * @since 3.1.6
20
- * @description Returns a unique ID (secconds of time)
21
  */
22
 
23
- function uniqid()
24
  {
25
- var newDate = new Date;
26
- return newDate.getTime();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
29
 
@@ -36,7 +90,7 @@
36
 
37
  $('#submit-delete').live('click', function(){
38
 
39
- var response = confirm(acf_messages.move_to_trash);
40
  if(!response)
41
  {
42
  return false;
@@ -73,8 +127,17 @@
73
  // hide current options
74
  tbody.children('tr.field_option').hide().find('[name]').attr('disabled', 'true');
75
 
 
76
  // append tr
77
- tbody.children('tr.field_save').before(tr);
 
 
 
 
 
 
 
 
78
 
79
  var ajax_data = {
80
  action : "acf_field_options",
@@ -96,29 +159,39 @@
96
  });
97
  }
98
 
99
-
100
-
101
  });
102
 
103
 
104
-
105
- /*----------------------------------------------------------------------
106
- *
107
- * Update Names
108
  *
109
- *---------------------------------------------------------------------*/
110
-
 
 
 
111
  $.fn.update_names = function()
112
  {
113
- var field = $(this);
114
- var old_id = field.attr('data-id');
115
- var new_id = uniqid();
116
 
117
 
118
  // give field a new id
119
  field.attr('data-id', new_id);
120
 
121
 
 
 
 
 
 
 
 
 
 
 
 
122
  field.find('[name]').each(function()
123
  {
124
 
@@ -141,11 +214,13 @@
141
  }
142
 
143
 
144
- /*----------------------------------------------------------------------
145
- *
146
- * Update Order Numbers
147
  *
148
- *---------------------------------------------------------------------*/
 
 
 
149
 
150
  function update_order_numbers(){
151
 
@@ -158,334 +233,386 @@
158
  }
159
 
160
 
161
- /*----------------------------------------------------------------------
162
- *
163
- * setup_fields
164
  *
165
- *---------------------------------------------------------------------*/
166
-
167
- function setup_fields()
168
- {
169
-
170
- // add edit button functionality
171
- $('#acf_fields a.acf_edit_field').live('click', function(){
172
-
173
- var field = $(this).closest('.field');
174
-
175
- if(field.hasClass('form_open'))
176
- {
177
- field.removeClass('form_open');
178
- }
179
- else
180
- {
181
- field.addClass('form_open');
182
- }
183
-
184
- field.children('.field_form_mask').animate({'height':'toggle'}, 500);
185
 
186
- });
187
-
188
 
189
- // add delete button functionality
190
- $('#acf_fields a.acf_delete_field').live('click', function(){
191
-
192
- var field = $(this).closest('.field');
193
- var fields = field.closest('.fields');
194
- var temp = $('<div style="height:' + field.height() + 'px"></div>');
195
- //field.css({'-moz-transform' : 'translate(50px, 0)', 'opacity' : 0, '-moz-transition' : 'all 250ms ease-out'});
196
- field.animate({'left' : '50px', 'opacity' : 0}, 250, function(){
197
- field.before(temp);
198
- field.remove();
199
-
200
- temp.animate({'height' : 0 }, 250, function(){
201
- temp.remove();
202
- })
203
-
204
- update_order_numbers();
205
-
206
- if(!fields.children('.field').exists())
207
- {
208
- // no more fields, show the message
209
- fields.children('.no_fields_message').show();
210
- }
211
-
212
- });
213
-
214
-
215
-
216
- });
217
 
 
218
 
219
- // add delete button functionality
220
- $('#acf_fields a.acf_duplicate_field').live('click', function(){
221
-
222
-
223
- // vars
224
- var field = $(this).closest('.field');
225
- var orig_type = field.find('tr.field_type select').val();
226
- var new_field = field.clone();
227
-
228
-
229
- // update names
230
- new_field.children('input[type="hidden"]').remove();
231
- new_field.update_names();
232
-
233
-
234
- // add new field
235
- field.after( new_field );
236
-
237
-
238
- // open up form
239
- new_field.find('a.acf_edit_field').first().trigger('click');
240
- //console.log( new_field.find('tr.field_type select').first() );
241
- new_field.find('tr.field_type select').first().val( orig_type ).trigger('change');
242
-
243
-
244
- // update order numbers
245
- update_order_numbers();
246
-
247
- });
248
 
249
-
 
 
 
 
 
 
 
 
 
 
 
250
 
251
- // Add Field Button
252
- $('#acf_fields #add_field').live('click',function(){
253
-
254
- var table_footer = $(this).closest('.table_footer');
255
- var fields = table_footer.siblings('.fields');
256
 
257
 
258
- // clone last tr
259
- var new_field = fields.children('.field_clone').clone();
260
- new_field.removeClass('field_clone').addClass('field');
261
 
 
 
262
 
263
- // update input names
264
- if(new_field.hasClass('sub_field'))
 
265
  {
266
-
267
- // it is a sub field
268
- //console.log(fields.parents('.fields').last());
269
- //var field_length = fields.parents('.fields').last().children('.field').length;
270
- //var sub_field_length = fields.children('.field').length;
271
- //alert(sub_field_length);
272
- //alert('update numbers for sub field! field:'+field_length+', sub:'+sub_field_length);
273
-
274
- new_field.update_names();
275
  }
276
  else
277
  {
278
- //var field_length = fields.children('.field').length;
279
- new_field.update_names();
280
-
281
- //alert('update numbers for field! field:'+field_length);
282
- }
283
-
284
-
285
- // append to table
286
- fields.children('.field_clone').before(new_field);
287
- //fields.append(new_field);
288
-
289
-
290
- // remove no fields message
291
- if(fields.children('.no_fields_message').exists())
292
- {
293
- fields.children('.no_fields_message').hide();
294
  }
295
 
296
- // clear name
297
- new_field.find('.field_form input[type="text"]').val('');
298
- new_field.find('.field_form input[type="text"]').first().focus();
299
- new_field.find('tr.field_type select').trigger('change');
300
-
301
- // open up form
302
- new_field.find('a.acf_edit_field').first().trigger('click');
303
-
304
-
305
- // update order numbers
306
  update_order_numbers();
307
 
308
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
309
 
310
 
311
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
312
 
313
 
 
 
314
 
315
- // Auto complete field name
316
- $('#acf_fields tr.field_label input.label').live('blur', function()
 
317
  {
318
- var label = $(this);
319
- var name = $(this).closest('tr').siblings('tr.field_name').find('input.name');
 
 
 
 
 
 
 
 
 
 
320
 
321
- if(name.val() == '')
322
- {
323
- var val = label.val().toLowerCase().split(' ').join('_').split('\'').join('');
324
- name.val(val);
325
- name.trigger('keyup');
326
- }
327
- });
328
 
 
 
329
 
330
- // update field meta
331
- $('#acf_fields .field_form tr.field_label input.label').live('keyup', function()
332
- {
333
- var val = $(this).val();
334
- var name = $(this).closest('.field').find('td.field_label strong a').first().html(val);
335
- });
336
- $('.field_form tr.field_name input.name').live('keyup', function()
 
 
 
 
 
 
 
 
 
 
 
 
 
337
  {
338
- var val = $(this).val();
339
- var name = $(this).closest('.field').find('td.field_name').first().html(val);
340
- });
341
- $('.field_form tr.field_type select').live('change', function()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
342
  {
343
- var val = $(this).val();
344
- var label = $(this).find('option[value="' + val + '"]').html();
345
-
346
- // update field type (if not a clone field)
347
- if($(this).closest('.field_clone').length == 0)
348
- {
349
- $(this).closest('.field').find('td.field_type').first().html(label);
350
- }
351
-
352
- });
353
 
 
 
 
 
 
354
 
355
- // sortable
356
- $('#acf_fields td.field_order').live('mouseover', function(){
357
-
358
- var fields = $(this).closest('.fields');
359
-
360
- if(fields.hasClass('sortable')) return false;
361
-
362
- fields.addClass('sortable').sortable({
363
- update: function(event, ui){
364
- update_order_numbers();
365
- },
366
- handle: 'td.field_order',
367
- axis: "y",
368
- revert: true
369
- });
370
- });
371
 
372
- }
 
 
 
 
 
 
 
 
 
 
373
 
374
 
375
- /*----------------------------------------------------------------------
376
- *
377
- * setup_rules
378
  *
379
- *---------------------------------------------------------------------*/
 
 
 
380
 
381
- function setup_rules()
382
- {
383
  // vars
384
- var location_rules = $('table#location_rules');
385
 
386
 
387
  // does it have options?
388
- if(!location_rules.find('td.param select option[value="options_page"]').exists())
389
  {
390
  var html = $('#acf_location_options_deactivated').html();
391
  location_rules.find('td.param select').append( html );
392
 
393
  }
394
 
 
 
 
 
 
 
 
 
 
 
 
 
395
 
396
- // show field type options
397
- location_rules.find('td.param select').live('change', function(){
398
-
399
- // vars
400
- var tr = $(this).closest('tr');
401
- var key = $(this).attr('name').split("]["); key = key[1];
402
- var ajax_data = {
403
  'action' : "acf_location",
404
- 'key' : key,
405
  'value' : '',
406
  'param' : $(this).val()
407
  };
408
-
409
-
410
- // add loading gif
411
- var div = $('<div class="acf-loading"></div>');
412
- tr.find('td.value').html(div);
413
-
414
-
415
- // load location html
416
- $.ajax({
417
- url: ajaxurl,
418
- data: ajax_data,
419
- type: 'post',
420
- dataType: 'html',
421
- success: function(html){
422
 
423
- div.replaceWith(html);
424
 
425
- }
426
- });
427
-
428
-
429
  });
430
 
431
 
432
- // Add Button
433
- location_rules.find('td.buttons a.add').live('click',function(){
434
-
435
- var tr = $(this).closest('tr').clone();
436
-
437
- $(this).closest('tr').after(tr);
438
-
439
- update_location_names();
440
-
441
- location_rules.find('td.buttons a.remove').removeClass('disabled');
442
-
443
- return false;
444
 
445
- });
 
 
 
 
446
 
447
 
448
- // Remove Button
449
- location_rules.find('td.buttons a.remove').live('click',function(){
450
 
451
- if($(this).hasClass('disabled'))
452
- {
453
- return false;
454
- }
455
 
456
- var tr = $(this).closest('tr').remove();
457
 
458
- if(location_rules.find('tr').length <= 1)
459
- {
460
- location_rules.find('td.buttons a.remove').addClass('disabled');
461
- }
462
 
463
- return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
 
465
- });
466
 
467
- if(location_rules.find('tr').length <= 1)
 
468
  {
469
- location_rules.find('td.buttons a.remove').addClass('disabled');
470
  }
471
 
472
- function update_location_names()
 
 
 
 
 
 
473
  {
474
- location_rules.find('tr').each(function(i){
475
-
476
- $(this).find('[name]').each(function(){
477
-
478
- var name = $(this).attr('name').split("][");
479
-
480
- var new_name = name[0] + "][" + i + "][" + name[2];
481
-
482
- $(this).attr('name', new_name).attr('id', new_name);
483
- });
484
-
485
- })
486
  }
487
 
488
- }
 
 
 
 
489
 
490
  /*----------------------------------------------------------------------
491
  *
@@ -499,10 +626,6 @@
499
  $('#submitdiv #publish').attr('class', 'acf-button');
500
  $('#submitdiv a.submitdelete').attr('class', 'delete-field-group').attr('id', 'submit-delete');
501
 
502
- // setup fields
503
- setup_fields();
504
- setup_rules();
505
-
506
  });
507
 
508
 
@@ -522,11 +645,13 @@
522
  $('#acf_fields .acf_fc_add').live('click', function(){
523
 
524
  // vars
525
- var tr = $(this).closest('tr.field_option_flexible_content');
526
- var new_tr = $(this).closest('.field_form').find('tr.field_option_flexible_content:first').clone(false);
 
 
527
 
528
  // remove sub fields
529
- new_tr.find('.sub_field.field').remove();
530
 
531
  // show add new message
532
  new_tr.find('.no_fields_message').show();
@@ -540,12 +665,15 @@
540
 
541
  new_tr.find('[name]').each(function(){
542
 
543
- var name = $(this).attr('name').replace('[layouts][0]','[layouts]['+new_id+']');
544
  $(this).attr('name', name);
545
  $(this).attr('id', name);
546
 
547
  });
548
 
 
 
 
549
  // add new tr
550
  tr.after(new_tr);
551
 
@@ -656,5 +784,318 @@
656
 
657
  });
658
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
659
 
660
  })(jQuery);
1
+ var acf = {
2
+
3
+ text : {
4
+ 'move_to_trash' : "Move to trash. Are you sure?",
5
+ 'checked' : 'checked',
6
+ 'conditional_no_fields' : 'No "toggle" fields avilable'
7
+ },
8
+ fields : []
9
+
10
+ };
11
+
12
  (function($){
13
 
14
  /*
28
  * uniqid
29
  *
30
  * @since 3.1.6
31
+ * @description Returns a unique ID (http://phpjs.org/functions/uniqid/)
32
  */
33
 
34
+ function uniqid(prefix, more_entropy)
35
  {
36
+ // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
37
+ // + revised by: Kankrelune (http://www.webfaktory.info/)
38
+ // % note 1: Uses an internal counter (in php_js global) to avoid collision
39
+ // * example 1: uniqid();
40
+ // * returns 1: 'a30285b160c14'
41
+ // * example 2: uniqid('foo');
42
+ // * returns 2: 'fooa30285b1cd361'
43
+ // * example 3: uniqid('bar', true);
44
+ // * returns 3: 'bara20285b23dfd1.31879087'
45
+ if (typeof prefix == 'undefined') {
46
+ prefix = "";
47
+ }
48
+
49
+ var retId;
50
+ var formatSeed = function (seed, reqWidth) {
51
+ seed = parseInt(seed, 10).toString(16); // to hex str
52
+ if (reqWidth < seed.length) { // so long we split
53
+ return seed.slice(seed.length - reqWidth);
54
+ }
55
+ if (reqWidth > seed.length) { // so short we pad
56
+ return Array(1 + (reqWidth - seed.length)).join('0') + seed;
57
+ }
58
+ return seed;
59
+ };
60
+
61
+ // BEGIN REDUNDANT
62
+ if (!this.php_js) {
63
+ this.php_js = {};
64
+ }
65
+ // END REDUNDANT
66
+ if (!this.php_js.uniqidSeed) { // init seed with big random int
67
+ this.php_js.uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
68
+ }
69
+ this.php_js.uniqidSeed++;
70
+
71
+ retId = prefix; // start with prefix, add current milliseconds hex string
72
+ retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8);
73
+ retId += formatSeed(this.php_js.uniqidSeed, 5); // add seed hex string
74
+ if (more_entropy) {
75
+ // for more entropy we add a float lower to 10
76
+ retId += (Math.random() * 10).toFixed(8).toString();
77
+ }
78
+
79
+ return retId;
80
+
81
  }
82
 
83
 
90
 
91
  $('#submit-delete').live('click', function(){
92
 
93
+ var response = confirm(acf.text.move_to_trash);
94
  if(!response)
95
  {
96
  return false;
127
  // hide current options
128
  tbody.children('tr.field_option').hide().find('[name]').attr('disabled', 'true');
129
 
130
+
131
  // append tr
132
+ if( tbody.children('tr.conditional-logic').exists() )
133
+ {
134
+ tbody.children('tr.conditional-logic').before(tr);
135
+ }
136
+ else
137
+ {
138
+ tbody.children('tr.field_save').before(tr);
139
+ }
140
+
141
 
142
  var ajax_data = {
143
  action : "acf_field_options",
159
  });
160
  }
161
 
 
 
162
  });
163
 
164
 
165
+ /*
166
+ * Update Names
 
 
167
  *
168
+ * @description:
169
+ * @since 3.5.1
170
+ * @created: 15/10/12
171
+ */
172
+
173
  $.fn.update_names = function()
174
  {
175
+ var field = $(this),
176
+ old_id = field.attr('data-id'),
177
+ new_id = 'field_' + uniqid();
178
 
179
 
180
  // give field a new id
181
  field.attr('data-id', new_id);
182
 
183
 
184
+ // update class
185
+ var new_class = field.attr('class');
186
+ new_class = new_class.replace(old_id, new_id);
187
+ field.attr('class', new_class);
188
+
189
+
190
+ // update field key column
191
+ field.find('.field_meta td.field_key').text( new_id );
192
+
193
+
194
+ // update inputs
195
  field.find('[name]').each(function()
196
  {
197
 
214
  }
215
 
216
 
217
+ /*
218
+ * update_order_numbers
 
219
  *
220
+ * @description:
221
+ * @since 3.5.1
222
+ * @created: 15/10/12
223
+ */
224
 
225
  function update_order_numbers(){
226
 
233
  }
234
 
235
 
236
+ /*
237
+ * Edit Field
 
238
  *
239
+ * @description:
240
+ * @since 3.5.1
241
+ * @created: 13/10/12
242
+ */
243
+
244
+ $('#acf_fields a.acf_edit_field').live('click', function(){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
 
246
+ var field = $(this).closest('.field');
 
247
 
248
+ if( field.hasClass('form_open') )
249
+ {
250
+ field.removeClass('form_open');
251
+ $(document).trigger('acf/field_form-close', field);
252
+ }
253
+ else
254
+ {
255
+ field.addClass('form_open');
256
+ $(document).trigger('acf/field_form-open', field);
257
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
258
 
259
+ field.children('.field_form_mask').animate({'height':'toggle'}, 500);
260
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
 
262
+ });
263
+
264
+
265
+ /*
266
+ * Delete Field
267
+ *
268
+ * @description:
269
+ * @since 3.5.1
270
+ * @created: 13/10/12
271
+ */
272
+
273
+ $('#acf_fields a.acf_delete_field').live('click', function(){
274
 
275
+ // vars
276
+ var a = $(this),
277
+ field = a.closest('.field'),
278
+ fields = field.closest('.fields'),
279
+ temp = $('<div style="height:' + field.height() + 'px"></div>');
280
 
281
 
282
+ // fade away
283
+ field.animate({'left' : '50px', 'opacity' : 0}, 250, function(){
 
284
 
285
+ field.before(temp);
286
+ field.remove();
287
 
288
+
289
+ // no more fields, show the message
290
+ if( fields.children('.field').length <= 1 )
291
  {
292
+ temp.remove();
293
+ fields.children('.no_fields_message').show();
 
 
 
 
 
 
 
294
  }
295
  else
296
  {
297
+ temp.animate({'height' : 0 }, 250, function(){
298
+ temp.remove();
299
+ })
 
 
 
 
 
 
 
 
 
 
 
 
 
300
  }
301
 
 
 
 
 
 
 
 
 
 
 
302
  update_order_numbers();
303
 
304
+ });
305
+
306
+
307
+ });
308
+
309
+
310
+ /*
311
+ * Duplicate Field
312
+ *
313
+ * @description:
314
+ * @since 3.5.1
315
+ * @created: 13/10/12
316
+ */
317
+
318
+ $('#acf_fields a.acf_duplicate_field').live('click', function(){
319
+
320
+ // vars
321
+ var a = $(this),
322
+ field = a.closest('.field'),
323
+ orig_type = field.find('tr.field_type select').val(),
324
+ new_field = field.clone();
325
 
326
 
327
+
328
+ // update names
329
+ new_field.update_names();
330
+
331
+
332
+ // add new field
333
+ field.after( new_field );
334
+
335
+
336
+ // open up form
337
+ new_field.find('a.acf_edit_field').first().trigger('click');
338
+ new_field.find('tr.field_type select').first().val( orig_type ).trigger('change');
339
+
340
+
341
+ // update order numbers
342
+ update_order_numbers();
343
+
344
+ });
345
+
346
+
347
+ /*
348
+ * Add Field
349
+ *
350
+ * @description:
351
+ * @since 3.5.1
352
+ * @created: 13/10/12
353
+ */
354
+
355
+ $('#acf_fields #add_field').live('click',function(){
356
+
357
+ var table_footer = $(this).closest('.table_footer');
358
+ var fields = table_footer.siblings('.fields');
359
+
360
+
361
+ // clone last tr
362
+ var new_field = fields.children('.field-field_clone').clone();
363
+
364
+
365
+ // update names
366
+ new_field.update_names();
367
 
368
 
369
+ // append to table
370
+ fields.children('.field-field_clone').before(new_field);
371
 
372
+
373
+ // remove no fields message
374
+ if(fields.children('.no_fields_message').exists())
375
  {
376
+ fields.children('.no_fields_message').hide();
377
+ }
378
+
379
+
380
+ // clear name
381
+ new_field.find('.field_form input[type="text"]').val('');
382
+ new_field.find('.field_form input[type="text"]').first().focus();
383
+ new_field.find('tr.field_type select').trigger('change');
384
+
385
+
386
+ // open up form
387
+ new_field.find('a.acf_edit_field').first().trigger('click');
388
 
 
 
 
 
 
 
 
389
 
390
+ // update order numbers
391
+ update_order_numbers();
392
 
393
+ return false;
394
+
395
+
396
+ });
397
+
398
+
399
+ /*
400
+ * Auto Complete Field Name
401
+ *
402
+ * @description:
403
+ * @since 3.5.1
404
+ * @created: 15/10/12
405
+ */
406
+
407
+ $('#acf_fields tr.field_label input.label').live('blur', function()
408
+ {
409
+ var label = $(this);
410
+ var name = $(this).closest('tr').siblings('tr.field_name').find('input.name');
411
+
412
+ if(name.val() == '')
413
  {
414
+ var val = label.val().toLowerCase().split(' ').join('_').split('\'').join('');
415
+ name.val(val);
416
+ name.trigger('keyup');
417
+ }
418
+ });
419
+
420
+
421
+ /*
422
+ * Update field meta
423
+ *
424
+ * @description:
425
+ * @since 3.5.1
426
+ * @created: 15/10/12
427
+ */
428
+
429
+ $('#acf_fields .field_form tr.field_label input.label').live('keyup', function()
430
+ {
431
+ var val = $(this).val();
432
+ var name = $(this).closest('.field').find('td.field_label strong a').first().html(val);
433
+ });
434
+ $('#acf_fields .field_form tr.field_name input.name').live('keyup', function()
435
+ {
436
+ var val = $(this).val();
437
+ var name = $(this).closest('.field').find('td.field_name').first().html(val);
438
+ });
439
+ $('#acf_fields .field_form tr.field_type select').live('change', function()
440
+ {
441
+ var val = $(this).val();
442
+ var label = $(this).find('option[value="' + val + '"]').html();
443
+
444
+ // update field type (if not a clone field)
445
+ if($(this).closest('.field_clone').length == 0)
446
  {
447
+ $(this).closest('.field').find('td.field_type').first().html(label);
448
+ }
 
 
 
 
 
 
 
 
449
 
450
+ });
451
+
452
+
453
+ // sortable
454
+ $('#acf_fields td.field_order').live('mouseover', function(){
455
 
456
+ var fields = $(this).closest('.fields');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
457
 
458
+ if(fields.hasClass('sortable')) return false;
459
+
460
+ fields.addClass('sortable').sortable({
461
+ update: function(event, ui){
462
+ update_order_numbers();
463
+ },
464
+ handle: 'td.field_order',
465
+ axis: "y",
466
+ revert: true
467
+ });
468
+ });
469
 
470
 
471
+ /*
472
+ * Setup Location Rules
 
473
  *
474
+ * @description:
475
+ * @since 3.5.1
476
+ * @created: 15/10/12
477
+ */
478
 
479
+ $(document).ready(function(){
480
+
481
  // vars
482
+ var location_rules = $('#location_rules');
483
 
484
 
485
  // does it have options?
486
+ if( !location_rules.find('td.param select option[value="options_page"]').exists() )
487
  {
488
  var html = $('#acf_location_options_deactivated').html();
489
  location_rules.find('td.param select').append( html );
490
 
491
  }
492
 
493
+ });
494
+
495
+
496
+ /*
497
+ * Location Rules Change
498
+ *
499
+ * @description:
500
+ * @since 3.5.1
501
+ * @created: 15/10/12
502
+ */
503
+
504
+ $('#location_rules .param select').live('change', function(){
505
 
506
+ // vars
507
+ var tr = $(this).closest('tr'),
508
+ i = tr.attr('data-i'),
509
+ ajax_data = {
 
 
 
510
  'action' : "acf_location",
511
+ 'key' : i,
512
  'value' : '',
513
  'param' : $(this).val()
514
  };
515
+
516
+
517
+ // add loading gif
518
+ var div = $('<div class="acf-loading"></div>');
519
+ tr.find('td.value').html(div);
520
+
521
+
522
+ // load location html
523
+ $.ajax({
524
+ url: ajaxurl,
525
+ data: ajax_data,
526
+ type: 'post',
527
+ dataType: 'html',
528
+ success: function(html){
529
 
530
+ div.replaceWith(html);
531
 
532
+ }
 
 
 
533
  });
534
 
535
 
536
+ });
537
+
538
+
539
+ /*
540
+ * Location Rules add
541
+ *
542
+ * @description:
543
+ * @since 3.5.1
544
+ * @created: 15/10/12
545
+ */
546
+
547
+ $('#location_rules a.add').live('click',function(){
548
 
549
+ // vars
550
+ var old_tr = $(this).closest('tr'),
551
+ new_tr = old_tr.clone(),
552
+ old_i = parseFloat( new_tr.attr('data-i') ),
553
+ new_i = old_i + 1;
554
 
555
 
556
+ // update names
557
+ new_tr.find('[name]').each(function(){
558
 
559
+ $(this).attr('name', $(this).attr('name').replace('[' + old_i + ']', '[' + new_i + ']') );
560
+ $(this).attr('id', $(this).attr('id').replace('[' + old_i + ']', '[' + new_i + ']') );
 
 
561
 
562
+ });
563
 
 
 
 
 
564
 
565
+ // update data-i
566
+ new_tr.attr('data-i', new_i);
567
+
568
+
569
+ // add tr
570
+ old_tr.after( new_tr );
571
+
572
+
573
+ // remove disabled
574
+ old_tr.closest('table').removeClass('remove-disabled');
575
+
576
+
577
+ return false;
578
+
579
+ });
580
+
581
+
582
+ /*
583
+ * Location Rules remove
584
+ *
585
+ * @description:
586
+ * @since 3.5.1
587
+ * @created: 15/10/12
588
+ */
589
+
590
+ $('#location_rules a.remove').live('click',function(){
591
 
592
+ var table = $(this).closest('table');
593
 
594
+ // validate
595
+ if( table.hasClass('remove-disabled') )
596
  {
597
+ return false;
598
  }
599
 
600
+
601
+ // remove tr
602
+ $(this).closest('tr').remove();
603
+
604
+
605
+ // add clas to table
606
+ if( table.find('tr').length <= 1 )
607
  {
608
+ table.addClass('remove-disabled');
 
 
 
 
 
 
 
 
 
 
 
609
  }
610
 
611
+
612
+ return false;
613
+
614
+ });
615
+
616
 
617
  /*----------------------------------------------------------------------
618
  *
626
  $('#submitdiv #publish').attr('class', 'acf-button');
627
  $('#submitdiv a.submitdelete').attr('class', 'delete-field-group').attr('id', 'submit-delete');
628
 
 
 
 
 
629
  });
630
 
631
 
645
  $('#acf_fields .acf_fc_add').live('click', function(){
646
 
647
  // vars
648
+ var tr = $(this).closest('tr.field_option_flexible_content'),
649
+ new_tr = tr.clone(false),
650
+ id = new_tr.attr('data-id');
651
+
652
 
653
  // remove sub fields
654
+ new_tr.find('.field:not(.field-field_clone)').remove();
655
 
656
  // show add new message
657
  new_tr.find('.no_fields_message').show();
665
 
666
  new_tr.find('[name]').each(function(){
667
 
668
+ var name = $(this).attr('name').replace('[layouts]['+id+']','[layouts]['+new_id+']');
669
  $(this).attr('name', name);
670
  $(this).attr('id', name);
671
 
672
  });
673
 
674
+ // update data-id
675
+ new_tr.attr('data-id', new_id);
676
+
677
  // add new tr
678
  tr.after(new_tr);
679
 
784
 
785
  });
786
 
787
+
788
+ /*
789
+ * Conditional Logic
790
+ *
791
+ * @description:
792
+ * @since 3.5.1
793
+ * @created: 11/10/12
794
+ */
795
+
796
+ acf.create_field = function( options ){
797
+
798
+ // dafaults
799
+ var defaults = {
800
+ 'type' : 'text',
801
+ 'class' : '',
802
+ 'name' : '',
803
+ 'value' : ''
804
+ };
805
+ options = $.extend(true, defaults, options);
806
+
807
+
808
+ // vars
809
+ var html = "";
810
+
811
+ if( options.type == "text" )
812
+ {
813
+ html += '<input class="text ' + options.class + '" type="text" id="' + options.name + '" name="' + options.name + '" value="' + options.value + '" />';
814
+ }
815
+ else if( options.type == "select" )
816
+ {
817
+ html += '<select class="select ' + options.class + '" id="' + options.name + '" name="' + options.name + '">';
818
+ if( options.choices )
819
+ {
820
+ for( i = 0; i < options.choices.length; i++ )
821
+ {
822
+ var attr = '';
823
+ if( options.choices[i].value == options.value )
824
+ {
825
+ attr = 'selected="selected"';
826
+ }
827
+ html += '<option ' + attr + ' value="' + options.choices[i].value + '">' + options.choices[i].label + '</option>';
828
+ }
829
+ }
830
+ html += '</select>';
831
+ }
832
+
833
+ html = $(html);
834
+
835
+ return html;
836
+
837
+ };
838
+
839
+ $(document).live('acf/field_form-open', function(e, field){
840
+
841
+ // populate fields
842
+ acf.setup_conditional_fields();
843
+
844
+
845
+ $(field).find('.conditional-logic-field').each(function(){
846
+
847
+ var val = $(this).val(),
848
+ name = $(this).attr('name'),
849
+ choices = [];
850
+
851
+
852
+ // populate choices
853
+ if( acf.fields )
854
+ {
855
+ for( i = 0; i < acf.fields.length; i++ )
856
+ {
857
+ choices.push({
858
+ value : acf.fields[i].id,
859
+ label : acf.fields[i].label
860
+ });
861
+ }
862
+ }
863
+
864
+
865
+ // empty?
866
+ if( choices.length == 0 )
867
+ {
868
+ choices.push({
869
+ 'value' : 'null',
870
+ 'label' : acf.text.conditional_no_fields
871
+ })
872
+ }
873
+
874
+
875
+ // create select
876
+ select = acf.create_field({
877
+ 'type' : 'select',
878
+ 'class' : 'conditional-logic-field',
879
+ 'name' : name,
880
+ 'value' : val,
881
+ 'choices' : choices
882
+ });
883
+
884
+
885
+ $(this).replaceWith( select );
886
+
887
+ select.trigger('change');
888
+
889
+ });
890
+
891
+ });
892
+
893
+
894
+
895
+ /*
896
+ * Toggle Conditional Logic
897
+ *
898
+ * @description:
899
+ * @since 3.5.1
900
+ * @created: 14/10/12
901
+ */
902
+
903
+ $('tr.conditional-logic input[type="radio"]').live('change', function(){
904
+
905
+ if( $(this).val() == "1" )
906
+ {
907
+ $(this).closest('tr.conditional-logic').find('.contional-logic-rules-wrapper').show();
908
+ }
909
+ else
910
+ {
911
+ $(this).closest('tr.conditional-logic').find('.contional-logic-rules-wrapper').hide();
912
+ }
913
+
914
+ });
915
+
916
+
917
+ /*
918
+ * Conditional logic: Change field
919
+ *
920
+ * @description:
921
+ * @since 3.5.1
922
+ * @created: 14/10/12
923
+ */
924
+
925
+ $('select.conditional-logic-field').live('change', function(){
926
+
927
+ // vars
928
+ var id = $(this).val(),
929
+ field = $('#acf_fields .field-' + id),
930
+ type = field.find('tr.field_type select').val(),
931
+ conditional_function = $(this).closest('tr').find('.conditional-logic-value');
932
+
933
+
934
+ // true / false
935
+ choices = [];
936
+
937
+ if( type == "true_false" )
938
+ {
939
+ choices = [
940
+ { value : '1', label : acf.text.checked },
941
+ ];
942
+
943
+ }
944
+ else if( type == "select" || type == "checkbox" || type == "radio" )
945
+ {
946
+ field_choices = field.find('.field_option-choices').val();
947
+ field_choices = field_choices.split("\n");
948
+
949
+ if( field_choices )
950
+ {
951
+ for( i = 0; i < field_choices.length; i++ )
952
+ {
953
+ var choice = field_choices[i].split(':');
954
+
955
+ var label = choice[0];
956
+ if( choice[1] )
957
+ {
958
+ label = choice[1];
959
+ }
960
+
961
+ choices.push({
962
+ 'value' : $.trim( choice[0] ),
963
+ 'label' : $.trim( label )
964
+ })
965
+
966
+ }
967
+ }
968
+
969
+ }
970
+
971
+
972
+ // create select
973
+ select = acf.create_field({
974
+ 'type' : 'select',
975
+ 'class' : 'conditional-logic-value',
976
+ 'name' : conditional_function.attr('name'),
977
+ 'value' : conditional_function.val(),
978
+ 'choices' : choices
979
+ });
980
+
981
+ conditional_function.replaceWith( select );
982
+
983
+
984
+ });
985
+
986
+
987
+
988
+ /*
989
+ * setup_conditional_fields
990
+ *
991
+ * @description: populates the acf object with all available fields
992
+ * @since 3.5.1
993
+ * @created: 15/10/12
994
+ */
995
+
996
+ acf.setup_conditional_fields = function()
997
+ {
998
+ acf.fields = [];
999
+
1000
+ $('#acf_fields > .inside > .fields > .field').each(function(){
1001
+
1002
+ var field = $(this),
1003
+ id = field.attr('data-id');
1004
+ type = field.find('tr.field_type select').val(),
1005
+ label = field.find('tr.field_label input').val();
1006
+
1007
+ if( type == 'select' || type == 'checkbox' || type == 'true_false' || type == 'radio' )
1008
+ {
1009
+ acf.fields.push({
1010
+ id : id,
1011
+ type : type,
1012
+ label : label
1013
+ });
1014
+ }
1015
+
1016
+
1017
+ });
1018
+
1019
+ }
1020
+
1021
+
1022
+ /*
1023
+ * Add conditional rule
1024
+ *
1025
+ * @description:
1026
+ * @since 3.5.1
1027
+ * @created: 15/10/12
1028
+ */
1029
+
1030
+ $('tr.conditional-logic a.add').live('click',function(){
1031
+
1032
+ // vars
1033
+ var old_tr = $(this).closest('tr'),
1034
+ new_tr = old_tr.clone(),
1035
+ old_i = parseFloat( new_tr.attr('data-i') ),
1036
+ new_i = old_i + 1;
1037
+
1038
+
1039
+ // update names
1040
+ new_tr.find('[name]').each(function(){
1041
+
1042
+ $(this).attr('name', $(this).attr('name').replace('[' + old_i + ']', '[' + new_i + ']') );
1043
+ $(this).attr('id', $(this).attr('id').replace('[' + old_i + ']', '[' + new_i + ']') );
1044
+
1045
+ });
1046
+
1047
+
1048
+ // update data-i
1049
+ new_tr.attr('data-i', new_i);
1050
+
1051
+
1052
+ // add tr
1053
+ old_tr.after( new_tr );
1054
+
1055
+
1056
+ // remove disabled
1057
+ old_tr.closest('table').removeClass('remove-disabled');
1058
+
1059
+
1060
+ return false;
1061
+
1062
+ });
1063
+
1064
+
1065
+ /*
1066
+ * Remove conditional rule
1067
+ *
1068
+ * @description:
1069
+ * @since 3.5.1
1070
+ * @created: 15/10/12
1071
+ */
1072
+
1073
+ $('tr.conditional-logic a.remove').live('click',function(){
1074
+
1075
+ var table = $(this).closest('table');
1076
+
1077
+ // validate
1078
+ if( table.hasClass('remove-disabled') )
1079
+ {
1080
+ return false;
1081
+ }
1082
+
1083
+
1084
+ // remove tr
1085
+ $(this).closest('tr').remove();
1086
+
1087
+
1088
+ // add clas to table
1089
+ if( table.find('tr').length <= 1 )
1090
+ {
1091
+ table.addClass('remove-disabled');
1092
+ }
1093
+
1094
+
1095
+ return false;
1096
+
1097
+ });
1098
+
1099
+
1100
 
1101
  })(jQuery);
js/input-actions.js CHANGED
@@ -21,7 +21,9 @@ var acf = {
21
  'gallery_tb_title_edit' : "Edit Image",
22
  'repeater_min_alert' : "Minimum rows reached ( {min} rows )",
23
  'repeater_max_alert' : "Maximum rows reached ( {max} rows )"
24
- }
 
 
25
  };
26
 
27
  (function($){
@@ -54,7 +56,7 @@ var acf = {
54
  $('#adv-settings label[for*="acf_"]').addClass('acf_hide_label');
55
 
56
  // hide acf stuff
57
- $('#poststuff .acf_postbox').hide();
58
  $('#adv-settings .acf_hide_label').hide();
59
 
60
  // loop through acf metaboxes
@@ -72,7 +74,7 @@ var acf = {
72
  // show / hide
73
  if(show == 'true')
74
  {
75
- $(this).show();
76
  $('#adv-settings .acf_hide_label[for="acf_' + id + '-hide"]').show();
77
  }
78
 
@@ -772,10 +774,12 @@ var acf = {
772
  // create wysiwyg
773
  $.fn.acf_activate_wysiwyg = function(){
774
 
775
-
 
776
  // add tinymce to all wysiwyg fields
777
  $(this).find('.acf_wysiwyg textarea').each(function(){
778
 
 
779
  // is clone field?
780
  if( acf.is_clone_field($(this)) )
781
  {
@@ -844,6 +848,8 @@ var acf = {
844
  acf_wysiwyg_buttons.theme_advanced_buttons2 = tinyMCE.settings.theme_advanced_buttons2;
845
  }
846
 
 
 
847
  });
848
 
849
  $(window).load(function(){
@@ -858,20 +864,80 @@ var acf = {
858
 
859
  });
860
 
861
- // Sortable: Start
862
- $('.repeater > table > tbody, .acf_flexible_content > .values').live( "sortstart", function(event, ui) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
863
 
864
- $(ui.item).find('.acf_wysiwyg textarea').each(function(){
865
- tinyMCE.execCommand("mceRemoveControl", false, $(this).attr('id'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
866
  });
 
867
 
868
  });
869
 
870
- // Sortable: End
871
- $('.repeater > table > tbody, .acf_flexible_content > .values').live( "sortstop", function(event, ui) {
 
 
 
 
 
 
 
 
 
 
872
 
873
- $(ui.item).find('.acf_wysiwyg textarea').each(function(){
874
- tinyMCE.execCommand("mceAddControl", false, $(this).attr('id'));
 
 
 
 
 
 
875
  });
876
 
877
  });
@@ -905,28 +971,29 @@ var acf = {
905
  // make sortable
906
  function repeater_add_sortable( repeater ){
907
 
908
- var fixHelper = function(e, ui) {
909
- ui.children().each(function() {
910
- $(this).width($(this).width());
911
- });
912
- return ui;
913
- };
914
-
915
  repeater.find('> table > tbody').unbind('sortable').sortable({
916
  update: function(event, ui){
917
  repeater_update_order( repeater );
918
  },
919
  items : '> tr.row',
920
- handle: '> td.order',
921
- helper: fixHelper,
922
- forceHelperSize: true,
923
- forcePlaceholderSize: true,
924
- scroll: true,
925
- start: function (event, ui) {
926
-
 
 
927
  // add markup to the placeholder
928
  var td_count = ui.item.children('td').length;
929
  ui.placeholder.html('<td colspan="' + td_count + '"></td>');
 
 
 
 
 
 
930
  }
931
  });
932
  };
@@ -1181,7 +1248,20 @@ var acf = {
1181
  // remove (if clone) and add sortable
1182
  div.children('.values').unbind('sortable').sortable({
1183
  items : '> .layout',
1184
- handle: '> .actions .order'
 
 
 
 
 
 
 
 
 
 
 
 
 
1185
  });
1186
 
1187
  };
@@ -1353,6 +1433,7 @@ var acf = {
1353
  altField : alt_field,
1354
  altFormat : save_format,
1355
  changeYear: true,
 
1356
  changeMonth: true,
1357
  showButtonPanel : true
1358
  });
@@ -1544,7 +1625,6 @@ var acf = {
1544
  // is clone field?
1545
  if( acf.is_clone_field($(this).children('input[type="hidden"]')) )
1546
  {
1547
- //console.log('Clone Field: Gallery');
1548
  return;
1549
  }
1550
 
@@ -1579,4 +1659,62 @@ var acf = {
1579
  });
1580
 
1581
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1582
  })(jQuery);
21
  'gallery_tb_title_edit' : "Edit Image",
22
  'repeater_min_alert' : "Minimum rows reached ( {min} rows )",
23
  'repeater_max_alert' : "Maximum rows reached ( {max} rows )"
24
+ },
25
+ conditional_logic : {},
26
+ sortable_helper : null
27
  };
28
 
29
  (function($){
56
  $('#adv-settings label[for*="acf_"]').addClass('acf_hide_label');
57
 
58
  // hide acf stuff
59
+ $('#poststuff .acf_postbox').addClass('acf-hidden');
60
  $('#adv-settings .acf_hide_label').hide();
61
 
62
  // loop through acf metaboxes
74
  // show / hide
75
  if(show == 'true')
76
  {
77
+ $(this).removeClass('acf-hidden');
78
  $('#adv-settings .acf_hide_label[for="acf_' + id + '-hide"]').show();
79
  }
80
 
774
  // create wysiwyg
775
  $.fn.acf_activate_wysiwyg = function(){
776
 
777
+
778
+
779
  // add tinymce to all wysiwyg fields
780
  $(this).find('.acf_wysiwyg textarea').each(function(){
781
 
782
+
783
  // is clone field?
784
  if( acf.is_clone_field($(this)) )
785
  {
848
  acf_wysiwyg_buttons.theme_advanced_buttons2 = tinyMCE.settings.theme_advanced_buttons2;
849
  }
850
 
851
+ $(document).trigger('acf/setup_fields', $('#poststuff'));
852
+
853
  });
854
 
855
  $(window).load(function(){
864
 
865
  });
866
 
867
+
868
+ /*
869
+ * Sortable Helper
870
+ *
871
+ * @description: keeps widths of td's inside a tr
872
+ * @since 3.5.1
873
+ * @created: 10/11/12
874
+ */
875
+
876
+ acf.sortable_helper = function(e, ui)
877
+ {
878
+ ui.children().each(function(){
879
+ $(this).width($(this).width());
880
+ });
881
+ return ui;
882
+ };
883
+
884
+
885
+ /*
886
+ * acf/sortable_start
887
+ *
888
+ * @description:
889
+ * @since 3.5.1
890
+ * @created: 10/11/12
891
+ */
892
+
893
+ $(document).live('acf/sortable_start', function(e, div) {
894
 
895
+ //console.log( 'sortstart' );
896
+
897
+ $(div).find('.acf_wysiwyg textarea').each(function(){
898
+
899
+ // vars
900
+ var textarea = $(this),
901
+ id = textarea.attr('id'),
902
+ wysiwyg = tinymce.get( id );
903
+
904
+
905
+ // if wysiwyg was found (should be always...), remove its functionality and set the value (to keep line breaks)
906
+ if( wysiwyg )
907
+ {
908
+ var val = wysiwyg.getContent();
909
+
910
+ tinyMCE.execCommand("mceRemoveControl", false, id);
911
+
912
+ textarea.val( val );
913
+ }
914
+
915
  });
916
+
917
 
918
  });
919
 
920
+
921
+ /*
922
+ * acf/sortable_stop
923
+ *
924
+ * @description:
925
+ * @since 3.5.1
926
+ * @created: 10/11/12
927
+ */
928
+
929
+ $(document).live('acf/sortable_stop', function(e, div) {
930
+
931
+ //console.log( 'sortstop' );
932
 
933
+ $(div).find('.acf_wysiwyg textarea').each(function(){
934
+
935
+ // vars
936
+ var textarea = $(this),
937
+ id = textarea.attr('id');
938
+
939
+ // add functionality back in
940
+ tinyMCE.execCommand("mceAddControl", false, id);
941
  });
942
 
943
  });
971
  // make sortable
972
  function repeater_add_sortable( repeater ){
973
 
 
 
 
 
 
 
 
974
  repeater.find('> table > tbody').unbind('sortable').sortable({
975
  update: function(event, ui){
976
  repeater_update_order( repeater );
977
  },
978
  items : '> tr.row',
979
+ handle : '> td.order',
980
+ helper : acf.sortable_helper,
981
+ forceHelperSize : true,
982
+ forcePlaceholderSize : true,
983
+ scroll : true,
984
+ start : function (event, ui) {
985
+
986
+ $(document).trigger('acf/sortable_start', ui.item);
987
+
988
  // add markup to the placeholder
989
  var td_count = ui.item.children('td').length;
990
  ui.placeholder.html('<td colspan="' + td_count + '"></td>');
991
+
992
+ },
993
+ stop : function (event, ui) {
994
+
995
+ $(document).trigger('acf/sortable_stop', ui.item);
996
+
997
  }
998
  });
999
  };
1248
  // remove (if clone) and add sortable
1249
  div.children('.values').unbind('sortable').sortable({
1250
  items : '> .layout',
1251
+ handle : '> .actions .order',
1252
+ forceHelperSize : true,
1253
+ forcePlaceholderSize : true,
1254
+ scroll : true,
1255
+ start : function (event, ui) {
1256
+
1257
+ $(document).trigger('acf/sortable_start', ui.item);
1258
+
1259
+ },
1260
+ stop : function (event, ui) {
1261
+
1262
+ $(document).trigger('acf/sortable_stop', ui.item);
1263
+
1264
+ }
1265
  });
1266
 
1267
  };
1433
  altField : alt_field,
1434
  altFormat : save_format,
1435
  changeYear: true,
1436
+ yearRange: "-100:+100",
1437
  changeMonth: true,
1438
  showButtonPanel : true
1439
  });
1625
  // is clone field?
1626
  if( acf.is_clone_field($(this).children('input[type="hidden"]')) )
1627
  {
 
1628
  return;
1629
  }
1630
 
1659
  });
1660
 
1661
 
1662
+ /*
1663
+ * Conditional Logic Calculate
1664
+ *
1665
+ * @description:
1666
+ * @since 3.5.1
1667
+ * @created: 15/10/12
1668
+ */
1669
+
1670
+ acf.conditional_logic.calculate = function( options )
1671
+ {
1672
+ // vars
1673
+ var field = $('.field-' + options.field),
1674
+ toggle = $('.field-' + options.toggle),
1675
+ r = false;
1676
+
1677
+
1678
+ // compare values
1679
+ if( toggle.hasClass('field-true_false') || toggle.hasClass('field-checkbox') || toggle.hasClass('field-radio') )
1680
+ {
1681
+ if( options.operator == "==" )
1682
+ {
1683
+ if( toggle.find('input[value="' + options.value + '"]:checked').exists() )
1684
+ {
1685
+ r = true;
1686
+ }
1687
+ }
1688
+ else
1689
+ {
1690
+ if( !toggle.find('input[value="' + options.value + '"]:checked').exists() )
1691
+ {
1692
+ r = true;
1693
+ }
1694
+ }
1695
+
1696
+ }
1697
+ else
1698
+ {
1699
+ if( options.operator == "==" )
1700
+ {
1701
+ if( toggle.find('*[name]').val() == options.value )
1702
+ {
1703
+ r = true;
1704
+ }
1705
+ }
1706
+ else
1707
+ {
1708
+ if( toggle.find('*[name]').val() != options.value )
1709
+ {
1710
+ r = true;
1711
+ }
1712
+ }
1713
+
1714
+ }
1715
+
1716
+ return r;
1717
+ }
1718
+
1719
+
1720
  })(jQuery);
js/input-ajax.js CHANGED
@@ -92,7 +92,7 @@
92
  success: function(result){
93
 
94
  // hide all metaboxes
95
- $('#poststuff .acf_postbox').hide();
96
  $('#adv-settings .acf_hide_label').hide();
97
 
98
 
@@ -108,7 +108,8 @@
108
 
109
 
110
  var postbox = $('#poststuff #acf_' + v);
111
- postbox.show();
 
112
  $('#adv-settings .acf_hide_label[for="acf_' + v + '-hide"]').show();
113
 
114
  // load fields if needed
@@ -221,7 +222,8 @@
221
 
222
  update_fields();
223
 
224
- });
 
225
 
226
 
227
  })(jQuery);
92
  success: function(result){
93
 
94
  // hide all metaboxes
95
+ $('#poststuff .acf_postbox').addClass('acf-hidden');
96
  $('#adv-settings .acf_hide_label').hide();
97
 
98
 
108
 
109
 
110
  var postbox = $('#poststuff #acf_' + v);
111
+
112
+ postbox.removeClass('acf-hidden');
113
  $('#adv-settings .acf_hide_label[for="acf_' + v + '-hide"]').show();
114
 
115
  // load fields if needed
222
 
223
  update_fields();
224
 
225
+ });
226
+
227
 
228
 
229
  })(jQuery);
lang/acf.pot CHANGED
@@ -4,7 +4,7 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/advanced-custom-fields\n"
7
- "POT-Creation-Date: 2012-10-04 22:38:59+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -12,113 +12,113 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: acf.php:286 core/views/meta_box_options.php:94
16
  msgid "Custom Fields"
17
  msgstr ""
18
 
19
- #: acf.php:307
20
  msgid "Field&nbsp;Groups"
21
  msgstr ""
22
 
23
- #: acf.php:308 core/controllers/field_groups.php:234
24
  #: core/controllers/upgrade.php:70
25
  msgid "Advanced Custom Fields"
26
  msgstr ""
27
 
28
- #: acf.php:309 core/fields/flexible_content.php:325
29
  msgid "Add New"
30
  msgstr ""
31
 
32
- #: acf.php:310
33
  msgid "Add New Field Group"
34
  msgstr ""
35
 
36
- #: acf.php:311
37
  msgid "Edit Field Group"
38
  msgstr ""
39
 
40
- #: acf.php:312
41
  msgid "New Field Group"
42
  msgstr ""
43
 
44
- #: acf.php:313
45
  msgid "View Field Group"
46
  msgstr ""
47
 
48
- #: acf.php:314
49
  msgid "Search Field Groups"
50
  msgstr ""
51
 
52
- #: acf.php:315
53
  msgid "No Field Groups found"
54
  msgstr ""
55
 
56
- #: acf.php:316
57
  msgid "No Field Groups found in Trash"
58
  msgstr ""
59
 
60
- #: acf.php:351 acf.php:354
61
  msgid "Field group updated."
62
  msgstr ""
63
 
64
- #: acf.php:352
65
  msgid "Custom field updated."
66
  msgstr ""
67
 
68
- #: acf.php:353
69
  msgid "Custom field deleted."
70
  msgstr ""
71
 
72
  #. translators: %s: date and time of the revision
73
- #: acf.php:356
74
  msgid "Field group restored to revision from %s"
75
  msgstr ""
76
 
77
- #: acf.php:357
78
  msgid "Field group published."
79
  msgstr ""
80
 
81
- #: acf.php:358
82
  msgid "Field group saved."
83
  msgstr ""
84
 
85
- #: acf.php:359
86
  msgid "Field group submitted."
87
  msgstr ""
88
 
89
- #: acf.php:360
90
  msgid "Field group scheduled for."
91
  msgstr ""
92
 
93
- #: acf.php:361
94
  msgid "Field group draft updated."
95
  msgstr ""
96
 
97
- #: acf.php:380 core/fields/gallery.php:66 core/fields/gallery.php:229
98
  msgid "Title"
99
  msgstr ""
100
 
101
- #: acf.php:623
102
  msgid "Error: Field Type does not exist!"
103
  msgstr ""
104
 
105
- #: acf.php:1709
106
  msgid "Thumbnail"
107
  msgstr ""
108
 
109
- #: acf.php:1710
110
  msgid "Medium"
111
  msgstr ""
112
 
113
- #: acf.php:1711
114
  msgid "Large"
115
  msgstr ""
116
 
117
- #: acf.php:1712 core/fields/wysiwyg.php:105
118
  msgid "Full"
119
  msgstr ""
120
 
121
- #: core/actions/export.php:26
122
  msgid "No ACF groups selected"
123
  msgstr ""
124
 
@@ -131,9 +131,8 @@ msgstr ""
131
  msgid "Location"
132
  msgstr ""
133
 
134
- #: core/controllers/field_group.php:150 core/controllers/field_group.php:427
135
- #: core/controllers/options_page.php:62 core/controllers/options_page.php:74
136
- #: core/views/meta_box_location.php:143
137
  msgid "Options"
138
  msgstr ""
139
 
@@ -149,8 +148,8 @@ msgstr ""
149
  msgid "Default Template"
150
  msgstr ""
151
 
152
- #: core/controllers/field_group.php:451 core/controllers/field_group.php:472
153
- #: core/controllers/field_group.php:479 core/fields/page_link.php:76
154
  #: core/fields/post_object.php:223 core/fields/post_object.php:251
155
  #: core/fields/relationship.php:392 core/fields/relationship.php:421
156
  msgid "All"
@@ -206,55 +205,55 @@ msgstr ""
206
  msgid "Follow"
207
  msgstr ""
208
 
209
- #: core/controllers/input.php:528
210
  msgid "Validation Failed. One or more fields below are required."
211
  msgstr ""
212
 
213
- #: core/controllers/input.php:529
214
  msgid "Add File to Field"
215
  msgstr ""
216
 
217
- #: core/controllers/input.php:530
218
  msgid "Edit File"
219
  msgstr ""
220
 
221
- #: core/controllers/input.php:531
222
  msgid "Add Image to Field"
223
  msgstr ""
224
 
225
- #: core/controllers/input.php:532 core/controllers/input.php:535
226
  msgid "Edit Image"
227
  msgstr ""
228
 
229
- #: core/controllers/input.php:533
230
  msgid "Maximum values reached ( {max} values )"
231
  msgstr ""
232
 
233
- #: core/controllers/input.php:534
234
  msgid "Add Image to Gallery"
235
  msgstr ""
236
 
237
- #: core/controllers/input.php:625
238
  msgid "Attachment updated"
239
  msgstr ""
240
 
241
- #: core/controllers/options_page.php:121
242
  msgid "Options Updated"
243
  msgstr ""
244
 
245
- #: core/controllers/options_page.php:251
246
  msgid "No Custom Field Group found for the options page"
247
  msgstr ""
248
 
249
- #: core/controllers/options_page.php:251
250
  msgid "Create a Custom Field Group"
251
  msgstr ""
252
 
253
- #: core/controllers/options_page.php:262
254
  msgid "Publish"
255
  msgstr ""
256
 
257
- #: core/controllers/options_page.php:265
258
  msgid "Save Options"
259
  msgstr ""
260
 
@@ -312,10 +311,10 @@ msgstr ""
312
  msgid "Find Add-ons"
313
  msgstr ""
314
 
315
- #: core/controllers/settings.php:225 core/fields/flexible_content.php:380
316
- #: core/fields/flexible_content.php:456 core/fields/repeater.php:330
317
- #: core/fields/repeater.php:406 core/views/meta_box_fields.php:63
318
- #: core/views/meta_box_fields.php:138
319
  msgid "Field Type"
320
  msgstr ""
321
 
@@ -589,7 +588,7 @@ msgstr ""
589
 
590
  #: core/fields/color_picker.php:92 core/fields/number.php:65
591
  #: core/fields/radio.php:130 core/fields/select.php:190
592
- #: core/fields/text.php:65 core/fields/textarea.php:62
593
  #: core/fields/wysiwyg.php:81
594
  msgid "Default Value"
595
  msgstr ""
@@ -643,10 +642,10 @@ msgstr ""
643
  msgid "File Updated."
644
  msgstr ""
645
 
646
- #: core/fields/file.php:90 core/fields/flexible_content.php:407
647
  #: core/fields/gallery.php:251 core/fields/gallery.php:281
648
- #: core/fields/image.php:187 core/fields/repeater.php:356
649
- #: core/views/meta_box_fields.php:88
650
  msgid "Edit"
651
  msgstr ""
652
 
@@ -703,147 +702,157 @@ msgstr ""
703
  msgid "Flexible Content"
704
  msgstr ""
705
 
706
- #: core/fields/flexible_content.php:38 core/fields/flexible_content.php:286
707
  msgid "+ Add Row"
708
  msgstr ""
709
 
710
- #: core/fields/flexible_content.php:313 core/fields/repeater.php:302
711
- #: core/views/meta_box_fields.php:25
 
 
 
 
 
712
  msgid "New Field"
713
  msgstr ""
714
 
715
- #: core/fields/flexible_content.php:322 core/fields/radio.php:144
716
- #: core/fields/repeater.php:523
 
 
 
 
 
717
  msgid "Layout"
718
  msgstr ""
719
 
720
- #: core/fields/flexible_content.php:324
721
  msgid "Reorder Layout"
722
  msgstr ""
723
 
724
- #: core/fields/flexible_content.php:324
725
  msgid "Reorder"
726
  msgstr ""
727
 
728
- #: core/fields/flexible_content.php:325
729
  msgid "Add New Layout"
730
  msgstr ""
731
 
732
- #: core/fields/flexible_content.php:326
733
  msgid "Delete Layout"
734
  msgstr ""
735
 
736
- #: core/fields/flexible_content.php:326 core/fields/flexible_content.php:410
737
- #: core/fields/repeater.php:359 core/views/meta_box_fields.php:91
738
  msgid "Delete"
739
  msgstr ""
740
 
741
- #: core/fields/flexible_content.php:336
742
  msgid "Label"
743
  msgstr ""
744
 
745
- #: core/fields/flexible_content.php:346
746
  msgid "Name"
747
  msgstr ""
748
 
749
- #: core/fields/flexible_content.php:356
750
  msgid "Display"
751
  msgstr ""
752
 
753
- #: core/fields/flexible_content.php:363
754
  msgid "Table"
755
  msgstr ""
756
 
757
- #: core/fields/flexible_content.php:364 core/fields/repeater.php:534
758
  msgid "Row"
759
  msgstr ""
760
 
761
- #: core/fields/flexible_content.php:377 core/fields/repeater.php:327
762
- #: core/views/meta_box_fields.php:60
763
  msgid "Field Order"
764
  msgstr ""
765
 
766
- #: core/fields/flexible_content.php:378 core/fields/flexible_content.php:425
767
- #: core/fields/repeater.php:328 core/fields/repeater.php:375
768
- #: core/views/meta_box_fields.php:61 core/views/meta_box_fields.php:107
769
  msgid "Field Label"
770
  msgstr ""
771
 
772
- #: core/fields/flexible_content.php:379 core/fields/flexible_content.php:441
773
- #: core/fields/repeater.php:329 core/fields/repeater.php:391
774
- #: core/views/meta_box_fields.php:62 core/views/meta_box_fields.php:123
775
  msgid "Field Name"
776
  msgstr ""
777
 
778
- #: core/fields/flexible_content.php:388 core/fields/repeater.php:338
779
  msgid ""
780
  "No fields. Click the \"+ Add Sub Field button\" to create your first field."
781
  msgstr ""
782
 
783
- #: core/fields/flexible_content.php:404 core/fields/flexible_content.php:407
784
- #: core/fields/repeater.php:353 core/fields/repeater.php:356
785
- #: core/views/meta_box_fields.php:85 core/views/meta_box_fields.php:88
786
  msgid "Edit this Field"
787
  msgstr ""
788
 
789
- #: core/fields/flexible_content.php:408 core/fields/repeater.php:357
790
- #: core/views/meta_box_fields.php:89
791
  msgid "Read documentation for this field"
792
  msgstr ""
793
 
794
- #: core/fields/flexible_content.php:408 core/fields/repeater.php:357
795
- #: core/views/meta_box_fields.php:89
796
  msgid "Docs"
797
  msgstr ""
798
 
799
- #: core/fields/flexible_content.php:409 core/fields/repeater.php:358
800
- #: core/views/meta_box_fields.php:90
801
  msgid "Duplicate this Field"
802
  msgstr ""
803
 
804
- #: core/fields/flexible_content.php:409 core/fields/repeater.php:358
805
- #: core/views/meta_box_fields.php:90
806
  msgid "Duplicate"
807
  msgstr ""
808
 
809
- #: core/fields/flexible_content.php:410 core/fields/repeater.php:359
810
- #: core/views/meta_box_fields.php:91
811
  msgid "Delete this Field"
812
  msgstr ""
813
 
814
- #: core/fields/flexible_content.php:426 core/fields/repeater.php:376
815
- #: core/views/meta_box_fields.php:108
816
  msgid "This is the name which will appear on the EDIT page"
817
  msgstr ""
818
 
819
- #: core/fields/flexible_content.php:442 core/fields/repeater.php:392
820
- #: core/views/meta_box_fields.php:124
821
  msgid "Single word, no spaces. Underscores and dashes allowed"
822
  msgstr ""
823
 
824
- #: core/fields/flexible_content.php:476 core/fields/repeater.php:467
825
  msgid "Save Field"
826
  msgstr ""
827
 
828
- #: core/fields/flexible_content.php:481 core/fields/repeater.php:472
829
- #: core/views/meta_box_fields.php:190
830
  msgid "Close Field"
831
  msgstr ""
832
 
833
- #: core/fields/flexible_content.php:481 core/fields/repeater.php:472
834
  msgid "Close Sub Field"
835
  msgstr ""
836
 
837
- #: core/fields/flexible_content.php:495 core/fields/repeater.php:487
838
- #: core/views/meta_box_fields.php:203
839
  msgid "Drag and drop to reorder"
840
  msgstr ""
841
 
842
- #: core/fields/flexible_content.php:496 core/fields/repeater.php:488
843
  msgid "+ Add Sub Field"
844
  msgstr ""
845
 
846
- #: core/fields/flexible_content.php:503 core/fields/repeater.php:542
847
  msgid "Button Label"
848
  msgstr ""
849
 
@@ -970,7 +979,7 @@ msgstr ""
970
  #: core/fields/post_object.php:277 core/fields/post_object.php:296
971
  #: core/fields/select.php:213 core/fields/select.php:232
972
  #: core/fields/wysiwyg.php:124 core/fields/wysiwyg.php:145
973
- #: core/views/meta_box_fields.php:172
974
  msgid "Yes"
975
  msgstr ""
976
 
@@ -978,7 +987,7 @@ msgstr ""
978
  #: core/fields/post_object.php:278 core/fields/post_object.php:297
979
  #: core/fields/select.php:214 core/fields/select.php:233
980
  #: core/fields/wysiwyg.php:125 core/fields/wysiwyg.php:146
981
- #: core/views/meta_box_fields.php:173
982
  msgid "No"
983
  msgstr ""
984
 
@@ -1023,35 +1032,31 @@ msgstr ""
1023
  msgid "Repeater"
1024
  msgstr ""
1025
 
1026
- #: core/fields/repeater.php:66 core/fields/repeater.php:289
1027
- msgid "Add Row"
1028
- msgstr ""
1029
-
1030
- #: core/fields/repeater.php:319
1031
  msgid "Repeater Fields"
1032
  msgstr ""
1033
 
1034
- #: core/fields/repeater.php:420 core/views/meta_box_fields.php:151
1035
  msgid "Field Instructions"
1036
  msgstr ""
1037
 
1038
- #: core/fields/repeater.php:440
1039
  msgid "Column Width"
1040
  msgstr ""
1041
 
1042
- #: core/fields/repeater.php:441
1043
  msgid "Leave blank for auto"
1044
  msgstr ""
1045
 
1046
- #: core/fields/repeater.php:495
1047
  msgid "Minimum Rows"
1048
  msgstr ""
1049
 
1050
- #: core/fields/repeater.php:509
1051
  msgid "Maximum Rows"
1052
  msgstr ""
1053
 
1054
- #: core/fields/repeater.php:533
1055
  msgid "Table (default)"
1056
  msgstr ""
1057
 
@@ -1063,7 +1068,7 @@ msgstr ""
1063
  msgid "Text"
1064
  msgstr ""
1065
 
1066
- #: core/fields/text.php:79 core/fields/textarea.php:76
1067
  msgid "Formatting"
1068
  msgstr ""
1069
 
@@ -1071,11 +1076,11 @@ msgstr ""
1071
  msgid "Define how to render html tags"
1072
  msgstr ""
1073
 
1074
- #: core/fields/text.php:89 core/fields/textarea.php:86
1075
  msgid "None"
1076
  msgstr ""
1077
 
1078
- #: core/fields/text.php:90 core/fields/textarea.php:88
1079
  msgid "HTML"
1080
  msgstr ""
1081
 
@@ -1083,11 +1088,11 @@ msgstr ""
1083
  msgid "Text Area"
1084
  msgstr ""
1085
 
1086
- #: core/fields/textarea.php:77
1087
  msgid "Define how to render html tags / new lines"
1088
  msgstr ""
1089
 
1090
- #: core/fields/textarea.php:87
1091
  msgid "auto &lt;br /&gt;"
1092
  msgstr ""
1093
 
@@ -1133,33 +1138,65 @@ msgid ""
1133
  "plugins / themes"
1134
  msgstr ""
1135
 
1136
- #: core/views/meta_box_fields.php:26
1137
- msgid "new_field"
1138
  msgstr ""
1139
 
1140
- #: core/views/meta_box_fields.php:47
1141
- msgid "Move to trash. Are you sure?"
1142
  msgstr ""
1143
 
1144
- #: core/views/meta_box_fields.php:64
 
 
 
 
1145
  msgid "Field Key"
1146
  msgstr ""
1147
 
1148
- #: core/views/meta_box_fields.php:74
1149
  msgid ""
1150
  "No fields. Click the <strong>+ Add Field</strong> button to create your "
1151
  "first field."
1152
  msgstr ""
1153
 
1154
- #: core/views/meta_box_fields.php:152
1155
  msgid "Instructions for authors. Shown when submitting data"
1156
  msgstr ""
1157
 
1158
- #: core/views/meta_box_fields.php:164
1159
  msgid "Required?"
1160
  msgstr ""
1161
 
1162
- #: core/views/meta_box_fields.php:204
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1163
  msgid "+ Add Field"
1164
  msgstr ""
1165
 
@@ -1233,26 +1270,10 @@ msgstr ""
1233
  msgid "Media (Edit)"
1234
  msgstr ""
1235
 
1236
- #: core/views/meta_box_location.php:96
1237
- msgid "is equal to"
1238
- msgstr ""
1239
-
1240
- #: core/views/meta_box_location.php:97
1241
- msgid "is not equal to"
1242
- msgstr ""
1243
-
1244
  #: core/views/meta_box_location.php:121
1245
  msgid "match"
1246
  msgstr ""
1247
 
1248
- #: core/views/meta_box_location.php:127
1249
- msgid "all"
1250
- msgstr ""
1251
-
1252
- #: core/views/meta_box_location.php:128
1253
- msgid "any"
1254
- msgstr ""
1255
-
1256
  #: core/views/meta_box_location.php:131
1257
  msgid "of the above"
1258
  msgstr ""
@@ -1326,3 +1347,15 @@ msgstr ""
1326
  #: core/views/meta_box_options.php:101
1327
  msgid "Featured Image"
1328
  msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
4
  msgstr ""
5
  "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/advanced-custom-fields\n"
7
+ "POT-Creation-Date: 2012-11-05 07:34:38+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: acf.php:293 core/views/meta_box_options.php:94
16
  msgid "Custom Fields"
17
  msgstr ""
18
 
19
+ #: acf.php:314
20
  msgid "Field&nbsp;Groups"
21
  msgstr ""
22
 
23
+ #: acf.php:315 core/controllers/field_groups.php:234
24
  #: core/controllers/upgrade.php:70
25
  msgid "Advanced Custom Fields"
26
  msgstr ""
27
 
28
+ #: acf.php:316 core/fields/flexible_content.php:332
29
  msgid "Add New"
30
  msgstr ""
31
 
32
+ #: acf.php:317
33
  msgid "Add New Field Group"
34
  msgstr ""
35
 
36
+ #: acf.php:318
37
  msgid "Edit Field Group"
38
  msgstr ""
39
 
40
+ #: acf.php:319
41
  msgid "New Field Group"
42
  msgstr ""
43
 
44
+ #: acf.php:320
45
  msgid "View Field Group"
46
  msgstr ""
47
 
48
+ #: acf.php:321
49
  msgid "Search Field Groups"
50
  msgstr ""
51
 
52
+ #: acf.php:322
53
  msgid "No Field Groups found"
54
  msgstr ""
55
 
56
+ #: acf.php:323
57
  msgid "No Field Groups found in Trash"
58
  msgstr ""
59
 
60
+ #: acf.php:358 acf.php:361
61
  msgid "Field group updated."
62
  msgstr ""
63
 
64
+ #: acf.php:359
65
  msgid "Custom field updated."
66
  msgstr ""
67
 
68
+ #: acf.php:360
69
  msgid "Custom field deleted."
70
  msgstr ""
71
 
72
  #. translators: %s: date and time of the revision
73
+ #: acf.php:363
74
  msgid "Field group restored to revision from %s"
75
  msgstr ""
76
 
77
+ #: acf.php:364
78
  msgid "Field group published."
79
  msgstr ""
80
 
81
+ #: acf.php:365
82
  msgid "Field group saved."
83
  msgstr ""
84
 
85
+ #: acf.php:366
86
  msgid "Field group submitted."
87
  msgstr ""
88
 
89
+ #: acf.php:367
90
  msgid "Field group scheduled for."
91
  msgstr ""
92
 
93
+ #: acf.php:368
94
  msgid "Field group draft updated."
95
  msgstr ""
96
 
97
+ #: acf.php:387 core/fields/gallery.php:66 core/fields/gallery.php:229
98
  msgid "Title"
99
  msgstr ""
100
 
101
+ #: acf.php:677
102
  msgid "Error: Field Type does not exist!"
103
  msgstr ""
104
 
105
+ #: acf.php:1827
106
  msgid "Thumbnail"
107
  msgstr ""
108
 
109
+ #: acf.php:1828
110
  msgid "Medium"
111
  msgstr ""
112
 
113
+ #: acf.php:1829
114
  msgid "Large"
115
  msgstr ""
116
 
117
+ #: acf.php:1830 core/fields/wysiwyg.php:105
118
  msgid "Full"
119
  msgstr ""
120
 
121
+ #: core/actions/export.php:25
122
  msgid "No ACF groups selected"
123
  msgstr ""
124
 
131
  msgid "Location"
132
  msgstr ""
133
 
134
+ #: core/controllers/field_group.php:150 core/controllers/field_group.php:426
135
+ #: core/controllers/options_page.php:61 core/views/meta_box_location.php:143
 
136
  msgid "Options"
137
  msgstr ""
138
 
148
  msgid "Default Template"
149
  msgstr ""
150
 
151
+ #: core/controllers/field_group.php:453 core/controllers/field_group.php:474
152
+ #: core/controllers/field_group.php:481 core/fields/page_link.php:76
153
  #: core/fields/post_object.php:223 core/fields/post_object.php:251
154
  #: core/fields/relationship.php:392 core/fields/relationship.php:421
155
  msgid "All"
205
  msgid "Follow"
206
  msgstr ""
207
 
208
+ #: core/controllers/input.php:542
209
  msgid "Validation Failed. One or more fields below are required."
210
  msgstr ""
211
 
212
+ #: core/controllers/input.php:543
213
  msgid "Add File to Field"
214
  msgstr ""
215
 
216
+ #: core/controllers/input.php:544
217
  msgid "Edit File"
218
  msgstr ""
219
 
220
+ #: core/controllers/input.php:545
221
  msgid "Add Image to Field"
222
  msgstr ""
223
 
224
+ #: core/controllers/input.php:546 core/controllers/input.php:549
225
  msgid "Edit Image"
226
  msgstr ""
227
 
228
+ #: core/controllers/input.php:547
229
  msgid "Maximum values reached ( {max} values )"
230
  msgstr ""
231
 
232
+ #: core/controllers/input.php:548
233
  msgid "Add Image to Gallery"
234
  msgstr ""
235
 
236
+ #: core/controllers/input.php:639
237
  msgid "Attachment updated"
238
  msgstr ""
239
 
240
+ #: core/controllers/options_page.php:122
241
  msgid "Options Updated"
242
  msgstr ""
243
 
244
+ #: core/controllers/options_page.php:252
245
  msgid "No Custom Field Group found for the options page"
246
  msgstr ""
247
 
248
+ #: core/controllers/options_page.php:252
249
  msgid "Create a Custom Field Group"
250
  msgstr ""
251
 
252
+ #: core/controllers/options_page.php:263
253
  msgid "Publish"
254
  msgstr ""
255
 
256
+ #: core/controllers/options_page.php:266
257
  msgid "Save Options"
258
  msgstr ""
259
 
311
  msgid "Find Add-ons"
312
  msgstr ""
313
 
314
+ #: core/controllers/settings.php:225 core/fields/flexible_content.php:387
315
+ #: core/fields/flexible_content.php:458 core/fields/repeater.php:331
316
+ #: core/fields/repeater.php:403 core/views/meta_box_fields.php:68
317
+ #: core/views/meta_box_fields.php:146
318
  msgid "Field Type"
319
  msgstr ""
320
 
588
 
589
  #: core/fields/color_picker.php:92 core/fields/number.php:65
590
  #: core/fields/radio.php:130 core/fields/select.php:190
591
+ #: core/fields/text.php:65 core/fields/textarea.php:64
592
  #: core/fields/wysiwyg.php:81
593
  msgid "Default Value"
594
  msgstr ""
642
  msgid "File Updated."
643
  msgstr ""
644
 
645
+ #: core/fields/file.php:90 core/fields/flexible_content.php:409
646
  #: core/fields/gallery.php:251 core/fields/gallery.php:281
647
+ #: core/fields/image.php:187 core/fields/repeater.php:353
648
+ #: core/views/meta_box_fields.php:96
649
  msgid "Edit"
650
  msgstr ""
651
 
702
  msgid "Flexible Content"
703
  msgstr ""
704
 
705
+ #: core/fields/flexible_content.php:38
706
  msgid "+ Add Row"
707
  msgstr ""
708
 
709
+ #: core/fields/flexible_content.php:287 core/fields/repeater.php:66
710
+ #: core/fields/repeater.php:289
711
+ msgid "Add Row"
712
+ msgstr ""
713
+
714
+ #: core/fields/flexible_content.php:319 core/fields/repeater.php:303
715
+ #: core/views/meta_box_fields.php:26
716
  msgid "New Field"
717
  msgstr ""
718
 
719
+ #: core/fields/flexible_content.php:320 core/fields/repeater.php:304
720
+ #: core/views/meta_box_fields.php:27
721
+ msgid "new_field"
722
+ msgstr ""
723
+
724
+ #: core/fields/flexible_content.php:329 core/fields/radio.php:144
725
+ #: core/fields/repeater.php:520
726
  msgid "Layout"
727
  msgstr ""
728
 
729
+ #: core/fields/flexible_content.php:331
730
  msgid "Reorder Layout"
731
  msgstr ""
732
 
733
+ #: core/fields/flexible_content.php:331
734
  msgid "Reorder"
735
  msgstr ""
736
 
737
+ #: core/fields/flexible_content.php:332
738
  msgid "Add New Layout"
739
  msgstr ""
740
 
741
+ #: core/fields/flexible_content.php:333
742
  msgid "Delete Layout"
743
  msgstr ""
744
 
745
+ #: core/fields/flexible_content.php:333 core/fields/flexible_content.php:412
746
+ #: core/fields/repeater.php:356 core/views/meta_box_fields.php:99
747
  msgid "Delete"
748
  msgstr ""
749
 
750
+ #: core/fields/flexible_content.php:343
751
  msgid "Label"
752
  msgstr ""
753
 
754
+ #: core/fields/flexible_content.php:353
755
  msgid "Name"
756
  msgstr ""
757
 
758
+ #: core/fields/flexible_content.php:363
759
  msgid "Display"
760
  msgstr ""
761
 
762
+ #: core/fields/flexible_content.php:370
763
  msgid "Table"
764
  msgstr ""
765
 
766
+ #: core/fields/flexible_content.php:371 core/fields/repeater.php:531
767
  msgid "Row"
768
  msgstr ""
769
 
770
+ #: core/fields/flexible_content.php:384 core/fields/repeater.php:328
771
+ #: core/views/meta_box_fields.php:65
772
  msgid "Field Order"
773
  msgstr ""
774
 
775
+ #: core/fields/flexible_content.php:385 core/fields/flexible_content.php:427
776
+ #: core/fields/repeater.php:329 core/fields/repeater.php:372
777
+ #: core/views/meta_box_fields.php:66 core/views/meta_box_fields.php:115
778
  msgid "Field Label"
779
  msgstr ""
780
 
781
+ #: core/fields/flexible_content.php:386 core/fields/flexible_content.php:443
782
+ #: core/fields/repeater.php:330 core/fields/repeater.php:388
783
+ #: core/views/meta_box_fields.php:67 core/views/meta_box_fields.php:131
784
  msgid "Field Name"
785
  msgstr ""
786
 
787
+ #: core/fields/flexible_content.php:395 core/fields/repeater.php:339
788
  msgid ""
789
  "No fields. Click the \"+ Add Sub Field button\" to create your first field."
790
  msgstr ""
791
 
792
+ #: core/fields/flexible_content.php:406 core/fields/flexible_content.php:409
793
+ #: core/fields/repeater.php:350 core/fields/repeater.php:353
794
+ #: core/views/meta_box_fields.php:93 core/views/meta_box_fields.php:96
795
  msgid "Edit this Field"
796
  msgstr ""
797
 
798
+ #: core/fields/flexible_content.php:410 core/fields/repeater.php:354
799
+ #: core/views/meta_box_fields.php:97
800
  msgid "Read documentation for this field"
801
  msgstr ""
802
 
803
+ #: core/fields/flexible_content.php:410 core/fields/repeater.php:354
804
+ #: core/views/meta_box_fields.php:97
805
  msgid "Docs"
806
  msgstr ""
807
 
808
+ #: core/fields/flexible_content.php:411 core/fields/repeater.php:355
809
+ #: core/views/meta_box_fields.php:98
810
  msgid "Duplicate this Field"
811
  msgstr ""
812
 
813
+ #: core/fields/flexible_content.php:411 core/fields/repeater.php:355
814
+ #: core/views/meta_box_fields.php:98
815
  msgid "Duplicate"
816
  msgstr ""
817
 
818
+ #: core/fields/flexible_content.php:412 core/fields/repeater.php:356
819
+ #: core/views/meta_box_fields.php:99
820
  msgid "Delete this Field"
821
  msgstr ""
822
 
823
+ #: core/fields/flexible_content.php:428 core/fields/repeater.php:373
824
+ #: core/views/meta_box_fields.php:116
825
  msgid "This is the name which will appear on the EDIT page"
826
  msgstr ""
827
 
828
+ #: core/fields/flexible_content.php:444 core/fields/repeater.php:389
829
+ #: core/views/meta_box_fields.php:132
830
  msgid "Single word, no spaces. Underscores and dashes allowed"
831
  msgstr ""
832
 
833
+ #: core/fields/flexible_content.php:478 core/fields/repeater.php:464
834
  msgid "Save Field"
835
  msgstr ""
836
 
837
+ #: core/fields/flexible_content.php:483 core/fields/repeater.php:469
838
+ #: core/views/meta_box_fields.php:280
839
  msgid "Close Field"
840
  msgstr ""
841
 
842
+ #: core/fields/flexible_content.php:483 core/fields/repeater.php:469
843
  msgid "Close Sub Field"
844
  msgstr ""
845
 
846
+ #: core/fields/flexible_content.php:497 core/fields/repeater.php:484
847
+ #: core/views/meta_box_fields.php:293
848
  msgid "Drag and drop to reorder"
849
  msgstr ""
850
 
851
+ #: core/fields/flexible_content.php:498 core/fields/repeater.php:485
852
  msgid "+ Add Sub Field"
853
  msgstr ""
854
 
855
+ #: core/fields/flexible_content.php:505 core/fields/repeater.php:539
856
  msgid "Button Label"
857
  msgstr ""
858
 
979
  #: core/fields/post_object.php:277 core/fields/post_object.php:296
980
  #: core/fields/select.php:213 core/fields/select.php:232
981
  #: core/fields/wysiwyg.php:124 core/fields/wysiwyg.php:145
982
+ #: core/views/meta_box_fields.php:180 core/views/meta_box_fields.php:202
983
  msgid "Yes"
984
  msgstr ""
985
 
987
  #: core/fields/post_object.php:278 core/fields/post_object.php:297
988
  #: core/fields/select.php:214 core/fields/select.php:233
989
  #: core/fields/wysiwyg.php:125 core/fields/wysiwyg.php:146
990
+ #: core/views/meta_box_fields.php:181 core/views/meta_box_fields.php:203
991
  msgid "No"
992
  msgstr ""
993
 
1032
  msgid "Repeater"
1033
  msgstr ""
1034
 
1035
+ #: core/fields/repeater.php:320
 
 
 
 
1036
  msgid "Repeater Fields"
1037
  msgstr ""
1038
 
1039
+ #: core/fields/repeater.php:417 core/views/meta_box_fields.php:159
1040
  msgid "Field Instructions"
1041
  msgstr ""
1042
 
1043
+ #: core/fields/repeater.php:437
1044
  msgid "Column Width"
1045
  msgstr ""
1046
 
1047
+ #: core/fields/repeater.php:438
1048
  msgid "Leave blank for auto"
1049
  msgstr ""
1050
 
1051
+ #: core/fields/repeater.php:492
1052
  msgid "Minimum Rows"
1053
  msgstr ""
1054
 
1055
+ #: core/fields/repeater.php:506
1056
  msgid "Maximum Rows"
1057
  msgstr ""
1058
 
1059
+ #: core/fields/repeater.php:530
1060
  msgid "Table (default)"
1061
  msgstr ""
1062
 
1068
  msgid "Text"
1069
  msgstr ""
1070
 
1071
+ #: core/fields/text.php:79 core/fields/textarea.php:78
1072
  msgid "Formatting"
1073
  msgstr ""
1074
 
1076
  msgid "Define how to render html tags"
1077
  msgstr ""
1078
 
1079
+ #: core/fields/text.php:89 core/fields/textarea.php:88
1080
  msgid "None"
1081
  msgstr ""
1082
 
1083
+ #: core/fields/text.php:90 core/fields/textarea.php:90
1084
  msgid "HTML"
1085
  msgstr ""
1086
 
1088
  msgid "Text Area"
1089
  msgstr ""
1090
 
1091
+ #: core/fields/textarea.php:79
1092
  msgid "Define how to render html tags / new lines"
1093
  msgstr ""
1094
 
1095
+ #: core/fields/textarea.php:89
1096
  msgid "auto &lt;br /&gt;"
1097
  msgstr ""
1098
 
1138
  "plugins / themes"
1139
  msgstr ""
1140
 
1141
+ #: core/views/meta_box_fields.php:51
1142
+ msgid "Move to trash. Are you sure?"
1143
  msgstr ""
1144
 
1145
+ #: core/views/meta_box_fields.php:52
1146
+ msgid "checked"
1147
  msgstr ""
1148
 
1149
+ #: core/views/meta_box_fields.php:53
1150
+ msgid "No \"toggle\" fields avilable"
1151
+ msgstr ""
1152
+
1153
+ #: core/views/meta_box_fields.php:69
1154
  msgid "Field Key"
1155
  msgstr ""
1156
 
1157
+ #: core/views/meta_box_fields.php:81
1158
  msgid ""
1159
  "No fields. Click the <strong>+ Add Field</strong> button to create your "
1160
  "first field."
1161
  msgstr ""
1162
 
1163
+ #: core/views/meta_box_fields.php:160
1164
  msgid "Instructions for authors. Shown when submitting data"
1165
  msgstr ""
1166
 
1167
+ #: core/views/meta_box_fields.php:172
1168
  msgid "Required?"
1169
  msgstr ""
1170
 
1171
+ #: core/views/meta_box_fields.php:194
1172
+ msgid "Conditional Logic"
1173
+ msgstr ""
1174
+
1175
+ #: core/views/meta_box_fields.php:239 core/views/meta_box_location.php:96
1176
+ msgid "is equal to"
1177
+ msgstr ""
1178
+
1179
+ #: core/views/meta_box_fields.php:240 core/views/meta_box_location.php:97
1180
+ msgid "is not equal to"
1181
+ msgstr ""
1182
+
1183
+ #: core/views/meta_box_fields.php:256
1184
+ msgid "Show this field when"
1185
+ msgstr ""
1186
+
1187
+ #: core/views/meta_box_fields.php:262 core/views/meta_box_location.php:127
1188
+ msgid "all"
1189
+ msgstr ""
1190
+
1191
+ #: core/views/meta_box_fields.php:263 core/views/meta_box_location.php:128
1192
+ msgid "any"
1193
+ msgstr ""
1194
+
1195
+ #: core/views/meta_box_fields.php:266
1196
+ msgid "these rules are met"
1197
+ msgstr ""
1198
+
1199
+ #: core/views/meta_box_fields.php:294
1200
  msgid "+ Add Field"
1201
  msgstr ""
1202
 
1270
  msgid "Media (Edit)"
1271
  msgstr ""
1272
 
 
 
 
 
 
 
 
 
1273
  #: core/views/meta_box_location.php:121
1274
  msgid "match"
1275
  msgstr ""
1276
 
 
 
 
 
 
 
 
 
1277
  #: core/views/meta_box_location.php:131
1278
  msgid "of the above"
1279
  msgstr ""
1347
  #: core/views/meta_box_options.php:101
1348
  msgid "Featured Image"
1349
  msgstr ""
1350
+
1351
+ #: core/views/meta_box_options.php:102
1352
+ msgid "Categories"
1353
+ msgstr ""
1354
+
1355
+ #: core/views/meta_box_options.php:103
1356
+ msgid "Tags"
1357
+ msgstr ""
1358
+
1359
+ #: core/views/meta_box_options.php:104
1360
+ msgid "Send Trackbacks"
1361
+ msgstr ""
readme.txt CHANGED
@@ -87,6 +87,24 @@ http://support.advancedcustomfields.com/
87
 
88
  == Changelog ==
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  = 3.5.0 =
91
  * [Fixed] Fix missing title of PHP registered field groups on the media edit page
92
  * [Added] Add revision support
87
 
88
  == Changelog ==
89
 
90
+ = 3.5.1 =
91
+ * [Added] Add Conditional logic for fields (toggle fields are select, checkbox, radio and true / false)
92
+ * [Added] More hooks + filters - acf_options_page_title, acf_load_field, acf_update_value - http://support.advancedcustomfields.com/discussion/3454/more-hooks-filters-ability-for-inheritance
93
+ * [Removed] Remove public param from post types list - http://support.advancedcustomfields.com/discussion/3251/fields-on-a-non-public-post-type
94
+ * [Added] Add field group headings into the acf_form function
95
+ * [Updated] Update button design to match WP 3.5
96
+ * [Fixed] Test / Fix XML export issue - http://support.advancedcustomfields.com/discussion/3415/can039t-export-xml-since-upgrade-to-3-5-0
97
+ * [Added] Add more options to the "hide on screen" - http://support.advancedcustomfields.com/discussion/3418/screen-options
98
+ * [Added] Add compatibility for Tabify plugin - http://wordpress.org/support/topic/plugin-tabify-edit-screen-compatibility-with-other-custom-fields-plugins/page/2?replies=36#post-3238051
99
+ * [Added] Add compatibility for Duplicate Post plugin
100
+ * [Added] Add new params to acf_form function - http://support.advancedcustomfields.com/discussion/3445/issue-with-the-acf_form-array
101
+ * [Updated] Increase date picker range to 100
102
+ * [Fixed] WYSIWYG looses formatting when it's row gets reordered (in a repeater / flexible content field)
103
+ * [Fixed] Fix has_sub_field break issue - http://support.advancedcustomfields.com/discussion/3528/ability-to-reset-has_sub_field
104
+ * [Fixed] Fix Textarea / Text encoding bugs - http://support.advancedcustomfields.com/discussion/comment/5147#Comment_5147
105
+ * [Added] Add publish status for field groups - http://support.advancedcustomfields.com/discussion/3695/draft-status-for-field-groups
106
+ * [Updated] General tidy up & improvement of HTML / CSS / Javascript
107
+
108
  = 3.5.0 =
109
  * [Fixed] Fix missing title of PHP registered field groups on the media edit page
110
  * [Added] Add revision support