Advanced Custom Fields - Version 2.0.3

Version Description

  • Added Option: Repeater Layout (Row / Table)
  • Fixed bug: Now you can search for media in the image / file fields
  • Added Option: Image field save format (image url / attachment id)
  • Added Option: File field save format (file url / attachment id)
  • Fixed bug: Location rules for post categories now work
  • Added rule: Page parent
  • Fixed bug: "what's new" button now shows the changelog
  • included new css style to fit in with WordPress 3.2
  • minor JS improvements
Download this release

Release Info

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

Code changes from version 2.0.2 to 2.0.3

acf.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Advanced Custom Fields
4
  Plugin URI: http://plugins.elliotcondon.com/advanced-custom-fields/
5
  Description: Comfpletely Customise your edit pages with an assortment of field types: Wysiwyg, Repeater, text, textarea, image, file, select, checkbox post type, page link and more! Hide unwanted metaboxes and assign to any edit page!
6
- Version: 2.0.2
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  License: GPL
@@ -36,7 +36,7 @@ class Acf
36
  $this->dir = plugins_url('',__FILE__);
37
  $this->siteurl = get_bloginfo('url');
38
  $this->wpadminurl = admin_url();
39
- $this->version = '2.0.2';
40
  $this->activated_fields = $this->get_activated_fields();
41
 
42
 
@@ -250,8 +250,8 @@ class Acf
250
  $array['text'] = new acf_Text();
251
  $array['textarea'] = new acf_Textarea();
252
  $array['wysiwyg'] = new acf_Wysiwyg();
253
- $array['image'] = new acf_Image();
254
- $array['file'] = new acf_File();
255
  $array['select'] = new acf_Select($this);
256
  $array['checkbox'] = new acf_Checkbox();
257
  $array['true_false'] = new acf_True_false();
@@ -777,6 +777,31 @@ class Acf
777
  }
778
 
779
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
780
 
781
  // PAGE
782
  case "page_template":
@@ -831,14 +856,14 @@ class Acf
831
 
832
  // category names
833
  $cats = get_the_category();
834
-
835
  if($rule->operator == "==")
