File tree Expand file tree Collapse file tree 3 files changed +15
-2
lines changed
includes/blocks/mailchimp Expand file tree Collapse file tree 3 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 41
41
"show_required_indicator" : {
42
42
"type" : " boolean" ,
43
43
"default" : true
44
+ },
45
+ "required_indicator_text" : {
46
+ "type" : " string" ,
47
+ "default" : " * = required field"
44
48
}
45
49
},
46
50
"supports" : {
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export const BlockEdit = (props) => {
56
56
unsubscribe_link_text,
57
57
interest_groups_visibility,
58
58
show_required_indicator = true ,
59
+ required_indicator_text,
59
60
} = attributes ;
60
61
61
62
const [ listData , setListData ] = useState ( { } ) ;
@@ -287,7 +288,14 @@ export const BlockEdit = (props) => {
287
288
</ Disabled >
288
289
{ show_required_indicator && (
289
290
< div id = "mc-indicates-required" >
290
- { __ ( '* = required field' , 'mailchimp' ) }
291
+ < RichText
292
+ tagName = "span"
293
+ value = { required_indicator_text }
294
+ placeholder = { __ ( '* = required field' , 'mailchimp' ) }
295
+ onChange = { ( required_indicator_text ) =>
296
+ setAttributes ( { required_indicator_text } )
297
+ }
298
+ />
291
299
</ div >
292
300
) }
293
301
< div className = "mc_signup_submit" >
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ function ( $single_list ) {
50
50
$ update_existing_subscribers = ( $ attributes ['update_existing_subscribers ' ] ?? get_option ( 'mc_update_existing ' ) === 'on ' ) ? 'yes ' : 'no ' ;
51
51
$ double_opt_in = ( $ attributes ['double_opt_in ' ] ?? get_option ( 'mc_double_optin ' ) === 'on ' ) ? 'yes ' : 'no ' ;
52
52
$ show_required_indicator = $ attributes ['show_required_indicator ' ] ?? true ;
53
+ $ required_indicator_text = $ attributes ['required_indicator_text ' ] ?? __ ( '* = required field ' , 'mailchimp ' );
53
54
$ hash = wp_hash (
54
55
serialize ( // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.serialize_serialize
55
56
array (
@@ -251,7 +252,7 @@ function ( $single_list ) {
251
252
if ( $ show_required_indicator ) {
252
253
?>
253
254
<div id="mc-indicates-required">
254
- <?php esc_html_e ( ' * = required field ' , ' mailchimp ' ); ?>
255
+ <?php echo esc_html ( $ required_indicator_text ); ?>
255
256
</div><!-- /mc-indicates-required -->
256
257
<?php
257
258
}
You can’t perform that action at this time.
0 commit comments