acf_field_tab

The Advanced Custom Fields acf field tab class.

Defined (1)

The class is defined in the following location(s).

/core/fields/tab.php  
  1. class acf_field_tab extends acf_field 
  2.  
  3. /** 
  4. * __construct 
  5. * Set name / label needed for actions / filters 
  6. * @since 3.6 
  7. * @date 23/01/13 
  8. */ 
  9.  
  10. function __construct() 
  11. // vars 
  12. $this->name = 'tab'; 
  13. $this->label = __("Tab", 'acf'); 
  14. $this->category = __("Layout", 'acf'); 
  15.  
  16.  
  17. // do not delete! 
  18. parent::__construct(); 
  19.  
  20.  
  21. /** 
  22. * create_field() 
  23. * Create the HTML interface for your field 
  24. * @param $field - an array holding all the field's data 
  25. * @type action 
  26. * @since 3.6 
  27. * @date 23/01/13 
  28. */ 
  29.  
  30. function create_field( $field ) 
  31. echo '<div class="acf-tab">' . $field['label'] . '</div>'; 
  32.  
  33.  
  34.  
  35. /** 
  36. * create_options() 
  37. * Create extra options for your field. This is rendered when editing a field. 
  38. * The value of $field['name'] can be used (like bellow) to save extra data to the $field 
  39. * @param $field - an array holding all the field's data 
  40. * @type action 
  41. * @since 3.6 
  42. * @date 23/01/13 
  43. */ 
  44.  
  45. function create_options( $field ) 
  46. ?> 
  47. <tr class="field_option field_option_<?php echo $this->name; ?>"> 
  48. <td class="label"> 
  49. <label><?php _e("Instructions", 'acf'); ?></label> 
  50. </td> 
  51. <td> 
  52. <p><?php _e("Use \"Tab Fields\" to better organize your edit screen by grouping your fields together under separate tab headings.", 'acf'); ?></p> 
  53. <p><?php _e("All the fields following this \"tab field\" (or until another \"tab field\" is defined) will be grouped together.", 'acf'); ?></p> 
  54. <p><?php _e("Use multiple tabs to divide your fields into sections.", 'acf'); ?></p> 
  55. </td> 
  56. </tr> 
  57. <?php 
  58.  
  59.