File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,30 @@ public function render() {
2424 $ settings = wp_parse_args ( $ settings , $ default_settings );
2525
2626 echo $ this ->field_before ();
27- echo '<input type="text" name=" ' . $ this ->field_name () .'" value=" ' . $ this ->value .'" data-settings=" ' . esc_attr ( json_encode ( $ settings ) ) .'" ' . $ this ->field_attributes () .'/> ' ;
27+
28+ if ( ! empty ( $ this ->field ['from_to ' ] ) ) {
29+
30+ $ args = wp_parse_args ( $ this ->field , array (
31+ 'text_from ' => 'From ' ,
32+ 'text_to ' => 'To ' ,
33+ ) );
34+
35+ $ value = wp_parse_args ( $ this ->value , array (
36+ 'from ' => '' ,
37+ 'to ' => '' ,
38+ ) );
39+
40+ echo '<label class="csf--from"> ' . $ args ['text_from ' ] .' <input type="text" name=" ' . $ this ->field_name ('[from] ' ) .'" value=" ' . $ value ['from ' ] .'" ' . $ this ->field_attributes () .'/></label> ' ;
41+ echo '<label class="csf--to"> ' . $ args ['text_to ' ] .' <input type="text" name=" ' . $ this ->field_name ('[to] ' ) .'" value=" ' . $ value ['to ' ] .'" ' . $ this ->field_attributes () .'/></label> ' ;
42+
43+ } else {
44+
45+ echo '<input type="text" name=" ' . $ this ->field_name () .'" value=" ' . $ this ->value .'" ' . $ this ->field_attributes () .'/> ' ;
46+
47+ }
48+
49+ echo '<div class="csf-date-settings" data-settings=" ' . esc_attr ( json_encode ( $ settings ) ) .'"></div> ' ;
50+
2851 echo $ this ->field_after ();
2952
3053 }
You can’t perform that action at this time.
0 commit comments