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 77 * @package WPStarter
88 */
99
10- $ cbx_id = uniqid ();
11-
10+ $ cbx_id = uniqid ();
11+ $ button_text = get_field ( ' button_text ' );
1212?>
1313<?php if ( is_admin () ) : ?>
1414 <input type="checkbox" id="<?php echo esc_attr ( $ cbx_id ); ?> " class="acfbt-dialog-checkbox">
@@ -68,6 +68,6 @@ class="btn-default"
6868 @click="$refs.dialogRef.showModal(), openDialog = true"
6969 <?php endif ; ?>
7070>
71- <?php esc_html_e ( 'Open ' , 'wp-site-starter ' ); ?>
71+ <?php esc_html_e ( $ button_text ? $ button_text : 'Open ' , 'wp-site-starter ' ); ?>
7272</button>
7373</div>
Original file line number Diff line number Diff line change 33#}
44
55{% set cbx_id = ' dialog-' ~ random () %}
6+ {% set button_text = block .data ['button_text' ] %}
67
78{% if function(' is_admin' ) == true %}
89 <input type =" checkbox" id =" {{ cbx_id }}" class =" acfbt-dialog-checkbox" >
6263 @click =" $refs.dialogRef.showModal(), openDialog = true"
6364 {% endif %}
6465 >
65- Open
66+ {{ button_text ? button_text : ' Open' }}
6667 </button >
6768</div >
You can’t perform that action at this time.
0 commit comments