Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Advanced Custom Fields

By: brasofilo on Feb 8th, 2012  |  syntax: PHP  |  size: 2.06 KB  |  views: 293  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. // FILE core/admin/meta_box_input.php
  4. // MOD  line 44 : added ID, works ok
  5. // OBS  this is the main mod, will put an ID to all Fields when rendered
  6. echo '<div class="field field-' . $field['type'] . $required_class . '" id="'.$field['name'].'">';
  7.  
  8. // FILE core/admin/meta_box_input.php
  9. // MOD  line 46 : added Class for the label, the class is the same as the Div ID above, works ok
  10. // OBS  maybe just giving an ID to the container Div above, all CSS styling would be easier...
  11. echo '<label class="field_label '.$field['name'].'" for="fields[' . $field['key'] . ']">' . $field['label'] . $required_label . '</label>';
  12.  
  13.  
  14. // FILE core/fields/checkbox.php
  15. // MOD  line 62 : add ID to the input, works ok
  16. echo '<li><label><input type="checkbox" class="' . $field['class'] . '" name="' . $field['name'] . '" value="' . $key . '" ' . $selected . ' id="'.$key.'" />' . $value . '</label></li>';
  17.  
  18.  
  19. // FILE core/fields/color_picker.php
  20. // MOD  line 125 : the id should be 'key' instead of 'name' - the field name is not in the $field var - as this is one of the few with default ID, i'm not sure if it's being used elsewhere
  21. echo '<input type="text" value="' . $field['value'] . '" class="acf_color_picker" name="' . $field['name'] . '" id="' . $field['key'] . '" />';
  22.  
  23.  
  24. // FILE core/fields/date_picker.php
  25. // MOD  line 97 : added id - the field name is not in the $field var
  26. echo '<input type="text" value="' . $field['value'] . '" class="acf_datepicker" name="' . $field['name'] . '" data-date_format="' . $field['date_format'] . '" id="' . $field['key'] . '" />';
  27.  
  28.  
  29. // FILE core/fields/radio.php
  30. // MOD  line 70 : added id to input, works ok
  31. echo '<li><label><input type="radio" name="' . $field['name'] . '" value="' . $key . '" ' . $selected . ' id="'.$key.'" />' . $value . '</label></li>';
  32.  
  33.  
  34. // FILE core/fields/true_false.php
  35. // MOD  line 45 : added ID, but there's no name in the $field var, used key instead
  36. echo '<li><label><input type="checkbox" name="'.$field['name'].'" value="1" ' . $selected . ' id="'.$field['key'].'" />' . $field['message'] . '</label></li>';