836
  {
837
  if($cats)
838
  {
839
  foreach($cats as $cat)
840
  {
841
- if($cat->name == $rule->value)
842
  {
843
  return true;
844
  }
@@ -853,7 +878,7 @@ class Acf
853
  {
854
  foreach($cats as $cat)
855
  {
856
- if($cat->name != $rule->value)
857
  {
858
  return true;
859
  }
@@ -865,6 +890,32 @@ class Acf
865
 
866
  break;
867
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
868
  // USER TYPE
869
  case "user_type":
870
 
3
  Plugin Name: Advanced Custom Fields
4
  Plugin URI: http://plugins.elliotcondon.com/advanced-custom-fields/
5
  Description: Comfpletely Customise your edit pages with an assortment of field types: Wysiwyg, Repeater, text, textarea, image, file, select, checkbox post type, page link and more! Hide unwanted metaboxes and assign to any edit page!
6
+ Version: 2.0.3
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  License: GPL
36
  $this->dir = plugins_url('',__FILE__);
37
  $this->siteurl = get_bloginfo('url');
38
  $this->wpadminurl = admin_url();
39
+ $this->version = '2.0.3';
40
  $this->activated_fields = $this->get_activated_fields();
41
 
42
 
250
  $array['text'] = new acf_Text();
251
  $array['textarea'] = new acf_Textarea();
252
  $array['wysiwyg'] = new acf_Wysiwyg();
253
+ $array['image'] = new acf_Image($this);
254
+ $array['file'] = new acf_File($this);
255
  $array['select'] = new acf_Select($this);
256
  $array['checkbox'] = new acf_Checkbox();
257
  $array['true_false'] = new acf_True_false();
777
  }
778
 
779
  break;
780
+
781
+ // PAGE PARENT
782
+ case "page_parent":
783
+
784
+ if($rule->operator == "==")
785
+ {
786
+ if($post->post_parent == $rule->value)
787
+ {
788
+ return true;
789
+ }
790
+
791
+ return false;
792
+
793
+ }
794
+ elseif($rule->operator == "!=")
795
+ {
796
+ if($post->post_parent != $rule->value)
797
+ {
798
+ return true;
799
+ }
800
+
801
+ return false;
802
+ }
803
+
804
+ break;
805
 
806
  // PAGE
807
  case "page_template":
856
 
857
  // category names
858
  $cats = get_the_category();
859
+
860
  if($rule->operator == "==")
861
  {
862
  if($cats)
863
  {
864
  foreach($cats as $cat)
865
  {
866
+ if($cat->term_id == $rule->value)
867
  {
868
  return true;
869
  }
878
  {
879
  foreach($cats as $cat)
880
  {
881
+ if($cat->term_id != $rule->value)
882
  {
883
  return true;
884
  }
890
 
891
  break;
892
 
893
+ // PAGE PARENT
894
+ case "post_format":
895
+
896
+ if($rule->operator == "==")
897
+ {
898
+ if(get_post_format() == $rule->value)
899
+ {
900
+ return true;
901
+ }
902
+
903
+ return false;
904
+
905
+ }
906
+ elseif(get_post_format() == "!=")
907
+ {
908
+ if($post->post_parent != $rule->value)
909
+ {
910
+ return true;
911
+ }
912
+
913
+ return false;
914
+ }
915
+
916
+ break;
917
+
918
+
919
  // USER TYPE
920
  case "user_type":
921
 
core/api.php CHANGED
@@ -1,4 +1,19 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /*---------------------------------------------------------------------------------------------
3
  * acf_object
4
  *
@@ -161,9 +176,58 @@ function get_field($field_name, $post_id = false)
161
  return $acf_fields[$post_id]->$field_name;
162
  }
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  // get sub field
165
- function get_sub_field($field_name, $field)
166
  {
 
 
 
 
 
 
 
 
167
  if(isset($field[$field_name]))
168
  {
169
  return $field[$field_name];
@@ -174,19 +238,14 @@ function get_sub_field($field_name, $field)
174
  }
175
  }
176
 
 
177
  // get sub field
178
- function the_sub_field($field_name, $field)
179
  {
180
  echo get_sub_field($field_name, $field);
181
  }
182
 
183
 
184
- // the field
185
- function the_field($field_name, $post_id = false)
186
- {
187
- //echo 'field name: '.$field_name.', post id: '.$post_id;
188
- echo get_field($field_name, $post_id);
189
- }
190
 
191
  /*---------------------------------------------------------------------------------------------
192
  * ACF_WP_Query
1
  <?php
2
+
3
+ /*---------------------------------------------------------------------------------------------
4
+ * Global Vars for Groovy Repeater while loop
5
+ *
6
+ * @author Elliot Condon
7
+ * @since 2.0.3
8
+ *
9
+ ---------------------------------------------------------------------------------------------*/
10
+ global $repeater_row_count, $repeater_row;
11
+
12
+ $repeater_row_count = 0;
13
+ $repeater_row = null;
14
+
15
+
16
+
17
  /*---------------------------------------------------------------------------------------------
18
  * acf_object
19
  *
176
  return $acf_fields[$post_id]->$field_name;
177
  }
178
 
179
+
180
+ // the field
181
+ function the_field($field_name, $post_id = false)
182
+ {
183
+ //echo 'field name: '.$field_name.', post id: '.$post_id;
184
+ echo get_field($field_name, $post_id);
185
+ }
186
+
187
+
188
+ /*---------------------------------------------------------------------------------------------
189
+ * Repeater Field functions
190
+ *
191
+ * @author Elliot Condon
192
+ * @since 2.0.3
193
+ *
194
+ ---------------------------------------------------------------------------------------------*/
195
+
196
+ function the_repeater_field($field_name, $post_id = false)
197
+ {
198
+ global $repeater_row_count, $repeater_row;
199
+
200
+ $rows = get_field($field_name, $post_id);
201
+
202
+ if(isset($rows[$repeater_row_count]))
203
+ {
204
+ $repeater_row = $rows[$repeater_row_count];
205
+ $repeater_row_count ++;
206
+ return true;
207
+ }
208
+
209
+
210
+ // reset the vars and return false to end the loop
211
+
212
+ $repeater_row_count = 0;
213
+ $repeater_row = null;
214
+
215
+ return false;
216
+
217
+ }
218
+
219
+
220
  // get sub field
221
+ function get_sub_field($field_name, $field = false)
222
  {
223
+
224
+
225
+ if($field == false)
226
+ {
227
+ global $repeater_row;
228
+ $field = $repeater_row;
229
+ }
230
+
231
  if(isset($field[$field_name]))
232
  {
233
  return $field[$field_name];
238
  }
239
  }
240
 
241
+
242
  // get sub field
243
+ function the_sub_field($field_name, $field = false)
244
  {
245
  echo get_sub_field($field_name, $field);
246
  }
247
 
248
 
 
 
 
 
 
 
249
 
250
  /*---------------------------------------------------------------------------------------------
251
  * ACF_WP_Query
core/fields/file.php CHANGED
@@ -4,11 +4,13 @@ class acf_File
4
  {
5
  var $name;
6
  var $title;
 
7
 
8
- function acf_File()
9
  {
10
  $this->name = 'file';
11
  $this->title = __('File','acf');
 
12
 
13
  add_action("admin_head-media-upload-popup", array($this, 'popup_head'));
14
  add_filter('media_send_to_editor', array($this, 'media_send_to_editor'), 15, 2 );
@@ -19,6 +21,42 @@ class acf_File
19
  }
20
 
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  /*---------------------------------------------------------------------------------------------
23
  * admin_print_scripts / admin_print_styles
24
  *
@@ -84,6 +122,11 @@ class acf_File
84
  });
85
  }).trigger('DOMNodeInserted');
86
 
 
 
 
 
 
87
  });
88
 
89
  })(jQuery);
@@ -112,8 +155,16 @@ class acf_File
112
 
113
  ?>
114
  <script type="text/javascript">
115
-
116
- self.parent.acf_div.find('input.value').val('<?php echo $file_src; ?>');
 
 
 
 
 
 
 
 
117
  self.parent.acf_div.find('p.file span').html('<?php echo $file_src; ?>');
118
  self.parent.acf_div.addClass('active');
119
 
@@ -145,11 +196,22 @@ class acf_File
145
  $file = $field->value;
146
  $class = " active";
147
  }
148
-
 
 
149
  echo '<div class="acf_file_uploader'.$class.'">';
150
  echo '<a href="#" class="remove_file"></a>';
151
- echo '<p class="file"><span>'.$file.'</span> <input type="button" class="button" value="'.__('Remove File','acf').'" /></p>';
152
- echo '<input class="value" type="hidden" name="'.$field->input_name.'" value="'.$field->value.'" />';
 
 
 
 
 
 
 
 
 
153
  echo '<p class="no_file">'.__('No File selected','acf').'. <input type="button" class="button" value="'.__('Add File','acf').'" /></p>';
154
  echo '</div>';
155
 
4
  {
5
  var $name;
6
  var $title;
7
+ var $parent;
8
 
9
+ function acf_File($parent)
10
  {
11
  $this->name = 'file';
12
  $this->title = __('File','acf');
13
+ $this->parent = $parent;
14
 
15
  add_action("admin_head-media-upload-popup", array($this, 'popup_head'));
16
  add_filter('media_send_to_editor', array($this, 'media_send_to_editor'), 15, 2 );
21
  }
22
 
23
 
24
+ /*---------------------------------------------------------------------------------------------
25
+ * Options HTML
26
+ * - called from fields_meta_box.php
27
+ * - displays options in html format
28
+ *
29
+ * @author Elliot Condon
30
+ * @since 2.0.3
31
+ *
32
+ ---------------------------------------------------------------------------------------------*/
33
+ function options_html($key, $options)
34
+ {
35
+ ?>
36
+ <tr class="field_option field_option_file">
37
+ <td class="label">
38
+ <label><?php _e("Save Format",'acf'); ?></label>
39
+ </td>
40
+ <td>
41
+ <?php
42
+ $temp_field = new stdClass();
43
+ $temp_field->type = 'select';
44
+ $temp_field->input_name = 'acf[fields]['.$key.'][options][save_format]';
45
+ $temp_field->input_class = '';
46
+ $temp_field->value = $options['save_format'];
47
+ $temp_field->options = array('choices' => array(
48
+ 'url' => 'File URL',
49
+ 'id' => 'Attachment ID'
50
+ ));
51
+ $this->parent->create_field($temp_field);
52
+ ?>
53
+ </td>
54
+ </tr>
55
+
56
+ <?php
57
+ }
58
+
59
+
60
  /*---------------------------------------------------------------------------------------------
61
  * admin_print_scripts / admin_print_styles
62
  *
122
  });
123
  }).trigger('DOMNodeInserted');
124
 
125
+ $('form#filter').each(function(){
126
+
127
+ $(this).append('<input type="hidden" name="acf_type" value="file" />');
128
+
129
+ });
130
  });
131
 
132
  })(jQuery);
155
 
156
  ?>
157
  <script type="text/javascript">
158
+
159
+ if(self.parent.acf_div.find('input.value').hasClass('id'))
160
+ {
161
+ self.parent.acf_div.find('input.value').val('<?php echo $id; ?>');
162
+ }
163
+ else
164
+ {
165
+ self.parent.acf_div.find('input.value').val('<?php echo $file_src; ?>');
166
+ }
167
+
168
  self.parent.acf_div.find('p.file span').html('<?php echo $file_src; ?>');
169
  self.parent.acf_div.addClass('active');
170
 
196
  $file = $field->value;
197
  $class = " active";
198
  }
199
+
200
+ if(!isset($field->options['save_format'])){$field->options['save_format'] = 'url';}
201
+
202
  echo '<div class="acf_file_uploader'.$class.'">';
203
  echo '<a href="#" class="remove_file"></a>';
204
+ if($field->options['save_format'] == 'id')
205
+ {
206
+ $file_src = wp_get_attachment_url($field->value);
207
+ echo '<p class="file"><span>'.$file_src.'</span> <input type="button" class="button" value="'.__('Remove File','acf').'" /></p>';
208
+ }
209
+ else
210
+ {
211
+ echo '<p class="file"><span>'.$field->value.'</span> <input type="button" class="button" value="'.__('Remove File','acf').'" /></p>';
212
+ }
213
+
214
+ echo '<input class="value '.$field->options['save_format'].'" type="hidden" name="'.$field->input_name.'" value="'.$field->value.'" />';
215
  echo '<p class="no_file">'.__('No File selected','acf').'. <input type="button" class="button" value="'.__('Add File','acf').'" /></p>';
216
  echo '</div>';
217
 
core/fields/image.php CHANGED
@@ -4,12 +4,14 @@ class acf_Image
4
  {
5
  var $name;
6
  var $title;
7
-
8
- function acf_Image()
 
9
  {
10
  $this->name = 'image';
11
  $this->title = __('Image','acf');
12
-
 
13
  add_action('admin_head-media-upload-popup', array($this, 'popup_head'));
14
  add_filter('media_send_to_editor', array($this, 'media_send_to_editor'), 15, 2 );
15
  //add_action('admin_init', array($this, 'admin_init'));
@@ -19,6 +21,44 @@ class acf_Image
19
 
20
  }
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  /*---------------------------------------------------------------------------------------------
23
  * admin_print_scripts / admin_print_styles
24
  *
@@ -83,6 +123,11 @@ class acf_Image
83
  });
84
  }).trigger('DOMNodeInserted');
85
 
 
 
 
 
 
86
  });
87
 
88
  })(jQuery);
@@ -134,8 +179,17 @@ class acf_Image
134
 
135
  ?>
136
  <script type="text/javascript">
137
-
138
- self.parent.acf_div.find('input.value').val('<?php echo $file_src; ?>');
 
 
 
 
 
 
 
 
 
139
  self.parent.acf_div.find('img').attr('src','<?php echo $file_src; ?>');
140
  self.parent.acf_div.addClass('active');
141
 
@@ -165,11 +219,22 @@ class acf_Image
165
  {
166
  $class = " active";
167
  }
 
 
168
 
169
  echo '<div class="acf_image_uploader'.$class.'">';
170
  echo '<a href="#" class="remove_image"></a>';
171
- echo '<img src="'.$field->value.'" alt=""/>';
172
- echo '<input class="value" type="hidden" name="'.$field->input_name.'" value="'.$field->value.'" />';
 
 
 
 
 
 
 
 
 
173
  echo '<p>'.__('No image selected','acf').'. <input type="button" class="button" value="'.__('Add Image','acf').'" /></p>';
174
  echo '</div>';
175
 
4
  {
5
  var $name;
6
  var $title;
7
+ var $parent;
8
+
9
+ function acf_Image($parent)
10
  {
11
  $this->name = 'image';
12
  $this->title = __('Image','acf');
13
+ $this->parent = $parent;
14
+
15
  add_action('admin_head-media-upload-popup', array($this, 'popup_head'));
16
  add_filter('media_send_to_editor', array($this, 'media_send_to_editor'), 15, 2 );
17
  //add_action('admin_init', array($this, 'admin_init'));
21
 
22
  }
23
 
24
+
25
+ /*---------------------------------------------------------------------------------------------
26
+ * Options HTML
27
+ * - called from fields_meta_box.php
28
+ * - displays options in html format
29
+ *
30
+ * @author Elliot Condon
31
+ * @since 2.0.3
32
+ *
33
+ ---------------------------------------------------------------------------------------------*/
34
+ function options_html($key, $options)
35
+ {
36
+ ?>
37
+ <tr class="field_option field_option_image">
38
+ <td class="label">
39
+ <label><?php _e("Save Format",'acf'); ?></label>
40
+ </td>
41
+ <td>
42
+ <?php
43
+ $temp_field = new stdClass();
44
+ $temp_field->type = 'select';
45
+ $temp_field->input_name = 'acf[fields]['.$key.'][options][save_format]';
46
+ $temp_field->input_class = '';
47
+ $temp_field->value = $options['save_format'];
48
+ $temp_field->options = array('choices' => array(
49
+ 'url' => 'Image URL',
50
+ 'id' => 'Attachment ID'
51
+ ));
52
+ $this->parent->create_field($temp_field);
53
+ ?>
54
+ </td>
55
+ </tr>
56
+
57
+ <?php
58
+ }
59
+
60
+
61
+
62
  /*---------------------------------------------------------------------------------------------
63
  * admin_print_scripts / admin_print_styles
64
  *
123
  });
124
  }).trigger('DOMNodeInserted');
125
 
126
+ $('form#filter').each(function(){
127
+
128
+ $(this).append('<input type="hidden" name="acf_type" value="image" />');
129
+
130
+ });
131
  });
132
 
133
  })(jQuery);
179
 
180
  ?>
181
  <script type="text/javascript">
182
+
183
+ if(self.parent.acf_div.find('input.value').hasClass('id'))
184
+ {
185
+ self.parent.acf_div.find('input.value').val('<?php echo $id; ?>');
186
+ }
187
+ else
188
+ {
189
+ self.parent.acf_div.find('input.value').val('<?php echo $file_src; ?>');
190
+ }
191
+
192
+
193
  self.parent.acf_div.find('img').attr('src','<?php echo $file_src; ?>');
194
  self.parent.acf_div.addClass('active');
195
 
219
  {
220
  $class = " active";
221
  }
222
+
223
+ if(!isset($field->options['save_format'])){$field->options['save_format'] = 'url';}
224
 
225
  echo '<div class="acf_image_uploader'.$class.'">';
226
  echo '<a href="#" class="remove_image"></a>';
227
+ if($field->options['save_format'] == 'id')
228
+ {
229
+ $file_src = wp_get_attachment_url($field->value);
230
+ echo '<img src="'.$file_src.'" alt=""/>';
231
+ }
232
+ else
233
+ {
234
+ echo '<img src="'.$field->value.'" alt=""/>';
235
+ }
236
+
237
+ echo '<input class="value '.$field->options['save_format'].'" type="hidden" name="'.$field->input_name.'" value="'.$field->value.'" />';
238
  echo '<p>'.__('No image selected','acf').'. <input type="button" class="button" value="'.__('Add Image','acf').'" /></p>';
239
  echo '</div>';
240
 
core/fields/page_link.php CHANGED
@@ -48,11 +48,11 @@ class acf_Page_link
48
  if(isset($field->options["multiple"]) && $field->options["multiple"] == '1')
49
  {
50
  $name_extra = '[]';
51
- echo '<select id="'.$field->input_id.'" class="'.$field->input_class.'" name="'.$field->input_name.$name_extra.'" multiple="multiple" size="5" >';
52
  }
53
  else
54
  {
55
- echo '<select id="'.$field->input_id.'" class="'.$field->input_class.'" name="'.$field->input_name.'" >';
56
  // add top option
57
  echo '<option value="null">- '.__("Select Option",'acf').' -</option>';
58
  }
@@ -164,7 +164,6 @@ class acf_Page_link
164
  $temp_field->type = 'select';
165
  $temp_field->input_name = 'acf[fields]['.$key.'][options][post_type]';
166
  $temp_field->input_class = '';
167
- $temp_field->input_id = 'acf[fields]['.$key.'][options][post_type]';
168
  $temp_field->value = $options['post_type'];
169
  $temp_field->options = array('choices' => $post_types, 'multiple' => '1');
170
  $this->parent->create_field($temp_field);
@@ -183,7 +182,6 @@ class acf_Page_link
183
  $temp_field->type = 'true_false';
184
  $temp_field->input_name = 'acf[fields]['.$key.'][options][multiple]';
185
  $temp_field->input_class = '';
186
- $temp_field->input_id = 'acf[fields]['.$key.'][options][multiple]';
187
  $temp_field->value = $options['multiple'];
188
  $temp_field->options = array('message' => '');
189
  $this->parent->create_field($temp_field);
48
  if(isset($field->options["multiple"]) && $field->options["multiple"] == '1')
49
  {
50
  $name_extra = '[]';
51
+ echo '<select id="'.$field->input_name.'" class="'.$field->input_class.'" name="'.$field->input_name.$name_extra.'" multiple="multiple" size="5" >';
52
  }
53
  else
54
  {
55
+ echo '<select id="'.$field->input_name.'" class="'.$field->input_class.'" name="'.$field->input_name.'" >';
56
  // add top option
57
  echo '<option value="null">- '.__("Select Option",'acf').' -</option>';
58
  }
164
  $temp_field->type = 'select';
165
  $temp_field->input_name = 'acf[fields]['.$key.'][options][post_type]';
166
  $temp_field->input_class = '';
 
167
  $temp_field->value = $options['post_type'];
168
  $temp_field->options = array('choices' => $post_types, 'multiple' => '1');
169
  $this->parent->create_field($temp_field);
182
  $temp_field->type = 'true_false';
183
  $temp_field->input_name = 'acf[fields]['.$key.'][options][multiple]';
184
  $temp_field->input_class = '';
 
185
  $temp_field->value = $options['multiple'];
186
  $temp_field->options = array('message' => '');
187
  $this->parent->create_field($temp_field);
core/fields/post_object.php CHANGED
@@ -39,11 +39,11 @@ class acf_Post_object
39
  if(isset($field->options['multiple']) && $field->options['multiple'] == '1')
40
  {
41
  $name_extra = '[]';
42
- echo '<select id="'.$field->input_id.'" class="'.$field->input_class.'" name="'.$field->input_name.$name_extra.'" multiple="multiple" size="5" >';
43
  }
44
  else
45
  {
46
- echo '<select id="'.$field->input_id.'" class="'.$field->input_class.'" name="'.$field->input_name.'" >';
47
  // add top option
48
  echo '<option value="null">- '.__("Select Option",'acf').' -</option>';
49
  }
@@ -151,7 +151,6 @@ class acf_Post_object
151
  $temp_field->type = 'select';
152
  $temp_field->input_name = 'acf[fields]['.$key.'][options][post_type]';
153
  $temp_field->input_class = '';
154
- $temp_field->input_id = 'acf[fields]['.$key.'][options][post_type]';
155
  $temp_field->value = $options['post_type'];
156
  $temp_field->options = array('choices' => $post_types, 'multiple' => '1');
157
  $this->parent->create_field($temp_field);
@@ -170,7 +169,6 @@ class acf_Post_object
170
  $temp_field->type = 'true_false';
171
  $temp_field->input_name = 'acf[fields]['.$key.'][options][multiple]';
172
  $temp_field->input_class = '';
173
- $temp_field->input_id = 'acf[fields]['.$key.'][options][multiple]';
174
  $temp_field->value = $options['multiple'];
175
  $temp_field->options = array('message' => '');
176
  $this->parent->create_field($temp_field);
39
  if(isset($field->options['multiple']) && $field->options['multiple'] == '1')
40
  {
41
  $name_extra = '[]';
42
+ echo '<select id="'.$field->input_name.'" class="'.$field->input_class.'" name="'.$field->input_name.$name_extra.'" multiple="multiple" size="5" >';
43
  }
44
  else
45
  {
46
+ echo '<select id="'.$field->input_name.'" class="'.$field->input_class.'" name="'.$field->input_name.'" >';
47
  // add top option
48
  echo '<option value="null">- '.__("Select Option",'acf').' -</option>';
49
  }
151
  $temp_field->type = 'select';
152
  $temp_field->input_name = 'acf[fields]['.$key.'][options][post_type]';
153
  $temp_field->input_class = '';
 
154
  $temp_field->value = $options['post_type'];
155
  $temp_field->options = array('choices' => $post_types, 'multiple' => '1');
156
  $this->parent->create_field($temp_field);
169
  $temp_field->type = 'true_false';
170
  $temp_field->input_name = 'acf[fields]['.$key.'][options][multiple]';
171
  $temp_field->input_class = '';
 
172
  $temp_field->value = $options['multiple'];
173
  $temp_field->options = array('message' => '');
174
  $this->parent->create_field($temp_field);
core/fields/repeater.php CHANGED
@@ -19,40 +19,64 @@ class acf_Repeater
19
  {
20
  $sub_fields = $field->options['sub_fields'];
21
 
 
22
  if(isset($field->options['row_limit']) && $field->options['row_limit'] != "")
23
  {
24
  $row_limit = intval($field->options['row_limit']);
25
  }
26
- else
 
 
27
  {
28
- $row_limit = 999;
29
  }
30
 
31
 
 
 
32
  ?>
33
  <div class="repeater">
34
  <input type="hidden" name="row_limit" value="<?php echo $row_limit; ?>" />
35
- <table class="">
 
36
  <thead>
37
  <tr>
 
38
  <th class="order"><!-- order --></th>
 
 
39
  <?php foreach($sub_fields as $sub_field):?>
40
  <th class="<?php echo $sub_field->name; ?>"><span><?php echo $sub_field->label; ?></span></th>
41
  <?php endforeach; ?>
 
 
42
  <th class="remove"></th>
 
43
  </tr>
44
  </thead>
 
45
  <tbody>
46
  <?php foreach($field->value as $i => $value):?>
47
  <?php if(($i+1) > $row_limit){continue;} ?>
48
  <tr>
49
- <td class="order">
50
- <?php echo $i+1; ?>
51
- </td>
 
 
 
 
 
 
 
52
  <?php foreach($sub_fields as $j => $sub_field):?>
53
 
 
54
  <td>
55
-
 
 
 
56
  <input type="hidden" name="<?php echo $field->input_name.'['.$i.']['.$j.'][row_id]'; ?>" value="<?php echo $field->value[$i][$j]->id; ?>" />
57
  <input type="hidden" name="<?php echo $field->input_name.'['.$i.']['.$j.'][field_id]'; ?>" value="<?php echo $sub_field->id; ?>" />
58
  <input type="hidden" name="<?php echo $field->input_name.'['.$i.']['.$j.'][field_type]' ?>" value="<?php echo $sub_field->type; ?>" />
@@ -61,17 +85,25 @@ class acf_Repeater
61
  $temp_field = new stdClass();
62
  $temp_field->type = $sub_field->type;
63
  $temp_field->input_name = $field->input_name.'['.$i.']['.$j.'][value]';
64
- $temp_field->input_id = $field->input_name.'['.$i.']['.$j.'][value]';
65
  $temp_field->input_class = $sub_field->type;
66
  $temp_field->options = $sub_field->options;
67
  $temp_field->value = $field->value[$i][$j]->value;
68
  $this->parent->create_field($temp_field);
69
 
70
  ?>
 
71
  </td>
 
 
 
72
 
73
  <?php endforeach; ?>
74
- <td class="remove"><a class="remove_field" href="javascript:;"></a></td>
 
 
 
 
 
75
  </tr>
76
  <?php endforeach; ?>
77
  </tbody>
@@ -134,7 +166,7 @@ class acf_Repeater
134
  </td>
135
  <td>
136
  <div class="repeater">
137
- <table class="acf">
138
  <thead>
139
  <tr>
140
  <th class="field_order"><?php _e('Field Order','acf'); ?></th>
@@ -155,7 +187,7 @@ class acf_Repeater
155
  <div class="<?php if($key2 == 999){echo "field_clone";}else{echo "field";} ?> sub_field">
156
 
157
  <input type="hidden" name="acf[fields][<?php echo $key; ?>][sub_fields][<?php echo $key2; ?>][id]'" value="<?php echo $field->id; ?>" />
158
- <table class="acf">
159
  <tr>
160
  <td class="field_order"><?php echo ($key2+1); ?></td>
161
  <td class="field_label">
@@ -175,7 +207,7 @@ class acf_Repeater
175
  <div class="field_form_mask">
176
  <div class="field_form">
177
 
178
- <table class="acf_input">
179
  <tbody>
180
  <tr class="field_label">
181
  <td class="label">
@@ -188,7 +220,6 @@ class acf_Repeater
188
 
189
  $temp_field->type = 'text';
190
  $temp_field->input_name = 'acf[fields]['.$key.'][sub_fields]['.$key2.'][label]';
191
- $temp_field->input_id = 'acf[fields]['.$key.'][sub_fields]['.$key2.'][label]';
192
  $temp_field->input_class = 'label';
193
  $temp_field->value = $field->label;
194
 
@@ -207,7 +238,6 @@ class acf_Repeater
207
 
208
  $temp_field->type = 'text';
209
  $temp_field->input_name = 'acf[fields]['.$key.'][sub_fields]['.$key2.'][name]';
210
- $temp_field->input_id = 'acf[fields]['.$key.'][sub_fields]['.$key2.'][name]';
211
  $temp_field->input_class = 'name';
212
  $temp_field->value = $field->name;
213
 
@@ -224,7 +254,6 @@ class acf_Repeater
224
 
225
  $temp_field->type = 'select';
226
  $temp_field->input_name = 'acf[fields]['.$key.'][sub_fields]['.$key2.'][type]';
227
- $temp_field->input_id = 'acf[fields]['.$key.'][sub_fields]['.$key2.'][type]';
228
  $temp_field->input_class = 'type';
229
  $temp_field->value = $field->type;
230
  $temp_field->options = array('choices' => $fields_names);
@@ -268,13 +297,36 @@ class acf_Repeater
268
  </td>
269
  </tr>
270
  <tr class="field_option field_option_repeater">
271
- <td class="label">
272
- <label for="acf[fields][<?php echo $key; ?>][options][row_limit]"><?php _e("Row Limit",'acf'); ?></label>
273
- </td>
274
- <td>
275
  <input type="text" name="acf[fields][<?php echo $key; ?>][options][row_limit]" id="acf[fields][<?php echo $key; ?>][options][row_limit]" value="<?php echo $options['row_limit']; ?>" />
276
 
277
- </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  </tr>
279
  <?php
280
  }
@@ -310,6 +362,13 @@ class acf_Repeater
310
  continue;
311
  }
312
 
 
 
 
 
 
 
 
313
  // format options if needed
314
  if(method_exists($this->parent->fields[$field['type']], 'format_options'))
315
  {
@@ -328,6 +387,8 @@ class acf_Repeater
328
  'options' => serialize($field['options']),
329
 
330
  );
 
 
331
  // options does save. Choices is being overriden by other field options that use the same key name
332
  // update js to disable all other options
333
 
19
  {
20
  $sub_fields = $field->options['sub_fields'];
21
 
22
+ $row_limit = 999;
23
  if(isset($field->options['row_limit']) && $field->options['row_limit'] != "")
24
  {
25
  $row_limit = intval($field->options['row_limit']);
26
  }
27
+
28
+ $layout = 'table';
29
+ if(isset($field->options['layout']) && $field->options['layout'] != "")
30
  {
31
+ $layout = $field->options['layout'];
32
  }
33
 
34
 
35
+
36
+
37
  ?>
38
  <div class="repeater">
39
  <input type="hidden" name="row_limit" value="<?php echo $row_limit; ?>" />
40
+ <table class="widefat <?php if($layout == 'row'): ?>row_layout<?php endif; ?>">
41
+ <?php if($layout == 'table'): ?>
42
  <thead>
43
  <tr>
44
+ <?php if($row_limit > 1): ?>
45
  <th class="order"><!-- order --></th>
46
+ <?php endif; ?>
47
+
48
  <?php foreach($sub_fields as $sub_field):?>
49
  <th class="<?php echo $sub_field->name; ?>"><span><?php echo $sub_field->label; ?></span></th>
50
  <?php endforeach; ?>
51
+
52
+ <?php if($row_limit > 1): ?>
53
  <th class="remove"></th>
54
+ <?php endif; ?>
55
  </tr>
56
  </thead>
57
+ <?php endif; ?>
58
  <tbody>
59
  <?php foreach($field->value as $i => $value):?>
60
  <?php if(($i+1) > $row_limit){continue;} ?>
61
  <tr>
62
+
63
+ <?php if($row_limit > 1): ?>
64
+ <td class="order">
65
+ <?php echo $i+1; ?>
66
+ </td>
67
+ <?php endif; ?>
68
+
69
+ <?php if($layout == 'row'): ?><td><?php endif; ?>
70
+
71
+
72
  <?php foreach($sub_fields as $j => $sub_field):?>
73
 
74
+ <?php if($layout == 'table'): ?>
75
  <td>
76
+ <?php else: ?>
77
+ <label><?php echo $sub_fields[$j]->label; ?></label>
78
+ <?php endif; ?>
79
+
80
  <input type="hidden" name="<?php echo $field->input_name.'['.$i.']['.$j.'][row_id]'; ?>" value="<?php echo $field->value[$i][$j]->id; ?>" />
81
  <input type="hidden" name="<?php echo $field->input_name.'['.$i.']['.$j.'][field_id]'; ?>" value="<?php echo $sub_field->id; ?>" />
82
  <input type="hidden" name="<?php echo $field->input_name.'['.$i.']['.$j.'][field_type]' ?>" value="<?php echo $sub_field->type; ?>" />
85
  $temp_field = new stdClass();
86
  $temp_field->type = $sub_field->type;
87
  $temp_field->input_name = $field->input_name.'['.$i.']['.$j.'][value]';
 
88
  $temp_field->input_class = $sub_field->type;
89
  $temp_field->options = $sub_field->options;
90
  $temp_field->value = $field->value[$i][$j]->value;
91
  $this->parent->create_field($temp_field);
92
 
93
  ?>
94
+ <?php if($layout == 'table'): ?>
95
  </td>
96
+ <?php else: ?>
97
+
98
+ <?php endif; ?>
99
 
100
  <?php endforeach; ?>
101
+
102
+ <?php if($layout == 'row'): ?></td><?php endif; ?>
103
+
104
+ <?php if($row_limit > 1): ?>
105
+ <td class="remove"><a class="remove_field" href="javascript:;"></a></td>
106
+ <?php endif; ?>
107
  </tr>
108
  <?php endforeach; ?>
109
  </tbody>
166
  </td>
167
  <td>
168
  <div class="repeater">
169
+ <table class="acf widefat">
170
  <thead>
171
  <tr>
172
  <th class="field_order"><?php _e('Field Order','acf'); ?></th>
187
  <div class="<?php if($key2 == 999){echo "field_clone";}else{echo "field";} ?> sub_field">
188
 
189
  <input type="hidden" name="acf[fields][<?php echo $key; ?>][sub_fields][<?php echo $key2; ?>][id]'" value="<?php echo $field->id; ?>" />
190
+ <table class="acf widefat">
191
  <tr>
192
  <td class="field_order"><?php echo ($key2+1); ?></td>
193
  <td class="field_label">
207
  <div class="field_form_mask">
208
  <div class="field_form">
209
 
210
+ <table class="acf_input widefat">
211
  <tbody>
212
  <tr class="field_label">
213
  <td class="label">
220
 
221
  $temp_field->type = 'text';
222
  $temp_field->input_name = 'acf[fields]['.$key.'][sub_fields]['.$key2.'][label]';
 
223
  $temp_field->input_class = 'label';
224
  $temp_field->value = $field->label;
225
 
238
 
239
  $temp_field->type = 'text';
240
  $temp_field->input_name = 'acf[fields]['.$key.'][sub_fields]['.$key2.'][name]';
 
241
  $temp_field->input_class = 'name';
242
  $temp_field->value = $field->name;
243
 
254
 
255
  $temp_field->type = 'select';
256
  $temp_field->input_name = 'acf[fields]['.$key.'][sub_fields]['.$key2.'][type]';
 
257
  $temp_field->input_class = 'type';
258
  $temp_field->value = $field->type;
259
  $temp_field->options = array('choices' => $fields_names);
297
  </td>
298
  </tr>
299
  <tr class="field_option field_option_repeater">
300
+ <td class="label">
301
+ <label for="acf[fields][<?php echo $key; ?>][options][row_limit]"><?php _e("Row Limit",'acf'); ?></label>
302
+ </td>
303
+ <td>
304
  <input type="text" name="acf[fields][<?php echo $key; ?>][options][row_limit]" id="acf[fields][<?php echo $key; ?>][options][row_limit]" value="<?php echo $options['row_limit']; ?>" />
305
 
306
+ </td>
307
+ </tr>
308
+ <tr class="field_option field_option_repeater">
309
+ <td class="label">
310
+ <label for="acf[fields][<?php echo $key; ?>][options][layout]"><?php _e("Layout",'acf'); ?></label>
311
+ </td>
312
+ <td>
313
+
314
+ <?php
315
+
316
+ $temp_field->type = 'select';
317
+ $temp_field->input_name = 'acf[fields]['.$key.'][options][layout]';
318
+ $temp_field->input_class = 'type';
319
+ $temp_field->value = $options['layout'];
320
+ $temp_field->options = array('choices' => array(
321
+ 'table' => 'Table (default)',
322
+ 'row' => 'Row'
323
+ ));
324
+
325
+ $this->parent->create_field($temp_field);
326
+
327
+ ?>
328
+
329
+ </td>
330
  </tr>
331
  <?php
332
  }
362
  continue;
363
  }
364
 
365
+ // defaults
366
+ if(!isset($field['label'])) { $field['label'] = ""; }
367
+ if(!isset($field['name'])) { $field['label'] = ""; }
368
+ if(!isset($field['type'])) { $field['label'] = "text"; }
369
+ if(!isset($field['options'])) { $field['options'] = array(); }
370
+
371
+
372
  // format options if needed
373
  if(method_exists($this->parent->fields[$field['type']], 'format_options'))
374
  {
387
  'options' => serialize($field['options']),
388
 
389
  );
390
+
391
+
392
  // options does save. Choices is being overriden by other field options that use the same key name
393
  // update js to disable all other options
394
 
core/fields/select.php CHANGED
@@ -22,11 +22,11 @@ class acf_Select
22
  {
23
  $name_extra = '';
24
  }
25
- echo '<select id="'.$field->input_id.'" class="'.$field->input_class.'" name="'.$field->input_name.$name_extra.'" multiple="multiple" size="5" >';
26
  }
27
  else
28
  {
29
- echo '<select id="'.$field->input_id.'" class="'.$field->input_class.'" name="'.$field->input_name.'" >';
30
  // add top option
31
  //echo '<option value="null">- Select Option -</option>';
32
  }
@@ -112,7 +112,6 @@ class acf_Select
112
  $temp_field->type = 'true_false';
113
  $temp_field->input_name = 'acf[fields]['.$key.'][options][multiple]';
114
  $temp_field->input_class = '';
115
- $temp_field->input_id = 'acf[fields]['.$key.'][options][multiple]';
116
  $temp_field->value = $options['multiple'];
117
  $temp_field->options = array('message' => '');
118
  $this->parent->create_field($temp_field);
22
  {
23
  $name_extra = '';
24
  }
25
+ echo '<select id="'.$field->input_name.'" class="'.$field->input_class.'" name="'.$field->input_name.$name_extra.'" multiple="multiple" size="5" >';
26
  }
27
  else
28
  {
29
+ echo '<select id="'.$field->input_name.'" class="'.$field->input_class.'" name="'.$field->input_name.'" >';
30
  // add top option
31
  //echo '<option value="null">- Select Option -</option>';
32
  }
112
  $temp_field->type = 'true_false';
113
  $temp_field->input_name = 'acf[fields]['.$key.'][options][multiple]';
114
  $temp_field->input_class = '';
 
115
  $temp_field->value = $options['multiple'];
116
  $temp_field->options = array('message' => '');
117
  $this->parent->create_field($temp_field);
core/fields/text.php CHANGED
@@ -13,7 +13,7 @@ class acf_Text
13
 
14
  function html($field)
15
  {
16
- echo '<input type="text" value="'.$field->value.'" id="'.$field->input_id.'" class="'.$field->input_class.'" name="'.$field->input_name.'" />';
17
  }
18
 
19
  function format_value_for_input($value)
13
 
14
  function html($field)
15
  {
16
+ echo '<input type="text" value="'.$field->value.'" id="'.$field->input_name.'" class="'.$field->input_class.'" name="'.$field->input_name.'" />';
17
  }
18
 
19
  function format_value_for_input($value)
core/fields/textarea.php CHANGED
@@ -15,7 +15,7 @@ class acf_Textarea
15
  {
16
  // remove unwanted <br /> tags
17
  $field->value = str_replace('<br />','',$field->value);
18
- echo '<textarea id="'.$field->input_id.'" rows="4" class="'.$field->input_class.'" name="'.$field->input_name.'" >'.$field->value.'</textarea>';
19
  }
20
 
21
  function format_value_for_input($value)
15
  {
16
  // remove unwanted <br /> tags
17
  $field->value = str_replace('<br />','',$field->value);
18
+ echo '<textarea id="'.$field->input_name.'" rows="4" class="'.$field->input_class.'" name="'.$field->input_name.'" >'.$field->value.'</textarea>';
19
  }
20
 
21
  function format_value_for_input($value)
core/fields_meta_box.php CHANGED
@@ -30,7 +30,7 @@
30
  <input type="hidden" name="ei_noncename" id="ei_noncename" value="<?php echo wp_create_nonce('ei-n'); ?>" />
31
 
32
 
33
- <table class="acf">
34
  <thead>
35
  <tr>
36
  <th class="field_order"><?php _e('Field Order','acf'); ?></th>
@@ -50,13 +50,13 @@
50
  <div class="<?php if($key == 999){echo "field_clone";}else{echo "field";} ?>">
51
  <input type="hidden" name="acf[fields][<?php echo $key; ?>][id]'" value="<?php echo $field->id; ?>" />
52
 
53
- <table class="acf">
54
  <tr>
55
  <td class="field_order"><?php echo ($key+1); ?></td>
56
  <td class="field_label">
57
 
58
  <strong>
59
- <a class="acf_edit_field" title="Edit this Field" href="javascript:;"><?php echo $field->label; ?></a>
60
  </strong>
61
  <div class="row_options">
62
  <span><a class="acf_edit_field" title="Edit this Field" href="javascript:;"><?php _e("Edit",'acf'); ?></a> | </span>
@@ -80,7 +80,7 @@
80
  <div class="field_form_mask">
81
  <div class="field_form">
82
 
83
- <table class="acf_input">
84
  <tbody>
85
  <tr class="field_label">
86
  <td class="label">
@@ -93,7 +93,6 @@
93
 
94
  $temp_field->type = 'text';
95
  $temp_field->input_name = 'acf[fields]['.$key.'][label]';
96
- $temp_field->input_id = 'acf[fields]['.$key.'][label]';
97
  $temp_field->input_class = 'label';
98
  $temp_field->value = $field->label;
99
 
@@ -112,7 +111,6 @@
112
 
113
  $temp_field->type = 'text';
114
  $temp_field->input_name = 'acf[fields]['.$key.'][name]';
115
- $temp_field->input_id = 'acf[fields]['.$key.'][name]';
116
  $temp_field->input_class = 'name';
117
  $temp_field->value = $field->name;
118
 
@@ -129,7 +127,6 @@
129
 
130
  $temp_field->type = 'select';
131
  $temp_field->input_name = 'acf[fields]['.$key.'][type]';
132
- $temp_field->input_id = 'acf[fields]['.$key.'][type]';
133
  $temp_field->input_class = 'type';
134
  $temp_field->value = $field->type;
135
  $temp_field->options = array('choices' => $fields_names);
@@ -147,7 +144,6 @@
147
 
148
  $temp_field->type = 'textarea';
149
  $temp_field->input_name = 'acf[fields]['.$key.'][instructions]';
150
- $temp_field->input_id = 'acf[fields]['.$key.'][instructions]';
151
  $temp_field->input_class = 'instructions';
152
  $temp_field->value = $field->instructions;
153
 
@@ -164,7 +160,6 @@
164
  <?php
165
  $temp_field->type = 'true_false';
166
  $temp_field->input_name = 'acf[fields]['.$key.'][save_as_cf]';
167
- $temp_field->input_id = 'acf[fields]['.$key.'][save_as_cf]';
168
  $temp_field->input_class = 'save_as_cf';
169
  $temp_field->value = $field->save_as_cf;
170
  $temp_field->options = array('message' => __("Save this field's value as a standard WordPress Custom Field",'acf'));
30
  <input type="hidden" name="ei_noncename" id="ei_noncename" value="<?php echo wp_create_nonce('ei-n'); ?>" />
31
 
32
 
33
+ <table class="acf widefat">
34
  <thead>
35
  <tr>
36
  <th class="field_order"><?php _e('Field Order','acf'); ?></th>
50
  <div class="<?php if($key == 999){echo "field_clone";}else{echo "field";} ?>">
51
  <input type="hidden" name="acf[fields][<?php echo $key; ?>][id]'" value="<?php echo $field->id; ?>" />
52
 
53
+ <table class="acf widefat">
54
  <tr>
55
  <td class="field_order"><?php echo ($key+1); ?></td>
56
  <td class="field_label">
57
 
58
  <strong>
59
+ <a class="acf_edit_field row-title" title="Edit this Field" href="javascript:;"><?php echo $field->label; ?></a>
60
  </strong>
61
  <div class="row_options">
62
  <span><a class="acf_edit_field" title="Edit this Field" href="javascript:;"><?php _e("Edit",'acf'); ?></a> | </span>
80
  <div class="field_form_mask">
81
  <div class="field_form">
82
 
83
+ <table class="acf_input widefat">
84
  <tbody>
85
  <tr class="field_label">
86
  <td class="label">
93
 
94
  $temp_field->type = 'text';
95
  $temp_field->input_name = 'acf[fields]['.$key.'][label]';
 
96
  $temp_field->input_class = 'label';
97
  $temp_field->value = $field->label;
98
 
111
 
112
  $temp_field->type = 'text';
113
  $temp_field->input_name = 'acf[fields]['.$key.'][name]';
 
114
  $temp_field->input_class = 'name';
115
  $temp_field->value = $field->name;
116
 
127
 
128
  $temp_field->type = 'select';
129
  $temp_field->input_name = 'acf[fields]['.$key.'][type]';
 
130
  $temp_field->input_class = 'type';
131
  $temp_field->value = $field->type;
132
  $temp_field->options = array('choices' => $fields_names);
144
 
145
  $temp_field->type = 'textarea';
146
  $temp_field->input_name = 'acf[fields]['.$key.'][instructions]';
 
147
  $temp_field->input_class = 'instructions';
148
  $temp_field->value = $field->instructions;
149
 
160
  <?php
161
  $temp_field->type = 'true_false';
162
  $temp_field->input_name = 'acf[fields]['.$key.'][save_as_cf]';
 
163
  $temp_field->input_class = 'save_as_cf';
164
  $temp_field->value = $field->save_as_cf;
165
  $temp_field->options = array('message' => __("Save this field's value as a standard WordPress Custom Field",'acf'));
core/input_meta_box.php CHANGED
@@ -100,7 +100,6 @@
100
 
101
  // set value, id and name for field
102
  $field->value = $this->load_value_for_input($post->ID, $field);
103
- $field->input_id = 'acf['.$i.'][value]';
104
  $field->input_name = 'acf['.$i.'][value]';
105
  $field->input_class = '';
106
 
@@ -117,7 +116,7 @@
117
  }
118
 
119
 
120
- echo '<label for="'.$field->input_id.'">'.$field->label.'</label>';
121
 
122
 
123
  if($field->instructions)
100
 
101
  // set value, id and name for field
102
  $field->value = $this->load_value_for_input($post->ID, $field);
 
103
  $field->input_name = 'acf['.$i.'][value]';
104
  $field->input_class = '';
105
 
116
  }
117
 
118
 
119
+ echo '<label for="'.$field->input_name.'">'.$field->label.'</label>';
120
 
121
 
122
  if($field->instructions)
core/location_meta_box.php CHANGED
@@ -21,7 +21,7 @@
21
  <input type="hidden" name="location_meta_box" value="true" />
22
  <input type="hidden" name="ei_noncename" id="ei_noncename" value="<?php echo wp_create_nonce('ei-n'); ?>" />
23
 
24
- <table class="acf_input" id="acf_location">
25
  <tbody>
26
  <tr>
27
  <td class="label">
@@ -32,7 +32,7 @@
32
 
33
  <div class="location_rules">
34
  <?php if($location->rules): ?>
35
- <table class="acf_input" id="location_rules">
36
  <tbody>
37
  <?php foreach($location->rules as $k => $rule): ?>
38
  <tr>
@@ -42,13 +42,12 @@
42
  $temp_field->type = 'select';
43
  $temp_field->input_name = 'acf[location][rules]['.$k.'][param]';
44
  $temp_field->input_class = '';
45
- $temp_field->input_id = '';
46
  $temp_field->value = $rule->param;
47
  $temp_field->options = array('choices' => array(
48
  'post_type' => 'Post Type',
49
  'page' => 'Page',
50
  'page_type' => 'Page Type',
51
- //'page_parent' => 'Page Parent',
52
  'page_template' => 'Page Template',
53
  'post' => 'Post',
54
  'post_category' => 'Post Category',
@@ -66,7 +65,6 @@
66
  $temp_field->type = 'select';
67
  $temp_field->input_name = 'acf[location][rules]['.$k.'][operator]';
68
  $temp_field->input_class = '';
69
- $temp_field->input_id = '';
70
  $temp_field->value = $rule->operator;
71
  $temp_field->options = array('choices' => array(
72
  '==' => 'is equal to',
@@ -90,7 +88,6 @@
90
  $temp_field->type = 'select';
91
  $temp_field->input_name = 'acf[location][rules]['.$k.'][value]';
92
  $temp_field->input_class = '';
93
- $temp_field->input_id = '';
94
  $temp_field->value = $rule->value;
95
  $temp_field->options = array(
96
  'choices' => $choices,
@@ -139,7 +136,7 @@
139
 
140
  ?>
141
  </div>
142
- <?php /*<div rel="page_parent">
143
  <?php
144
  $choices = array();
145
  foreach(get_pages('parent=0&sort_column=menu_order&sort_order=desc') as $page)
@@ -153,7 +150,7 @@
153
  $this->create_field($temp_field);
154
 
155
  ?>
156
- </div> */ ?>
157
  <div rel="page_template">
158
 
159
  <?php
@@ -191,17 +188,21 @@
191
  <div rel="post_category">
192
 
193
  <?php
194
-
195
  $choices = array();
196
- foreach(get_categories() as $v);
 
 
197
  {
198
- $choices[$v->term_id] = $v->name;
 
199
  }
 
 
200
  $temp_field->options = array(
201
  'choices' => $choices,
202
  );
203
 
204
- $this->create_field($temp_field);
205
 
206
  ?>
207
  </div>
@@ -240,7 +241,6 @@
240
  $temp_field->type = 'select';
241
  $temp_field->input_name = 'acf[location][allorany]';
242
  $temp_field->input_class = '';
243
- $temp_field->input_id = '';
244
  $temp_field->value = $location->allorany;
245
  $temp_field->options = array('choices' => array(
246
  'all' => 'all',
21
  <input type="hidden" name="location_meta_box" value="true" />
22
  <input type="hidden" name="ei_noncename" id="ei_noncename" value="<?php echo wp_create_nonce('ei-n'); ?>" />
23
 
24
+ <table class="acf_input widefat" id="acf_location">
25
  <tbody>
26
  <tr>
27
  <td class="label">
32
 
33
  <div class="location_rules">
34
  <?php if($location->rules): ?>
35
+ <table class="acf_input widefat" id="location_rules">
36
  <tbody>
37
  <?php foreach($location->rules as $k => $rule): ?>
38
  <tr>
42
  $temp_field->type = 'select';
43
  $temp_field->input_name = 'acf[location][rules]['.$k.'][param]';
44
  $temp_field->input_class = '';
 
45
  $temp_field->value = $rule->param;
46
  $temp_field->options = array('choices' => array(
47
  'post_type' => 'Post Type',
48
  'page' => 'Page',
49
  'page_type' => 'Page Type',
50
+ 'page_parent' => 'Page Parent',
51
  'page_template' => 'Page Template',
52
  'post' => 'Post',
53
  'post_category' => 'Post Category',
65
  $temp_field->type = 'select';
66
  $temp_field->input_name = 'acf[location][rules]['.$k.'][operator]';
67
  $temp_field->input_class = '';
 
68
  $temp_field->value = $rule->operator;
69
  $temp_field->options = array('choices' => array(
70
  '==' => 'is equal to',
88
  $temp_field->type = 'select';
89
  $temp_field->input_name = 'acf[location][rules]['.$k.'][value]';
90
  $temp_field->input_class = '';
 
91
  $temp_field->value = $rule->value;
92
  $temp_field->options = array(
93
  'choices' => $choices,
136
 
137
  ?>
138
  </div>
139
+ <div rel="page_parent">
140
  <?php
141
  $choices = array();
142
  foreach(get_pages('parent=0&sort_column=menu_order&sort_order=desc') as $page)
150
  $this->create_field($temp_field);
151
 
152
  ?>
153
+ </div>
154
  <div rel="page_template">
155
 
156
  <?php
188
  <div rel="post_category">
189
 
190
  <?php
 
191
  $choices = array();
192
+ $category_ids = get_all_category_ids();
193
+
194
+ foreach($category_ids as $cat_id)
195
  {
196
+ $cat_name = get_cat_name($cat_id);
197
+ $choices[$cat_id] = $cat_name;
198
  }
199
+
200
+
201
  $temp_field->options = array(
202
  'choices' => $choices,
203
  );
204
 
205
+ $this->create_field($temp_field);
206
 
207
  ?>
208
  </div>
241
  $temp_field->type = 'select';
242
  $temp_field->input_name = 'acf[location][allorany]';
243
  $temp_field->input_class = '';
 
244
  $temp_field->value = $location->allorany;
245
  $temp_field->options = array('choices' => array(
246
  'all' => 'all',
core/options_meta_box.php CHANGED
@@ -12,7 +12,7 @@
12
  <input type="hidden" name="options_meta_box" value="true" />
13
  <input type="hidden" name="ei_noncename" id="ei_noncename" value="<?php echo wp_create_nonce('ei-n'); ?>" />
14
 
15
- <table class="acf_input" id="acf_options">
16
  <tr>
17
  <td class="label">
18
  <label for="post_type"><?php _e("Show on page",'acf'); ?></label>
@@ -25,7 +25,6 @@
25
  $temp_field->type = 'checkbox';
26
  $temp_field->input_name = 'acf[options][show_on_page]';
27
  $temp_field->input_class = '';
28
- $temp_field->input_id = 'acf[options][show_on_page]';
29
  $temp_field->value = $options->show_on_page;
30
  $temp_field->options = array(
31
  'choices' => array(
@@ -56,12 +55,11 @@
56
  $temp_field->type = 'select';
57
  $temp_field->input_name = 'acf[options][field_group_layout]';
58
  $temp_field->input_class = '';
59
- $temp_field->input_id = '';
60
  $temp_field->value = $options->field_group_layout;
61
  $temp_field->options = array(
62
  'choices' => array(
63
  'in_box' => 'In a postbox',
64
- 'default' => 'No Box',
65
  )
66
  );
67
 
12
  <input type="hidden" name="options_meta_box" value="true" />
13
  <input type="hidden" name="ei_noncename" id="ei_noncename" value="<?php echo wp_create_nonce('ei-n'); ?>" />
14
 
15
+ <table class="acf_input widefat" id="acf_options">
16
  <tr>
17
  <td class="label">
18
  <label for="post_type"><?php _e("Show on page",'acf'); ?></label>
25
  $temp_field->type = 'checkbox';
26
  $temp_field->input_name = 'acf[options][show_on_page]';
27
  $temp_field->input_class = '';
 
28
  $temp_field->value = $options->show_on_page;
29
  $temp_field->options = array(
30
  'choices' => array(
55
  $temp_field->type = 'select';
56
  $temp_field->input_name = 'acf[options][field_group_layout]';
57
  $temp_field->input_class = '';
 
58
  $temp_field->value = $options->field_group_layout;
59
  $temp_field->options = array(
60
  'choices' => array(
61
  'in_box' => 'In a postbox',
62
+ 'default' => 'No box',
63
  )
64
  );
65
 
core/options_save.php CHANGED
@@ -8,6 +8,8 @@ if(isset($_POST['options_meta_box']) && $_POST['options_meta_box'] == 'true')
8
  // turn inputs into database friendly data
9
  $options = $_POST['acf']['options'];
10
 
 
 
11
 
12
  update_post_meta($post_id, 'show_on_page', serialize($options['show_on_page']));
13
  update_post_meta($post_id, 'field_group_layout', $options['field_group_layout']);
8
  // turn inputs into database friendly data
9
  $options = $_POST['acf']['options'];
10
 
11
+ if(!isset($options['show_on_page'])) { $options['show_on_page'] = array(); }
12
+ if(!isset($options['field_group_layout'])) { $options['field_group_layout'] = 'default'; }
13
 
14
  update_post_meta($post_id, 'show_on_page', serialize($options['show_on_page']));
15
  update_post_meta($post_id, 'field_group_layout', $options['field_group_layout']);
core/screen_extra.php CHANGED
@@ -1,25 +1,25 @@
1
  <div id="screen-meta-activate-acf-wrap" class="screen-meta-wrap hidden acf">
2
  <div class="screen-meta-content">
3
 
4
- <h5>Unlock Special Fields.</h5>
5
- <p>Special Fields can be unlocked by purchasing an activation code. Each activation code can be used on multiple sites. <a href="http://plugins.elliotcondon.com/shop/">Visit the Plugin Store</a></p>
6
- <table class="acf_activate">
7
  <thead>
8
  <tr>
9
- <th>Field Type</th>
10
- <th>Status</th>
11
- <th>Activation Code</th>
12
  </tr>
13
  </thead>
14
  <tbody>
15
  <tr>
16
- <td>Repeater</td>
17
  <td><?php if(array_key_exists('repeater', $this->activated_fields)){
18
- echo 'Active';
19
  }
20
  else
21
  {
22
- echo 'Not Active';
23
  } ?></td>
24
  <td>
25
  <form action="" method="post">
@@ -42,7 +42,7 @@
42
  </div>
43
  </div>
44
  <div id="screen-meta-activate-acf-link-wrap" class="hide-if-no-js screen-meta-toggle acf">
45
- <a href="#screen-meta-activate-acf" id="screen-meta-activate-acf-link" class="show-settings">Unlock Fields</a>
46
  </div>
47
 
48
 
@@ -59,60 +59,31 @@ if($currentFile == 'edit.php'):
59
  <div class="acf_col_right hidden metabox-holder" id="poststuff" >
60
 
61
  <div class="postbox">
62
- <div title="Click to toggle" class="handlediv"><br></div>
63
- <h3 class="hndle"><span><?php _e("Advanced Custom Fields v",'acf'); ?><?php echo $this->version; ?></span>
64
- <a class="thickbox button" href="http://localhost:8888/acf/wp-admin/plugin-install.php?tab=plugin-information&amp;plugin=advanced-custom-fields&amp;section=changelog&amp;TB_iframe=true&amp;width=640&amp;height=570"><?php _e("see what's new",'acf'); ?></a>
65
- </h3>
66
  <div class="inside">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
 
68
 
69
- <table cellpadding="0" cellspacing="0" class="author">
70
- <tr>
71
- <td style="width:24px;">
72
- <img src="<?php echo $this->dir ?>/images/resources.png" />
73
- </td>
74
- <td>
75
- <?php _e("User Guide + Code Examples",'acf'); ?> <a href="http://plugins.elliotcondon.com/advanced-custom-fields/"><?php _e("Visit the Plugin Website",'acf'); ?></a>
76
- </td>
77
- </tr>
78
- </table>
79
- <table cellpadding="0" cellspacing="0" class="author">
80
- <tr>
81
- <td style="width:24px;">
82
- <img src="<?php echo $this->dir ?>/images/need_help.png" />
83
- </td>
84
- <td>
85
- <?php _e("Need Help?",'acf'); ?> <a href="http://support.plugins.elliotcondon.com/categories/advanced-custom-fields/"><?php _e("Visit the Support Forum",'acf'); ?></a>
86
- </td>
87
- </tr>
88
- </table>
89
- <table cellpadding="0" cellspacing="0" class="author">
90
- <tr>
91
- <td style="width:24px;">
92
- <img src="<?php echo $this->dir ?>/images/donate.png" />
93
- </td>
94
- <td>
95
- <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
96
- <input type="hidden" name="cmd" value="_s-xclick">
97
- <input type="hidden" name="hosted_button_id" value="4C9N2WFW6B9QL">
98
- <span><?php _e("Help fund future development",'acf'); ?></span><input type="image" src="https://www.paypalobjects.com/WEBSCR-640-20110306-1/en_AU/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
99
- <img alt="" border="0" src="https://www.paypalobjects.com/WEBSCR-640-20110306-1/en_AU/i/scr/pixel.gif" width="1" height="1">
100
- </form>
101
- <!-- Help fund future development <a href="http://www.elliotcondon.com">Donate here</a> -->
102
- </td>
103
- </tr>
104
- </table>
105
- <table cellpadding="0" cellspacing="0" class="author">
106
- <tr>
107
- <td style="width:24px;">
108
- <img src="<?php echo $this->dir ?>/images/elliot_condon.png" />
109
- </td>
110
- <td>
111
- <?php _e("Created by",'acf'); ?> <a href="http://www.elliotcondon.com">Elliot Condon</a>
112
- </td>
113
- </tr>
114
- </table>
115
  </div>
116
  </div>
117
  </div>
 
118
  <?php endif; ?>
1
  <div id="screen-meta-activate-acf-wrap" class="screen-meta-wrap hidden acf">
2
  <div class="screen-meta-content">
3
 
4
+ <h5><?php _e("Unlock Special Fields.",'acf'); ?></h5>
5
+ <p><?php _e("Special Fields can be unlocked by purchasing an activation code. Each activation code can be used on multiple sites.",'acf'); ?> <a href="http://plugins.elliotcondon.com/shop/"><?php _e("Visit the Plugin Store",'acf'); ?></a></p>
6
+ <table class="acf_activate widefat">
7
  <thead>
8
  <tr>
9
+ <th><?php _e("Field Type",'acf'); ?></th>
10
+ <th><?php _e("Status",'acf'); ?></th>
11
+ <th><?php _e("Activation Code",'acf'); ?></th>
12
  </tr>
13
  </thead>
14
  <tbody>
15
  <tr>
16
+ <td><?php _e("Repeater",'acf'); ?></td>
17
  <td><?php if(array_key_exists('repeater', $this->activated_fields)){
18
+ _e("Active",'acf');
19
  }
20
  else
21
  {
22
+ _e("Inactive",'acf');
23
  } ?></td>
24
  <td>
25
  <form action="" method="post">
42
  </div>
43
  </div>
44
  <div id="screen-meta-activate-acf-link-wrap" class="hide-if-no-js screen-meta-toggle acf">
45
+ <a href="#screen-meta-activate-acf" id="screen-meta-activate-acf-link" class="show-settings"><?php _e("Unlock Fields",'acf'); ?></a>
46
  </div>
47
 
48
 
59
  <div class="acf_col_right hidden metabox-holder" id="poststuff" >
60
 
61
  <div class="postbox">
62
+ <div class="handlediv"><br></div>
63
+ <h3 class="hndle"><span><?php _e("Advanced Custom Fields v",'acf'); ?><?php echo $this->version; ?></span></h3>
 
 
64
  <div class="inside">
65
+ <div class="field">
66
+ <h4><?php _e("Changelog",'acf'); ?></h4>
67
+ <p><?php _e("See what's new in",'acf'); ?> <a class="thickbox" href="<?php bloginfo('url'); ?>/wp-admin/plugin-install.php?tab=plugin-information&plugin=advanced-custom-fields&section=changelog&TB_iframe=true&width=640&height=559">v<?php echo $this->version; ?></a>
68
+ </div>
69
+ <div class="field">
70
+ <h4><?php _e("Resources",'acf'); ?></h4>
71
+ <p><?php _e("Watch tutorials, read documentation, learn the API code and find some tips &amp; tricks for your next web project.",'acf'); ?><br />
72
+ <a href="http://plugins.elliotcondon.com/advanced-custom-fields/"><?php _e("View the plugins website",'acf'); ?></a></p>
73
+ </div>
74
+ <div class="field">
75
+ <h4><?php _e("Support",'acf'); ?></h4>
76
+ <p><?php _e("Join the growing community over at the support forum to share ideas, report bugs and keep up to date with ACF",'acf'); ?><br />
77
+ <a href="http://support.plugins.elliotcondon.com/categories/advanced-custom-fields/"><?php _e("View the Support Forum",'acf'); ?></a></p>
78
+ </div>
79
+ <div class="field">
80
+ <h4><?php _e("Developed by",'acf'); ?> Elliot Condon</h4>
81
+ <p><a href="http://wordpress.org/extend/plugins/advanced-custom-fields/"><?php _e("Vote for ACF",'acf'); ?></a> | <a href="http://twitter.com/elliotcondon"><?php _e("Twitter",'acf'); ?></a> | <a href="http://blog.elliotcondon.com"><?php _e("Blog",'acf'); ?></a></p>
82
+ </div>
83
 
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  </div>
86
  </div>
87
  </div>
88
+
89
  <?php endif; ?>
core/update.php CHANGED
@@ -588,4 +588,6 @@ if(version_compare($version,'2.0.2') < 0)
588
 
589
  }
590
 
 
 
591
  ?>
588
 
589
  }
590
 
591
+ update_option('acf_version',$this->version);
592
+
593
  ?>
css/style.fields.css CHANGED
@@ -3,7 +3,7 @@
3
  ---------------------------------------------------------------------------------------------*/
4
 
5
  .postbox#acf_fields {
6
- background: #fff;
7
  }
8
 
9
  .postbox#acf_fields .handlediv {
@@ -25,21 +25,22 @@
25
  .fields {
26
  position: relative;
27
  overflow: hidden;
28
- background: #F4F4F4;
29
  }
30
 
31
  .fields .field {
32
  position: relative;
33
  overflow: hidden;
 
34
  border-bottom: #DFDFDF solid 1px;
35
  }
36
 
37
  .fields .field:nth-child(even) {
38
- background: #fefefe;
39
  }
40
 
41
  .fields .field:nth-child(odd) {
42
- background: #F9F9F9;
43
  }
44
 
45
  .fields .field:hover {
@@ -62,8 +63,14 @@
62
  border-bottom: 0 none;
63
  }
64
 
65
- #acf_fields table{border-collapse:separate; border-spacing:0; vertical-align:top; width: 100%;}
 
 
 
66
 
 
 
 
67
 
68
  .acf,
69
  .acf tr,
@@ -75,7 +82,7 @@
75
  /*---------------------------------------------------------------------------------------------
76
  Table Heading
77
  ---------------------------------------------------------------------------------------------*/
78
- .acf tr th {
79
  background: url("../../../../wp-admin/images/gray-grad.png") repeat-x scroll left top #DFDFDF;
80
  text-shadow: 0 1px 0 #FFFFFF;
81
  color: #333;
@@ -84,7 +91,7 @@
84
  line-height: 1.3;
85
  padding: 8px;
86
  text-align: left;
87
- }
88
 
89
  .acf tr th span {
90
  color: #666;
3
  ---------------------------------------------------------------------------------------------*/
4
 
5
  .postbox#acf_fields {
6
+
7
  }
8
 
9
  .postbox#acf_fields .handlediv {
25
  .fields {
26
  position: relative;
27
  overflow: hidden;
28
+ background: #F5F5F5;
29
  }
30
 
31
  .fields .field {
32
  position: relative;
33
  overflow: hidden;
34
+ border-top: #fff solid 1px;;
35
  border-bottom: #DFDFDF solid 1px;
36
  }
37
 
38
  .fields .field:nth-child(even) {
39
+ background: #FCFCFC;
40
  }
41
 
42
  .fields .field:nth-child(odd) {
43
+
44
  }
45
 
46
  .fields .field:hover {
63
  border-bottom: 0 none;
64
  }
65
 
66
+ table.widefat.acf {
67
+ border: 0 none;
68
+ background: transparent none;
69
+ }
70
 
71
+ table.widefat.acf td {
72
+ border: 0 none;
73
+ }
74
 
75
  .acf,
76
  .acf tr,
82
  /*---------------------------------------------------------------------------------------------
83
  Table Heading
84
  ---------------------------------------------------------------------------------------------*/
85
+ /*.acf tr th {
86
  background: url("../../../../wp-admin/images/gray-grad.png") repeat-x scroll left top #DFDFDF;
87
  text-shadow: 0 1px 0 #FFFFFF;
88
  color: #333;
91
  line-height: 1.3;
92
  padding: 8px;
93
  text-align: left;
94
+ }*/
95
 
96
  .acf tr th span {
97
  color: #666;
css/style.global.css CHANGED
@@ -1,14 +1,20 @@
 
 
 
1
  table.acf_input {
 
 
 
 
2
  border: #DFDFDF solid 1px;
3
- border-collapse:separate;
4
- border-spacing:0;
5
- vertical-align:top;
6
- width: 100%;
7
- background: #FEFEFE;
8
  }
9
 
10
  table.acf_input tr:nth-child(even) {
11
- background: #F9F9F9
12
  }
13
 
14
  table.acf_input tr:nth-child(odd) {
@@ -19,23 +25,14 @@ table.acf_input tr.field_save {
19
  background: #EAF2FA;
20
  }
21
 
22
- table.acf_input tr td {
23
- border-bottom: #DFDFDF solid 1px;
24
- border-right: #DFDFDF solid 1px;
25
- padding: 10px 8px;
26
- }
27
-
28
- table.acf_input tr:last-child td {
29
  border-bottom: 0 none;
30
  }
31
 
32
- table.acf_input tr td:last-child {
33
- border-right: 0 none;
34
- }
35
-
36
  table.acf_input tbody tr td.label {
37
  width: 24%;
38
  vertical-align: top;
 
39
  }
40
 
41
  table.acf_input tbody tr td.label label{
@@ -44,6 +41,8 @@ table.acf_input tbody tr td.label label{
44
  font-weight: bold;
45
  padding: 0;
46
  margin: 0;
 
 
47
  }
48
 
49
  table.acf_input tbody tr td.label label span.required {
@@ -59,7 +58,7 @@ table.acf_input tbody tr td.label p{
59
  padding: 6px 0 !important;
60
  margin: 0 !important;
61
  font-style: normal;
62
- line-height: 12px;
63
  color: #666;
64
  }
65
 
1
+ /*---------------------------------------------------------------------------------------------
2
+ Table
3
+ ---------------------------------------------------------------------------------------------*/
4
  table.acf_input {
5
+ border: 0 none;
6
+ }
7
+
8
+ .field_form table.acf_input {
9
  border: #DFDFDF solid 1px;
10
+ }
11
+
12
+ table.acf_input tbody tr td {
13
+ padding: 10px;
 
14
  }
15
 
16
  table.acf_input tr:nth-child(even) {
17
+ background: #FCFCFC;
18
  }
19
 
20
  table.acf_input tr:nth-child(odd) {
25
  background: #EAF2FA;
26
  }
27
 
28
+ table.acf_input tbody tr:last-child td {
 
 
 
 
 
 
29
  border-bottom: 0 none;
30
  }
31
 
 
 
 
 
32
  table.acf_input tbody tr td.label {
33
  width: 24%;
34
  vertical-align: top;
35
+ border-right: #DFDFDF solid 1px;
36
  }
37
 
38
  table.acf_input tbody tr td.label label{
41
  font-weight: bold;
42
  padding: 0;
43
  margin: 0;
44
+ color: #333;
45
+
46
  }
47
 
48
  table.acf_input tbody tr td.label label span.required {
58
  padding: 6px 0 !important;
59
  margin: 0 !important;
60
  font-style: normal;
61
+ line-height: 16px;
62
  color: #666;
63
  }
64
 
css/style.input.css CHANGED
@@ -13,7 +13,6 @@
13
  position: relative;
14
  padding: 10px 2px;
15
  border-top: 1px solid #eaeaea;
16
- -moz-box-shadow: inset 0px 1px 0px #fff; -webkit-box-shadow: inset 0px 1px 0px #fff; box-shadow: inset 0px 1px 0px #fff;
17
  }
18
 
19
  .acf_fields_input .field label {
@@ -32,6 +31,7 @@
32
 
33
  .postbox#acf_input > .inside {
34
  margin: 0;
 
35
  }
36
 
37
  .postbox#acf_input > .handlediv {
@@ -43,6 +43,7 @@
43
  .acf_wysiwyg {
44
  border: #DFDFDF solid 1px;
45
  overflow: hidden;
 
46
  }
47
 
48
  #post-body .acf_wysiwyg .wp_themeSkin .mceStatusbar a.mceResize {
@@ -104,6 +105,7 @@
104
 
105
  .acf_image_uploader p {
106
  display: block;
 
107
  }
108
 
109
  .acf_image_uploader.active p {
@@ -117,6 +119,10 @@
117
  position: relative;
118
  }
119
 
 
 
 
 
120
  .acf_file_uploader p.file {
121
  display: none;
122
  }
@@ -143,14 +149,7 @@
143
  }
144
 
145
  .repeater > table {
146
- width: 100%;
147
- border-bottom: 0 none;
148
- -moz-border-radius: 5px; -webkit-border-radius: 5px; -khtml-border-radius: 5px; border-radius: 5px;
149
- border-collapse:separate; border-spacing:0; vertical-align:top; width: 100%;
150
- position: relative;
151
- overflow: hidden;
152
- border: 1px solid #DFDFDF;
153
- background: #fefefe;
154
  }
155
 
156
  .repeater > table > tbody > tr > td {
@@ -174,22 +173,12 @@
174
  }
175
 
176
  .repeater > table > tbody > tr:nth-child(odd) {
177
- background: #F9F9F9;
178
  }
179
 
180
  .repeater > table > thead > tr > th {
181
-
182
- color: #21759B;
183
- text-shadow: #fff 0 1px 0;
184
- padding: 8px;
185
- text-align: left;
186
- font-size: 12px;
187
- border-bottom: 1px solid #e1e1e1;
188
  border-right: 1px solid #e1e1e1;
189
- background: #f8f8f8;
190
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#f0f0f0', endColorstr='#e6e6e6'); /* for IE */
191
- background: -webkit-gradient(linear, left top, left bottom, from(#f0f0f0), to(#e6e6e6)); /* for webkit browsers */
192
- background: -moz-linear-gradient(top, #f0f0f0, #e6e6e6); /* for firefox 3.6+ */
193
  }
194
 
195
  .repeater > table > thead > tr > th:last-child {
@@ -204,6 +193,14 @@
204
  visibility: hidden;
205
  }
206
 
 
 
 
 
 
 
 
 
207
  a.remove_field {
208
  display: block;
209
  width: 16px;
@@ -232,6 +229,7 @@ a.remove_field:hover {
232
  .repeater table tr td.remove,
233
  .repeater table tr th.remove {
234
  width: 16px;
 
235
  }
236
 
237
  .repeater > table td.order a.order_up {
@@ -304,21 +302,20 @@ ul.checkbox_list {
304
  }
305
 
306
  #acf_input .acf_fields_input .postbox {
307
- background: #fdfdfd;
308
  }
309
 
310
  #acf_input .acf_fields_input .postbox .inside {
311
  margin: 0;
312
-
313
  }
314
 
315
  #acf_input .acf_fields_input .postbox .inside .field {
316
  padding: 10px 10px;
317
- border-top: 1px solid #f3f3f3;
318
- -moz-box-shadow: inset 0px 1px 0px #fff; -webkit-box-shadow: inset 0px 1px 0px #fff; box-shadow: inset 0px 1px 0px #fff;
319
  }
320
 
321
- #acf_input .acf_fields_input .postbox .inside .field:first-child {
322
- border-top: none;
323
- -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none;
324
  }
13
  position: relative;
14
  padding: 10px 2px;
15
  border-top: 1px solid #eaeaea;
 
16
  }
17
 
18
  .acf_fields_input .field label {
31
 
32
  .postbox#acf_input > .inside {
33
  margin: 0;
34
+ padding: 0;
35
  }
36
 
37
  .postbox#acf_input > .handlediv {
43
  .acf_wysiwyg {
44
  border: #DFDFDF solid 1px;
45
  overflow: hidden;
46
+ background: #fff;
47
  }
48
 
49
  #post-body .acf_wysiwyg .wp_themeSkin .mceStatusbar a.mceResize {
105
 
106
  .acf_image_uploader p {
107
  display: block;
108
+ margin: 0 !important;
109
  }
110
 
111
  .acf_image_uploader.active p {
119
  position: relative;
120
  }
121
 
122
+ .acf_file_uploader p {
123
+ margin: 0 !important;
124
+ }
125
+
126
  .acf_file_uploader p.file {
127
  display: none;
128
  }
149
  }
150
 
151
  .repeater > table {
152
+
 
 
 
 
 
 
 
153
  }
154
 
155
  .repeater > table > tbody > tr > td {
173
  }
174
 
175
  .repeater > table > tbody > tr:nth-child(odd) {
176
+ background: #FCFCFC;
177
  }
178
 
179
  .repeater > table > thead > tr > th {
180
+
 
 
 
 
 
 
181
  border-right: 1px solid #e1e1e1;
 
 
 
 
182
  }
183
 
184
  .repeater > table > thead > tr > th:last-child {
193
  visibility: hidden;
194
  }
195
 
196
+ .repeater > table.row_layout > tbody > tr > td > label {
197
+ padding-top: 20px;
198
+ }
199
+
200
+ .repeater > table.row_layout > tbody > tr > td > label:first-child {
201
+ padding-top: 0;
202
+ }
203
+
204
  a.remove_field {
205
  display: block;
206
  width: 16px;
229
  .repeater table tr td.remove,
230
  .repeater table tr th.remove {
231
  width: 16px;
232
+ vertical-align: middle;
233
  }
234
 
235
  .repeater > table td.order a.order_up {
302
  }
303
 
304
  #acf_input .acf_fields_input .postbox {
305
+
306
  }
307
 
308
  #acf_input .acf_fields_input .postbox .inside {
309
  margin: 0;
310
+ padding: 0;
311
  }
312
 
313
  #acf_input .acf_fields_input .postbox .inside .field {
314
  padding: 10px 10px;
315
+ border-top: 1px solid #fff;
316
+ border-bottom: #DFDFDF solid 1px;
317
  }
318
 
319
+ #acf_input .acf_fields_input .postbox .inside .field:last-child {
320
+ border-bottom: none;
 
321
  }
css/style.location.css CHANGED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
  .postbox#acf_location h3 span.description {
2
  font-size: 11px;
3
  color: #666;
@@ -10,20 +19,6 @@ table.acf_input > tbody > tr > td > select[multiple="multiple"] {
10
  height: auto !important;
11
  }
12
 
13
- .postbox#acf_location a.help {
14
- width: 16px;
15
- height: 17px;
16
- background: url(../images/help.png) 0 0 no-repeat;
17
- position: absolute;
18
- top: 5px;
19
- right: 5px;
20
- }
21
-
22
- .postbox#acf_location .handlediv {
23
- display: none;
24
- }
25
-
26
-
27
  td.param {
28
  width: 40%;
29
  }
@@ -35,7 +30,7 @@ td.operator {
35
  Location Rules
36
  ---------------------------------------------------------------------------------------------*/
37
  .location_rules {
38
-
39
  }
40
 
41
  table#location_rules {
@@ -48,19 +43,20 @@ table#location_rules tr {
48
 
49
  table#location_rules tr td {
50
  padding: 4px;
51
- border-right: 0 none;
52
  }
53
 
54
- table#location_rules tr:nth-child(odd) {
55
- background: #F9F9F9
56
  }
57
 
58
- table#location_rules tr:nth-child(even) {
59
- background: transparent;
60
  }
61
 
62
  table#location_rules tr td.buttons {
63
  width: 40px;
 
64
  }
65
 
66
  table#location_rules a.remove {
1
+ .postbox#acf_location .inside {
2
+ margin: 0;
3
+ padding: 0;
4
+ }
5
+
6
+ .postbox#acf_location .widefat {
7
+ border: 0 none;
8
+ }
9
+
10
  .postbox#acf_location h3 span.description {
11
  font-size: 11px;
12
  color: #666;
19
  height: auto !important;
20
  }
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  td.param {
23
  width: 40%;
24
  }
30
  Location Rules
31
  ---------------------------------------------------------------------------------------------*/
32
  .location_rules {
33
+
34
  }
35
 
36
  table#location_rules {
43
 
44
  table#location_rules tr td {
45
  padding: 4px;
46
+ border: 0 none;
47
  }
48
 
49
+ table#location_rules tr td:first-child {
50
+ padding-left: 0;
51
  }
52
 
53
+ table#location_rules tr td:last-child {
54
+ padding-right: 0;
55
  }
56
 
57
  table#location_rules tr td.buttons {
58
  width: 40px;
59
+ vertical-align: middle;
60
  }
61
 
62
  table#location_rules a.remove {
css/style.options.css CHANGED
@@ -1,5 +1,6 @@
1
- .postbox#acf_options .inner {
2
- background: none repeat scroll 0 0 #F9F9F9;
 
3
  }
4
 
5
  .postbox#acf_options h3 span.description {
1
+ .postbox#acf_options .inside {
2
+ margin: 0;
3
+ padding: 0;
4
  }
5
 
6
  .postbox#acf_options h3 span.description {
css/style.screen_extra.css CHANGED
@@ -1,41 +1,22 @@
1
  /*--------------------------------------------------------------------------------------------
2
- Admin
3
  --------------------------------------------------------------------------------------------*/
4
  .acf_cols {position: relative; overflow: hidden; clear: both;}
5
- .acf_col_left {margin-right: 400px;}
6
  .acf_col_left .tablenav {display: none;}
7
  .acf_col_left p.search-box {display: none;}
8
  .acf_col_left form {overflow: hidden; position: relative; clear: left;}
9
 
10
 
11
- .acf_col_right {float: right; width: 380px; padding-top: 86px !important;}
12
- .acf_col_right ul li,
13
- .acf_col_right ol li {font-size: 11px; line-height: 14px;}
14
- .acf_col_right ul {list-style: square outside; padding-left: 20px;}
15
- .acf_col_right#poststuff .inside p {margin: 12px 6px 12px;}
16
- .acf_col_right table.author {
17
- border: #cde1e8 solid 1px;
18
- background: #f0f7f9;
19
- border-spacing: 0;
20
- clear: both;
21
- margin: 0;
22
- width: 100%;
23
- margin: 4px 0;}
24
- .acf_col_right table.author td {padding: 5px; font-size: 12px; line-height: 24px;}
25
-
26
- #poststuff.acf_col_right .inside {
27
- margin: 2px 6px 4px;
28
- }
29
-
30
- .acf_col_right form span {
31
- float: left;
32
  }
33
 
34
- .acf_col_right form input[type="image"]{
35
- display: block;
36
- float: left;
37
- margin: 0 0 0 8px;
38
- padding: 0;
39
  }
40
 
41
  .postbox h3.hndle {
@@ -48,7 +29,19 @@
48
  line-height: 12px;
49
  position: absolute;
50
  right: 6px;
51
- top: 2px;
 
 
 
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  /*--------------------------------------------------------------------------------------------
@@ -56,7 +49,7 @@
56
  --------------------------------------------------------------------------------------------*/
57
  .screen-meta-toggle.acf {
58
  float: right;
59
- background: none repeat scroll 0 0 #33aee6;
60
  border-radius: 0 0 3px 3px;
61
  float: right;
62
  font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
@@ -66,10 +59,9 @@
66
  }
67
 
68
  #screen-meta-links .acf a.show-settings {
69
- color: #fff;
70
- text-shadow: #175d7d 0 1px 0;
71
  padding: 0 16px;
72
  background: 0 none;
 
73
  }
74
 
75
  .screen-meta-wrap h5 {
@@ -98,15 +90,6 @@ table.acf_activate {
98
  background: #FEFEFE;
99
  }
100
 
101
- table.acf_activate thead tr {
102
- background: #F9F9F9 !important;
103
- }
104
-
105
- table.acf_activate thead tr th {
106
- text-align: left;
107
- color: #21759B;
108
- }
109
-
110
  table.acf_activate tr:nth-child(even) {
111
  background: #F9F9F9
112
  }
1
  /*--------------------------------------------------------------------------------------------
2
+ Screen Extra
3
  --------------------------------------------------------------------------------------------*/
4
  .acf_cols {position: relative; overflow: hidden; clear: both;}
5
+ .acf_col_left {margin-right: 300px;}
6
  .acf_col_left .tablenav {display: none;}
7
  .acf_col_left p.search-box {display: none;}
8
  .acf_col_left form {overflow: hidden; position: relative; clear: left;}
9
 
10
 
11
+ .acf_col_right {
12
+ float: right;
13
+ width: 281px;
14
+ padding-top: 86px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
 
17
+ #poststuff.acf_col_right .inside {
18
+ margin: 0;
19
+ padding: 0;
 
 
20
  }
21
 
22
  .postbox h3.hndle {
29
  line-height: 12px;
30
  position: absolute;
31
  right: 6px;
32
+ top: 4px;
33
+ }
34
+
35
+ #poststuff.acf_col_right .inside .field {
36
+ border-bottom: #DFDFDF solid 1px;
37
+ border-top: #FFFFFF solid 1px;
38
+ padding: 6px 10px;
39
+ }
40
+
41
+ #poststuff.acf_col_right .inside h4,
42
+ #poststuff.acf_col_right .inside p {
43
+ margin: 3px 0;
44
+ padding: 0;
45
  }
46
 
47
  /*--------------------------------------------------------------------------------------------
49
  --------------------------------------------------------------------------------------------*/
50
  .screen-meta-toggle.acf {
51
  float: right;
52
+ background: none repeat scroll 0 0 #EAF2FA;
53
  border-radius: 0 0 3px 3px;
54
  float: right;
55
  font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
59
  }
60
 
61
  #screen-meta-links .acf a.show-settings {
 
 
62
  padding: 0 16px;
63
  background: 0 none;
64
+ border-top: 0 none;
65
  }
66
 
67
  .screen-meta-wrap h5 {
90
  background: #FEFEFE;
91
  }
92
 
 
 
 
 
 
 
 
 
 
93
  table.acf_activate tr:nth-child(even) {
94
  background: #F9F9F9
95
  }
images/donate.png DELETED
Binary file
images/elliot_condon.png DELETED
Binary file
images/field_options.png DELETED
Binary file
images/help.png DELETED
Binary file
images/need_help.png DELETED
Binary file
images/resources.png DELETED
Binary file
js/functions.fields.js CHANGED
@@ -106,6 +106,8 @@
106
  var fields = field.closest('.fields');
107
 
108
  field.remove();
 
 
109
  if(!fields.children('.field').exists())
110
  {
111
  // no more fields, show the message
@@ -185,7 +187,8 @@
185
 
186
 
187
  // append to table
188
- fields.append(new_field);
 
189
 
190
 
191
  // remove no fields message
106
  var fields = field.closest('.fields');
107
 
108
  field.remove();
109
+ update_order_numbers();
110
+
111
  if(!fields.children('.field').exists())
112
  {
113
  // no more fields, show the message
187
 
188
 
189
  // append to table
190
+ fields.children('.field_clone').before(new_field);
191
+ //fields.append(new_field);
192
 
193
 
194
  // remove no fields message
js/functions.input.js CHANGED
@@ -164,7 +164,11 @@
164
  });
165
 
166
  div.add_remove_buttons();
167
- div.make_sortable();
 
 
 
 
168
 
169
  if(div.children('table').children('tbody').children('tr').length == 1)
170
  {
@@ -300,6 +304,10 @@
300
  {
301
  // do nothing, we want to keep this hidden field with it's current values
302
  }
 
 
 
 
303
  else
304
  {
305
  $(this).val('');
164
  });
165
 
166
  div.add_remove_buttons();
167
+
168
+ if(row_limit > 1){
169
+ div.make_sortable();
170
+ }
171
+
172
 
173
  if(div.children('table').children('tbody').children('tr').length == 1)
174
  {
304
  {
305
  // do nothing, we want to keep this hidden field with it's current values
306
  }
307
+ else if(name.indexOf("date_format") != -1)
308
+ {
309
+ // do nothing, we want to keep this hidden field with it's current values
310
+ }
311
  else
312
  {
313
  $(this).val('');
readme.txt CHANGED
@@ -81,6 +81,17 @@ http://support.plugins.elliotcondon.com/categories/advanced-custom-fields/
81
 
82
  == Changelog ==
83
 
 
 
 
 
 
 
 
 
 
 
 
84
  = 2.0.2 =
85
  * Added new database table "acf_rules"
86
  * Removed database table "ac_options"
@@ -90,7 +101,7 @@ http://support.plugins.elliotcondon.com/categories/advanced-custom-fields/
90
  * Added new option "Field group layout" - you can now wrap your fields in a metabox!
91
  * General housekeeping
92
 
93
- =2.0.1=
94
  * Added Field Option: Field Instructions
95
  * Added Field Option: Is field searchable? (saves field value as a normal custom field so you can use the field against wp queries)
96
  * Added Media Search / Pagination to Image / File thickbox
@@ -98,7 +109,7 @@ http://support.plugins.elliotcondon.com/categories/advanced-custom-fields/
98
  * Fixed "Select Image" / "Select File" text on thickbox buttons after upload
99
  * Repeater field now returns null if no data was added
100
 
101
- =2.0.0=
102
  * Completely re-designed the ACF edit page
103
  * Added repeater field (unlocked through external purchase)
104
  * Fixed minor js bugs
81
 
82
  == Changelog ==
83
 
84
+ = 2.0.3 =
85
+ * Added Option: Repeater Layout (Row / Table)
86
+ * Fixed bug: Now you can search for media in the image / file fields
87
+ * Added Option: Image field save format (image url / attachment id)
88
+ * Added Option: File field save format (file url / attachment id)
89
+ * Fixed bug: Location rules for post categories now work
90
+ * Added rule: Page parent
91
+ * Fixed bug: "what's new" button now shows the changelog
92
+ * included new css style to fit in with WordPress 3.2
93
+ * minor JS improvements
94
+
95
  = 2.0.2 =
96
  * Added new database table "acf_rules"
97
  * Removed database table "ac_options"
101
  * Added new option "Field group layout" - you can now wrap your fields in a metabox!
102
  * General housekeeping
103
 
104
+ = 2.0.1 =
105
  * Added Field Option: Field Instructions
106
  * Added Field Option: Is field searchable? (saves field value as a normal custom field so you can use the field against wp queries)
107
  * Added Media Search / Pagination to Image / File thickbox
109
  * Fixed "Select Image" / "Select File" text on thickbox buttons after upload
110
  * Repeater field now returns null if no data was added
111
 
112
+ = 2.0.0 =
113
  * Completely re-designed the ACF edit page
114
  * Added repeater field (unlocked through external purchase)
115
  * Fixed minor js bugs