File tree Expand file tree Collapse file tree 3 files changed +59
-4
lines changed
wp-content/themes/wp-starter/blocks/dialog Expand file tree Collapse file tree 3 files changed +59
-4
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "key" : " group_672e7d812d248" ,
3
+ "title" : " Dialog Block" ,
4
+ "fields" : [
5
+ {
6
+ "key" : " field_672e7d81d71ee" ,
7
+ "label" : " Button Text" ,
8
+ "name" : " button_text" ,
9
+ "aria-label" : " " ,
10
+ "type" : " text" ,
11
+ "instructions" : " " ,
12
+ "required" : 0 ,
13
+ "conditional_logic" : 0 ,
14
+ "wrapper" : {
15
+ "width" : " " ,
16
+ "class" : " " ,
17
+ "id" : " "
18
+ },
19
+ "default_value" : " Open" ,
20
+ "maxlength" : " " ,
21
+ "allow_in_bindings" : 0 ,
22
+ "placeholder" : " " ,
23
+ "prepend" : " " ,
24
+ "append" : " " ,
25
+ "show_in_graphql" : 1 ,
26
+ "graphql_description" : " " ,
27
+ "graphql_field_name" : " buttonText" ,
28
+ "graphql_non_null" : 0
29
+ }
30
+ ],
31
+ "location" : [
32
+ [
33
+ {
34
+ "param" : " block" ,
35
+ "operator" : " ==" ,
36
+ "value" : " acf\/ dialog"
37
+ }
38
+ ]
39
+ ],
40
+ "menu_order" : 0 ,
41
+ "position" : " normal" ,
42
+ "style" : " default" ,
43
+ "label_placement" : " top" ,
44
+ "instruction_placement" : " label" ,
45
+ "hide_on_screen" : " " ,
46
+ "active" : true ,
47
+ "description" : " " ,
48
+ "show_in_rest" : 0 ,
49
+ "show_in_graphql" : 1 ,
50
+ "graphql_field_name" : " dialogBlock" ,
51
+ "map_graphql_types_from_location_rules" : 0 ,
52
+ "graphql_types" : " " ,
53
+ "modified" : 1731100092
54
+ }
Original file line number Diff line number Diff line change 7
7
* @package WPStarter
8
8
*/
9
9
10
- $ cbx_id = uniqid ();
11
-
10
+ $ cbx_id = uniqid ();
11
+ $ button_text = get_field ( ' button_text ' );
12
12
?>
13
13
<?php if ( is_admin () ) : ?>
14
14
<input type="checkbox" id="<?php echo esc_attr ( $ cbx_id ); ?> " class="acfbt-dialog-checkbox">
@@ -68,6 +68,6 @@ class="btn-default"
68
68
@click="$refs.dialogRef.showModal(), openDialog = true"
69
69
<?php endif ; ?>
70
70
>
71
- <?php esc_html_e ( 'Open ' , 'wp-site-starter ' ); ?>
71
+ <?php esc_html_e ( $ button_text ? $ button_text : 'Open ' , 'wp-site-starter ' ); ?>
72
72
</button>
73
73
</div>
Original file line number Diff line number Diff line change 3
3
#}
4
4
5
5
{% set cbx_id = ' dialog-' ~ random () %}
6
+ {% set button_text = block .data ['button_text' ] %}
6
7
7
8
{% if function(' is_admin' ) == true %}
8
9
<input type =" checkbox" id =" {{ cbx_id }}" class =" acfbt-dialog-checkbox" >
62
63
@click =" $refs.dialogRef.showModal(), openDialog = true"
63
64
{% endif %}
64
65
>
65
- Open
66
+ {{ button_text ? button_text : ' Open' }}
66
67
</button >
67
68
</div >
You can’t perform that action at this time.
0 commit comments