@@ -245,6 +245,7 @@ protected function register_controls() {
245245 [
246246 'label ' => __ ( 'Hours ' , 'mighty ' ),
247247 'type ' => Controls_Manager::NUMBER ,
248+ 'default ' => '2 ' ,
248249 'dynamic ' => [ 'active ' => true ],
249250 'condition ' => [
250251 'how_to_total_time ' => 'yes '
@@ -258,6 +259,7 @@ protected function register_controls() {
258259 'label ' => __ ( 'Minutes ' , 'mighty ' ),
259260 'type ' => Controls_Manager::NUMBER ,
260261 'dynamic ' => [ 'active ' => true ],
262+ 'default ' => '30 ' ,
261263 'condition ' => [
262264 'how_to_total_time ' => 'yes '
263265 ],
@@ -291,6 +293,7 @@ protected function register_controls() {
291293 'label ' => __ ( 'Estimated Cost ' , 'mighty ' ),
292294 'type ' => Controls_Manager::NUMBER ,
293295 'dynamic ' => [ 'active ' => true ],
296+ 'default ' => '200 ' ,
294297 'condition ' => [
295298 'how_to_estimated_time ' => 'yes '
296299 ],
@@ -2304,6 +2307,10 @@ protected function register_controls() {
23042307 'max ' => 1000
23052308 ]
23062309 ],
2310+ 'default ' => [
2311+ 'unit ' => '% ' ,
2312+ 'size ' => 30 ,
2313+ ],
23072314 'selectors ' => [
23082315 '{{WRAPPER}} .mt-how-to-step-image ' => 'width: {{SIZE}}{{UNIT}} ' ,
23092316 ],
@@ -2484,19 +2491,24 @@ protected function render()
24842491 $ total_time = $ settings ['how_to_total_time_text ' ];
24852492
24862493 if ( !empty ( $ settings ['duration_year ' ] ) ) {
2487- $ total_time = $ total_time . ' ' . $ settings ['duration_year ' ] . ' years, ' ;
2494+ $ year = ( $ settings ['duration_year ' ] > 1 ) ? ' years, ' : ' year, ' ;
2495+ $ total_time = $ total_time . ' ' . $ settings ['duration_year ' ] . $ year ;
24882496 }
24892497 if ( !empty ( $ settings ['duration_month ' ] ) ) {
2490- $ total_time = $ total_time . ' ' . $ settings ['duration_month ' ] . ' months, ' ;
2498+ $ month = ( $ settings ['duration_month ' ] > 1 ) ? ' months, ' : ' month, ' ;
2499+ $ total_time = $ total_time . ' ' . $ settings ['duration_month ' ] . $ month ;
24912500 }
24922501 if ( !empty ( $ settings ['duration_days ' ] ) ) {
2493- $ total_time = $ total_time . ' ' . $ settings ['duration_days ' ] . ' days, ' ;
2502+ $ days = ( $ settings ['duration_days ' ] > 1 ) ? ' days, ' : ' day, ' ;
2503+ $ total_time = $ total_time . ' ' . $ settings ['duration_days ' ] . $ days ;
24942504 }
24952505 if ( !empty ( $ settings ['duration_hours ' ] ) ) {
2496- $ total_time = $ total_time . ' ' . $ settings ['duration_hours ' ] . ' hours, ' ;
2506+ $ hours = ( $ settings ['duration_hours ' ] > 1 ) ? ' hours, ' : ' hour, ' ;
2507+ $ total_time = $ total_time . ' ' . $ settings ['duration_hours ' ] . $ hours ;
24972508 }
24982509 if ( !empty ( $ settings ['duration_minutes ' ] ) ) {
2499- $ total_time = $ total_time . ' ' . $ settings ['duration_minutes ' ] . ' minutes ' ;
2510+ $ minutes = ( $ settings ['duration_minutes ' ] > 1 ) ? ' minutes, ' : ' minute, ' ;
2511+ $ total_time = $ total_time . ' ' . $ settings ['duration_minutes ' ] . $ minutes ;
25002512 }
25012513 }
25022514
@@ -2606,7 +2618,7 @@ protected function render()
26062618
26072619 <?php if ( !empty ( $ value ['step_title ' ] ) ) { ?>
26082620 <?php if ( !empty ($ value ['step_image_link ' ]['url ' ] ) ) { ?>
2609- <a href="<?php echo $ value ['step_image_link ' ]['url ' ];?> " >
2621+ <a target="_blank" href="<?php echo $ value ['step_image_link ' ]['url ' ];?> " >
26102622 <?php } ?>
26112623 <<?php echo $ settings ['step_html_tag ' ];?> <?php echo $ this ->get_render_attribute_string ('mt-how-to-step-title ' ); ?> ><?php echo $ value ['step_title ' ];?> </<?php echo $ settings ['step_html_tag ' ];?> >
26122624 <?php if ( !empty ($ value ['step_image_link ' ]['url ' ] ) ) { ?>
0 commit comments