PluginProbe
Advanced Custom Fields (ACF®) / 4.1.4
Advanced Custom Fields (ACF®) v4.1.4
6.8.9 6.8.8 6.8.7 6.8.6 6.8.5 6.8.4 6.8.3 6.8.2 6.8.1 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9 5.9.0 5.9.1 5.9.2 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9 6.0.0 All 230 releases
advanced-custom-fields / core / fields / message.php
message.php
94 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class acf_field_message extends acf_field
4 {
5
6 /*
7 * __construct
8 *
9 * Set name / label needed for actions / filters
10 *
11 * @since 3.6
12 * @date 23/01/13
13 */
14
15 function __construct()
16 {
17 // vars
18 $this->name = 'message';
19 $this->label = __("Message",'acf');
20 $this->category = __("Layout",'acf');
21
22 // do not delete!
23 parent::__construct();
24 }
25
26
27 /*
28 * create_field()
29 *
30 * Create the HTML interface for your field
31 *
32 * @param $field - an array holding all the field's data
33 *
34 * @type action
35 * @since 3.6
36 * @date 23/01/13
37 */
38
39 function create_field( $field )
40 {
41 echo wpautop( $field['message'] );
42 }
43
44
45 /*
46 * create_options()
47 *
48 * Create extra options for your field. This is rendered when editing a field.
49 * The value of $field['name'] can be used (like bellow) to save extra data to the $field
50 *
51 * @param $field - an array holding all the field's data
52 *
53 * @type action
54 * @since 3.6
55 * @date 23/01/13
56 */
57
58 function create_options( $field )
59 {
60 // vars
61 $defaults = array(
62 'message' => '',
63 );
64
65 $field = array_merge($defaults, $field);
66 $key = $field['name'];
67
68 ?>
69 <tr class="field_option field_option_<?php echo $this->name; ?>">
70 <td class="label">
71 <label for=""><?php _e("Message",'acf'); ?></label>
72 <p class="description"><?php _e("Text &amp; HTML entered here will appear inline with the fields",'acf'); ?><br /><br />
73 <?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>
74 </td>
75 <td>
76 <?php
77 do_action('acf/create_field', array(
78 'type' => 'textarea',
79 'class' => 'textarea',
80 'name' => 'fields['.$key.'][message]',
81 'value' => $field['message'],
82 ));
83 ?>
84 </td>
85 </tr>
86 <?php
87
88 }
89
90 }
91
92 new acf_field_message();
93
94 ?>