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.2.1 4.2.2 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.4.10 4.4.11 4.4.12 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 5.10 5.10.1 5.10.2 5.11 5.11.1 5.11.2 5.11.3 5.11.4 5.12 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.6.10 5.6.2 5.6.3 5.6.4 5.6.5 5.6.6 5.6.7 5.6.8 5.6.9 5.7.0 5.7.1 5.7.10 5.7.12 5.7.13 5.7.2 5.7.3 5.7.4 5.7.5 5.7.6 5.7.7 5.7.8 5.7.9 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.2 5.8.3 5.8.4
advanced-custom-fields / includes / fields / class-acf-field-message.php
advanced-custom-fields / includes / fields Last commit date
class-acf-field-accordion.php 5 months ago class-acf-field-button-group.php 5 months ago class-acf-field-checkbox.php 2 months ago class-acf-field-color_picker.php 5 months ago class-acf-field-date_picker.php 5 months ago class-acf-field-date_time_picker.php 5 months ago class-acf-field-email.php 5 months ago class-acf-field-file.php 5 months ago class-acf-field-google-map.php 5 months ago class-acf-field-group.php 5 months ago class-acf-field-icon_picker.php 5 months ago class-acf-field-image.php 4 weeks ago class-acf-field-link.php 5 months ago class-acf-field-message.php 5 months ago class-acf-field-number.php 5 months ago class-acf-field-oembed.php 2 months ago class-acf-field-output.php 5 months ago class-acf-field-page_link.php 4 weeks ago class-acf-field-password.php 5 months ago class-acf-field-post_object.php 4 weeks ago class-acf-field-radio.php 2 months ago class-acf-field-range.php 5 months ago class-acf-field-relationship.php 4 weeks ago class-acf-field-select.php 2 months ago class-acf-field-separator.php 5 months ago class-acf-field-tab.php 5 months ago class-acf-field-taxonomy.php 2 months ago class-acf-field-text.php 5 months ago class-acf-field-textarea.php 5 months ago class-acf-field-time_picker.php 5 months ago class-acf-field-true_false.php 5 months ago class-acf-field-url.php 5 months ago class-acf-field-user.php 2 months ago class-acf-field-wysiwyg.php 5 months ago class-acf-field.php 5 months ago index.php 2 years ago
class-acf-field-message.php
184 lines
1 <?php
2 /**
3 * @package ACF
4 * @author WP Engine
5 *
6 * © 2026 Advanced Custom Fields (ACF®). All rights reserved.
7 * "ACF" is a trademark of WP Engine.
8 * Licensed under the GNU General Public License v2 or later.
9 * https://www.gnu.org/licenses/gpl-2.0.html
10 */
11
12 if ( ! class_exists( 'acf_field_message' ) ) :
13
14 class acf_field_message extends acf_field {
15
16 public $show_in_rest = false;
17
18 /**
19 * This function will setup the field type data
20 *
21 * @type function
22 * @date 5/03/2014
23 * @since 5.0.0
24 *
25 * @param n/a
26 * @return n/a
27 */
28 function initialize() {
29
30 // vars
31 $this->name = 'message';
32 $this->label = __( 'Message', 'acf' );
33 $this->category = 'layout';
34 $this->description = __( 'Used to display a message to editors alongside other fields. Useful for providing additional context or instructions around your fields.', 'acf' );
35 $this->preview_image = acf_get_url() . '/assets/images/field-type-previews/field-preview-message.png';
36 $this->supports = array(
37 'required' => false,
38 'bindings' => false,
39 );
40 $this->defaults = array(
41 'message' => '',
42 'esc_html' => 0,
43 'new_lines' => 'wpautop',
44 );
45 }
46
47
48 /**
49 * Create the HTML interface for your 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 function render_field( $field ) {
58
59 // vars
60 $m = $field['message'];
61
62 // wptexturize (improves "quotes")
63 $m = wptexturize( $m );
64
65 // esc_html
66 if ( $field['esc_html'] ) {
67 $m = esc_html( $m );
68 }
69
70 // new lines
71 if ( $field['new_lines'] == 'wpautop' ) {
72 $m = wpautop( $m );
73 } elseif ( $field['new_lines'] == 'br' ) {
74 $m = nl2br( $m );
75 }
76
77 // return
78 echo acf_esc_html( $m );
79 }
80
81
82 /**
83 * Create extra options for your field. This is rendered when editing a field.
84 * The value of $field['name'] can be used (like bellow) to save extra data to the $field
85 *
86 * @param $field - an array holding all the field's data
87 *
88 * @type action
89 * @since 3.6
90 * @date 23/01/13
91 */
92 function render_field_settings( $field ) {
93 acf_render_field_setting(
94 $field,
95 array(
96 'label' => __( 'Message', 'acf' ),
97 'instructions' => '',
98 'type' => 'textarea',
99 'name' => 'message',
100 )
101 );
102
103 acf_render_field_setting(
104 $field,
105 array(
106 'label' => __( 'New Lines', 'acf' ),
107 'instructions' => __( 'Controls how new lines are rendered', 'acf' ),
108 'type' => 'select',
109 'name' => 'new_lines',
110 'choices' => array(
111 'wpautop' => __( 'Automatically add paragraphs', 'acf' ),
112 'br' => __( 'Automatically add &lt;br&gt;', 'acf' ),
113 '' => __( 'No Formatting', 'acf' ),
114 ),
115 )
116 );
117
118 acf_render_field_setting(
119 $field,
120 array(
121 'label' => __( 'Escape HTML', 'acf' ),
122 'instructions' => __( 'Allow HTML markup to display as visible text instead of rendering', 'acf' ),
123 'name' => 'esc_html',
124 'type' => 'true_false',
125 'ui' => 1,
126 )
127 );
128 }
129
130 /**
131 * This function will translate field settings
132 *
133 * @type function
134 * @date 8/03/2016
135 * @since 5.3.2
136 *
137 * @param $field (array)
138 * @return $field
139 */
140 function translate_field( $field ) {
141
142 // translate
143 $field['message'] = acf_translate( $field['message'] );
144
145 // return
146 return $field;
147 }
148
149
150 /**
151 * This filter is appied to the $field after it is loaded from the database
152 *
153 * @type filter
154 * @since 3.6
155 * @date 23/01/13
156 *
157 * @param $field - the field array holding all the field options
158 *
159 * @return $field - the field array holding all the field options
160 */
161 function load_field( $field ) {
162
163 // remove name to avoid caching issue
164 $field['name'] = '';
165
166 // remove instructions
167 $field['instructions'] = '';
168
169 // remove required to avoid JS issues
170 $field['required'] = 0;
171
172 // set value other than 'null' to avoid ACF loading / caching issue
173 $field['value'] = false;
174
175 // return
176 return $field;
177 }
178 }
179
180
181 // initialize
182 acf_register_field_type( 'acf_field_message' );
183 endif; // class_exists check
184