acf_field_message

The Advanced Custom Fields acf field message class.

Defined (1)

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

/core/fields/message.php  
  1. class acf_field_message 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 = 'message'; 
  13. $this->label = __("Message", 'acf'); 
  14. $this->category = __("Layout", 'acf'); 
  15. $this->defaults = array( 
  16. 'message' => '',  
  17. ); 
  18.  
  19.  
  20. // do not delete! 
  21. parent::__construct(); 
  22.  
  23.  
  24. /** 
  25. * create_field() 
  26. * Create the HTML interface for your field 
  27. * @param $field - an array holding all the field's data 
  28. * @type action 
  29. * @since 3.6 
  30. * @date 23/01/13 
  31. */ 
  32.  
  33. function create_field( $field ) 
  34. echo wpautop( $field['message'] ); 
  35.  
  36.  
  37. /** 
  38. * create_options() 
  39. * Create extra options for your field. This is rendered when editing a field. 
  40. * The value of $field['name'] can be used (like bellow) to save extra data to the $field 
  41. * @param $field - an array holding all the field's data 
  42. * @type action 
  43. * @since 3.6 
  44. * @date 23/01/13 
  45. */ 
  46.  
  47. function create_options( $field ) 
  48. // vars 
  49. $key = $field['name']; 
  50.  
  51. ?> 
  52. <tr class="field_option field_option_<?php echo $this->name; ?>"> 
  53. <td class="label"> 
  54. <label for=""><?php _e("Message", 'acf'); ?></label> 
  55. <p class="description"><?php _e("Text & HTML entered here will appear inline with the fields", 'acf'); ?><br /><br /> 
  56. <?php _e("Please note that all text will first be passed through the wp function ", 'acf'); ?><a href="http://codex.wordpress.org/Function_Reference/wpautop" target="_blank">wpautop</a></p> 
  57. </td> 
  58. <td> 
  59. <?php  
  60. do_action('acf/create_field', array( 
  61. 'type' => 'textarea',  
  62. 'class' => 'textarea',  
  63. 'name' => 'fields['.$key.'][message]',  
  64. 'value' => $field['message'],  
  65. )); 
  66. ?> 
  67. </td> 
  68. </tr> 
  69. <?php 
  70.  
  71.