PluginProbe
Elementor Website Builder – more than just a page builder / 3.2.5
Elementor Website Builder – more than just a page builder v3.2.5
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | includes/widgets/progress.php +129 -311 4.2.33.2.5 View file →
@@ -41,9 +41,9 @@
41 41 *
42 42 * @return string Widget title.
43 43 */
44 44 public function get_title() {
45 - return esc_html__( 'Progress Bar', 'elementor' );
45 + return __( 'Progress Bar', 'elementor' );
46 46 }
47 47
48 48 /**
49 49 * Get widget icon.
@@ -72,31 +72,9 @@
72 72 public function get_keywords() {
73 73 return [ 'progress', 'bar' ];
74 74 }
75 75
76 - protected function is_dynamic_content(): bool {
77 - return false;
78 - }
79 -
80 76 /**
81 - * Get style dependencies.
82 - *
83 - * Retrieve the list of style dependencies the widget requires.
84 - *
85 - * @since 3.24.0
86 - * @access public
87 - *
88 - * @return array Widget style dependencies.
89 - */
90 - public function get_style_depends(): array {
91 - return [ 'widget-progress' ];
92 - }
93 -
94 - public function has_widget_inner_wrapper(): bool {
95 - return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
96 - }
97 -
98 - /**
99 77 * Register progress widget controls.
100 78 *
101 79 * Adds different input fields to allow the user to change and customize the widget settings.
102 80 *
@@ -106,9 +84,9 @@
106 84 protected function register_controls() {
107 85 $this->start_controls_section(
108 86 'section_progress',
109 87 [
110 - 'label' => esc_html__( 'Progress Bar', 'elementor' ),
88 + 'label' => __( 'Progress Bar', 'elementor' ),
111 89 ]
112 90 );
113 91
114 92 $this->add_control(
@@ -113,73 +91,32 @@
113 91
114 92 $this->add_control(
115 93 'title',
116 94 [
117 - 'label' => esc_html__( 'Title', 'elementor' ),
95 + 'label' => __( 'Title', 'elementor' ),
118 96 'type' => Controls_Manager::TEXT,
119 97 'dynamic' => [
120 98 'active' => true,
121 99 ],
122 - 'placeholder' => esc_html__( 'Enter your title', 'elementor' ),
123 - 'default' => esc_html__( 'My Skill', 'elementor' ),
100 + 'placeholder' => __( 'Enter your title', 'elementor' ),
101 + 'default' => __( 'My Skill', 'elementor' ),
124 102 'label_block' => true,
125 103 ]
126 104 );
127 105
128 106 $this->add_control(
129 - 'title_tag',
130 - [
131 - 'label' => esc_html__( 'Title HTML Tag', 'elementor' ),
132 - 'type' => Controls_Manager::SELECT,
133 - 'options' => [
134 - 'h1' => 'H1',
135 - 'h2' => 'H2',
136 - 'h3' => 'H3',
137 - 'h4' => 'H4',
138 - 'h5' => 'H5',
139 - 'h6' => 'H6',
140 - 'div' => 'div',
141 - 'span' => 'span',
142 - 'p' => 'p',
143 - ],
144 - 'default' => 'span',
145 - 'condition' => [
146 - 'title!' => '',
147 - ],
148 - ]
149 - );
150 -
151 - $this->add_control(
152 - 'title_display',
153 - [
154 - 'label' => esc_html__( 'Display Title', 'elementor' ),
155 - 'type' => Controls_Manager::SWITCHER,
156 - 'label_on' => esc_html__( 'Show', 'elementor' ),
157 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
158 - 'default' => 'yes',
159 - 'condition' => [
160 - 'title!' => '',
161 - ],
162 - ]
163 - );
164 -
165 - $this->add_control(
166 107 'progress_type',
167 108 [
168 - 'label' => esc_html__( 'Type', 'elementor' ),
109 + 'label' => __( 'Type', 'elementor' ),
169 110 'type' => Controls_Manager::SELECT,
111 + 'default' => '',
170 112 'options' => [
171 - '' => esc_html__( 'Default', 'elementor' ),
172 - 'info' => esc_html__( 'Info', 'elementor' ),
173 - 'success' => esc_html__( 'Success', 'elementor' ),
174 - 'warning' => esc_html__( 'Warning', 'elementor' ),
175 - 'danger' => esc_html__( 'Danger', 'elementor' ),
113 + '' => __( 'Default', 'elementor' ),
114 + 'info' => __( 'Info', 'elementor' ),
115 + 'success' => __( 'Success', 'elementor' ),
116 + 'warning' => __( 'Warning', 'elementor' ),
117 + 'danger' => __( 'Danger', 'elementor' ),
176 118 ],
177 - 'default' => '',
178 - 'condition' => [
179 - 'progress_type!' => '', // a workaround to hide the control, unless it's in use (not default).
180 - ],
181 - 'separator' => 'before',
182 119 ]
183 120 );
184 121
185 122 $this->add_control(
@@ -184,9 +121,9 @@
184 121
185 122 $this->add_control(
186 123 'percent',
187 124 [
188 - 'label' => esc_html__( 'Percentage', 'elementor' ),
125 + 'label' => __( 'Percentage', 'elementor' ),
189 126 'type' => Controls_Manager::SLIDER,
190 127 'default' => [
191 128 'size' => 50,
192 129 'unit' => '%',
@@ -193,118 +130,58 @@
193 130 ],
194 131 'dynamic' => [
195 132 'active' => true,
196 133 ],
197 - 'separator' => 'before',
198 134 ]
199 135 );
200 136
201 - $this->add_control(
202 - 'display_percentage',
203 - [
204 - 'label' => esc_html__( 'Display Percentage', 'elementor' ),
205 - 'type' => Controls_Manager::SWITCHER,
206 - 'label_on' => esc_html__( 'Show', 'elementor' ),
207 - 'label_off' => esc_html__( 'Hide', 'elementor' ),
208 - 'return_value' => 'show',
209 - 'default' => 'show',
210 - 'condition' => [
211 - 'percent!' => '',
212 - ],
213 - ]
214 - );
137 + $this->add_control( 'display_percentage', [
138 + 'label' => __( 'Display Percentage', 'elementor' ),
139 + 'type' => Controls_Manager::SELECT,
140 + 'default' => 'show',
141 + 'options' => [
142 + 'show' => __( 'Show', 'elementor' ),
143 + 'hide' => __( 'Hide', 'elementor' ),
144 + ],
145 + ] );
215 146
216 147 $this->add_control(
217 148 'inner_text',
218 149 [
219 - 'label' => esc_html__( 'Inner Text', 'elementor' ),
150 + 'label' => __( 'Inner Text', 'elementor' ),
220 151 'type' => Controls_Manager::TEXT,
221 152 'dynamic' => [
222 153 'active' => true,
223 154 ],
224 - 'placeholder' => esc_html__( 'e.g. Web Designer', 'elementor' ),
225 - 'default' => esc_html__( 'Web Designer', 'elementor' ),
155 + 'placeholder' => __( 'e.g. Web Designer', 'elementor' ),
156 + 'default' => __( 'Web Designer', 'elementor' ),
226 157 'label_block' => true,
227 - 'separator' => 'before',
228 158 ]
229 159 );
230 160
231 - $this->end_controls_section();
232 -
233 - $this->start_controls_section(
234 - 'section_progress_style',
235 - [
236 - 'label' => esc_html__( 'Progress Bar', 'elementor' ),
237 - 'tab' => Controls_Manager::TAB_STYLE,
238 - ]
239 - );
240 -
241 161 $this->add_control(
242 - 'title_heading',
162 + 'view',
243 163 [
244 - 'label' => esc_html__( 'Title', 'elementor' ),
245 - 'type' => Controls_Manager::HEADING,
246 - 'condition' => [
247 - 'title!' => '',
248 - ],
164 + 'label' => __( 'View', 'elementor' ),
165 + 'type' => Controls_Manager::HIDDEN,
166 + 'default' => 'traditional',
249 167 ]
250 168 );
251 169
252 - $this->add_control(
253 - 'title_color',
254 - [
255 - 'label' => esc_html__( 'Text Color', 'elementor' ),
256 - 'type' => Controls_Manager::COLOR,
257 - 'selectors' => [
258 - '{{WRAPPER}} .elementor-title' => 'color: {{VALUE}};',
259 - ],
260 - 'global' => [
261 - 'default' => Global_Colors::COLOR_PRIMARY,
262 - ],
263 - 'condition' => [
264 - 'title!' => '',
265 - ],
266 - ]
267 - );
170 + $this->end_controls_section();
268 171
269 - $this->add_group_control(
270 - Group_Control_Typography::get_type(),
172 + $this->start_controls_section(
173 + 'section_progress_style',
271 174 [
272 - 'name' => 'typography',
273 - 'selector' => '{{WRAPPER}} .elementor-title',
274 - 'global' => [
275 - 'default' => Global_Typography::TYPOGRAPHY_TEXT,
276 - ],
277 - 'condition' => [
278 - 'title!' => '',
279 - ],
175 + 'label' => __( 'Progress Bar', 'elementor' ),
176 + 'tab' => Controls_Manager::TAB_STYLE,
280 177 ]
281 178 );
282 179
283 - $this->add_group_control(
284 - Group_Control_Text_Shadow::get_type(),
285 - [
286 - 'name' => 'title_shadow',
287 - 'selector' => '{{WRAPPER}} .elementor-title',
288 - 'condition' => [
289 - 'title!' => '',
290 - ],
291 - ]
292 - );
293 -
294 180 $this->add_control(
295 - 'percentage_heading',
296 - [
297 - 'label' => esc_html__( 'Percentage', 'elementor' ),
298 - 'type' => Controls_Manager::HEADING,
299 - 'separator' => 'before',
300 - ]
301 - );
302 -
303 - $this->add_control(
304 181 'bar_color',
305 182 [
306 - 'label' => esc_html__( 'Color', 'elementor' ),
183 + 'label' => __( 'Color', 'elementor' ),
307 184 'type' => Controls_Manager::COLOR,
308 185 'global' => [
309 186 'default' => Global_Colors::COLOR_PRIMARY,
310 187 ],
@@ -316,9 +193,9 @@
316 193
317 194 $this->add_control(
318 195 'bar_bg_color',
319 196 [
320 - 'label' => esc_html__( 'Background Color', 'elementor' ),
197 + 'label' => __( 'Background Color', 'elementor' ),
321 198 'type' => Controls_Manager::COLOR,
322 199 'selectors' => [
323 200 '{{WRAPPER}} .elementor-progress-wrapper' => 'background-color: {{VALUE}};',
324 201 ],
@@ -327,11 +204,10 @@
327 204
328 205 $this->add_control(
329 206 'bar_height',
330 207 [
331 - 'label' => esc_html__( 'Height', 'elementor' ),
208 + 'label' => __( 'Height', 'elementor' ),
332 209 'type' => Controls_Manager::SLIDER,
333 - 'size_units' => [ 'px', 'em', 'rem', 'custom' ],
334 210 'selectors' => [
335 211 '{{WRAPPER}} .elementor-progress-bar' => 'height: {{SIZE}}{{UNIT}}; line-height: {{SIZE}}{{UNIT}};',
336 212 ],
337 213 ]
@@ -339,11 +215,11 @@
339 215
340 216 $this->add_control(
341 217 'bar_border_radius',
342 218 [
343 - 'label' => esc_html__( 'Border Radius', 'elementor' ),
219 + 'label' => __( 'Border Radius', 'elementor' ),
344 220 'type' => Controls_Manager::SLIDER,
345 - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ],
221 + 'size_units' => [ 'px', '%' ],
346 222 'selectors' => [
347 223 '{{WRAPPER}} .elementor-progress-wrapper' => 'border-radius: {{SIZE}}{{UNIT}}; overflow: hidden;',
348 224 ],
349 225 ]
@@ -351,14 +227,11 @@
351 227
352 228 $this->add_control(
353 229 'inner_text_heading',
354 230 [
355 - 'label' => esc_html__( 'Inner Text', 'elementor' ),
231 + 'label' => __( 'Inner Text', 'elementor' ),
356 232 'type' => Controls_Manager::HEADING,
357 233 'separator' => 'before',
358 - 'condition' => [
359 - 'inner_text!' => '',
360 - ],
361 234 ]
362 235 );
363 236
364 237 $this->add_control(
@@ -363,16 +236,13 @@
363 236
364 237 $this->add_control(
365 238 'bar_inline_color',
366 239 [
367 - 'label' => esc_html__( 'Color', 'elementor' ),
240 + 'label' => __( 'Color', 'elementor' ),
368 241 'type' => Controls_Manager::COLOR,
369 242 'selectors' => [
370 243 '{{WRAPPER}} .elementor-progress-bar' => 'color: {{VALUE}};',
371 244 ],
372 - 'condition' => [
373 - 'inner_text!' => '',
374 - ],
375 245 ]
376 246 );
377 247
378 248 $this->add_group_control(
@@ -382,11 +252,8 @@
382 252 'selector' => '{{WRAPPER}} .elementor-progress-bar',
383 253 'exclude' => [
384 254 'line_height',
385 255 ],
386 - 'condition' => [
387 - 'inner_text!' => '',
388 - ],
389 256 ]
390 257 );
391 258
392 259 $this->add_group_control(
@@ -393,14 +260,54 @@
393 260 Group_Control_Text_Shadow::get_type(),
394 261 [
395 262 'name' => 'bar_inner_shadow',
396 263 'selector' => '{{WRAPPER}} .elementor-progress-bar',
397 - 'condition' => [
398 - 'inner_text!' => '',
264 + ]
265 + );
266 +
267 + $this->end_controls_section();
268 +
269 + $this->start_controls_section(
270 + 'section_title',
271 + [
272 + 'label' => __( 'Title Style', 'elementor' ),
273 + 'tab' => Controls_Manager::TAB_STYLE,
274 + ]
275 + );
276 +
277 + $this->add_control(
278 + 'title_color',
279 + [
280 + 'label' => __( 'Text Color', 'elementor' ),
281 + 'type' => Controls_Manager::COLOR,
282 + 'selectors' => [
283 + '{{WRAPPER}} .elementor-title' => 'color: {{VALUE}};',
399 284 ],
285 + 'global' => [
286 + 'default' => Global_Colors::COLOR_PRIMARY,
287 + ],
400 288 ]
401 289 );
402 290
291 + $this->add_group_control(
292 + Group_Control_Typography::get_type(),
293 + [
294 + 'name' => 'typography',
295 + 'selector' => '{{WRAPPER}} .elementor-title',
296 + 'global' => [
297 + 'default' => Global_Typography::TYPOGRAPHY_TEXT,
298 + ],
299 + ]
300 + );
301 +
302 + $this->add_group_control(
303 + Group_Control_Text_Shadow::get_type(),
304 + [
305 + 'name' => 'title_shadow',
306 + 'selector' => '{{WRAPPER}} .elementor-title',
307 + ]
308 + );
309 +
403 310 $this->end_controls_section();
404 311 }
405 312
406 313 /**
@@ -414,84 +321,52 @@
414 321 */
415 322 protected function render() {
416 323 $settings = $this->get_settings_for_display();
417 324
418 - if ( empty( $settings['title'] ) && empty( $settings['percent']['size'] ) ) {
419 - return;
420 - }
421 -
422 - $progressbar_id = 'elementor-progress-bar-' . $this->get_id();
423 -
424 325 $progress_percentage = is_numeric( $settings['percent']['size'] ) ? $settings['percent']['size'] : '0';
425 326 if ( 100 < $progress_percentage ) {
426 327 $progress_percentage = 100;
427 328 }
428 329
429 - if ( ! Utils::is_empty( $settings['title'] ) ) {
330 + $this->add_render_attribute( 'title', [
331 + 'class' => 'elementor-title',
332 + ]);
430 333
431 - if ( 'yes' === $settings['title_display'] ) {
334 + $this->add_inline_editing_attributes( 'title' );
432 335
433 - $this->add_render_attribute(
434 - 'title',
435 - [
436 - 'class' => 'elementor-title',
437 - 'id' => $progressbar_id,
438 - ]
439 - );
336 + $this->add_render_attribute( 'wrapper', [
337 + 'class' => 'elementor-progress-wrapper',
338 + 'role' => 'progressbar',
339 + 'aria-valuemin' => '0',
340 + 'aria-valuemax' => '100',
341 + 'aria-valuenow' => $progress_percentage,
342 + 'aria-valuetext' => $settings['inner_text'],
343 + ] );
440 344
441 - $this->add_inline_editing_attributes( 'title' );
442 -
443 - $this->add_render_attribute( 'wrapper', 'aria-labelledby', $progressbar_id );
444 -
445 - } else {
446 -
447 - $this->add_render_attribute( 'wrapper', 'aria-label', $settings['title'] );
448 -
449 - }
450 - }
451 -
452 - $this->add_render_attribute(
453 - 'wrapper',
454 - [
455 - 'class' => 'elementor-progress-wrapper',
456 - 'role' => 'progressbar',
457 - 'aria-valuemin' => '0',
458 - 'aria-valuemax' => '100',
459 - 'aria-valuenow' => $progress_percentage,
460 - ]
461 - );
462 -
463 - if ( ! empty( $settings['inner_text'] ) ) {
464 - $this->add_render_attribute( 'wrapper', 'aria-valuetext', "{$progress_percentage}% ({$settings['inner_text']})" );
465 - }
466 -
467 345 if ( ! empty( $settings['progress_type'] ) ) {
468 346 $this->add_render_attribute( 'wrapper', 'class', 'progress-' . $settings['progress_type'] );
469 347 }
470 348
471 - $this->add_render_attribute(
472 - 'progress-bar',
473 - [
474 - 'class' => 'elementor-progress-bar',
475 - 'data-max' => $progress_percentage,
476 - ]
477 - );
349 + $this->add_render_attribute( 'progress-bar', [
350 + 'class' => 'elementor-progress-bar',
351 + 'data-max' => $progress_percentage,
352 + ] );
478 353
479 - $this->add_render_attribute( 'inner_text', 'class', 'elementor-progress-text' );
354 + $this->add_render_attribute( 'inner_text', [
355 + 'class' => 'elementor-progress-text',
356 + ] );
480 357
481 358 $this->add_inline_editing_attributes( 'inner_text' );
482 359
483 - if ( ! Utils::is_empty( $settings['title'] ) && 'yes' === $settings['title_display'] ) { ?>
484 - <<?php Utils::print_validated_html_tag( $settings['title_tag'] ); ?> <?php $this->print_render_attribute_string( 'title' ); ?>>
485 - <?php echo wp_kses_post( $settings['title'] ); ?>
486 - </<?php Utils::print_validated_html_tag( $settings['title_tag'] ); ?>>
360 + if ( ! Utils::is_empty( $settings['title'] ) ) { ?>
361 + <span <?php echo $this->get_render_attribute_string( 'title' ); ?>><?php echo $settings['title']; ?></span>
487 362 <?php } ?>
488 363
489 - <div <?php $this->print_render_attribute_string( 'wrapper' ); ?>>
490 - <div <?php $this->print_render_attribute_string( 'progress-bar' ); ?>>
491 - <span <?php $this->print_render_attribute_string( 'inner_text' ); ?>><?php echo wp_kses_post( $settings['inner_text'] ); ?></span>
492 - <?php if ( 'show' === $settings['display_percentage'] ) { ?>
493 - <span class="elementor-progress-percentage"><?php echo $progress_percentage; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>%</span>
364 + <div <?php echo $this->get_render_attribute_string( 'wrapper' ); ?>>
365 + <div <?php echo $this->get_render_attribute_string( 'progress-bar' ); ?>>
366 + <span <?php echo $this->get_render_attribute_string( 'inner_text' ); ?>><?php echo $settings['inner_text']; ?></span>
367 + <?php if ( 'hide' !== $settings['display_percentage'] ) { ?>
368 + <span class="elementor-progress-percentage"><?php echo $progress_percentage; ?>%</span>
494 369 <?php } ?>
495 370 </div>
496 371 </div>
497 372 <?php
@@ -507,101 +382,44 @@
507 382 */
508 383 protected function content_template() {
509 384 ?>
510 385 <#
511 - if ( '' === settings.title && '' === settings.percent.size ) {
512 - return;
513 - }
514 -
515 - const title_tag = elementor.helpers.validateHTMLTag( settings.title_tag );
516 - const progressbar_id = 'elementor-progress-bar-<?php echo esc_attr( $this->get_id() ); ?>';
517 -
518 386 let progress_percentage = 0;
519 387 if ( ! isNaN( settings.percent.size ) ) {
520 388 progress_percentage = 100 < settings.percent.size ? 100 : settings.percent.size;
521 389 }
522 390
523 - if ( settings.title ) {
391 + view.addRenderAttribute( 'title', {
392 + 'class': 'elementor-title'
393 + } );
524 394
525 - if ( 'yes' === settings.title_display ) {
395 + view.addInlineEditingAttributes( 'title' );
526 396
527 - view.addRenderAttribute(
528 - 'title',
529 - {
530 - 'class': 'elementor-title',
531 - 'id': progressbar_id,
532 - }
533 - );
397 + view.addRenderAttribute( 'progressWrapper', {
398 + 'class': [ 'elementor-progress-wrapper', 'progress-' + settings.progress_type ],
399 + 'role': 'progressbar',
400 + 'aria-valuemin': '0',
401 + 'aria-valuemax': '100',
402 + 'aria-valuenow': progress_percentage,
403 + 'aria-valuetext': settings.inner_text
404 + } );
534 405
535 - view.addInlineEditingAttributes( 'title' );
406 + view.addRenderAttribute( 'inner_text', {
407 + 'class': 'elementor-progress-text'
408 + } );
536 409
537 - view.addRenderAttribute( 'progressWrapper', 'aria-labelledby', progressbar_id );
538 -
539 - } else {
540 -
541 - view.addRenderAttribute( 'progressWrapper', 'aria-label', settings.title );
542 -
543 - }
544 - }
545 -
546 - view.addRenderAttribute(
547 - 'progressWrapper',
548 - {
549 - 'class': [ 'elementor-progress-wrapper', 'progress-' + settings.progress_type ],
550 - 'role': 'progressbar',
551 - 'aria-valuemin': '0',
552 - 'aria-valuemax': '100',
553 - 'aria-valuenow': progress_percentage,
554 - }
555 - );
556 -
557 - if ( '' !== settings.inner_text ) {
558 - view.addRenderAttribute( 'progressWrapper', 'aria-valuetext', progress_percentage + '% (' + settings.inner_text + ')' );
559 - }
560 -
561 - view.addRenderAttribute( 'inner_text', 'class', 'elementor-progress-text' );
562 -
563 410 view.addInlineEditingAttributes( 'inner_text' );
564 411 #>
565 - <# if ( settings.title && 'yes' === settings.title_display ) { #>
566 - <{{ title_tag }} {{{ view.getRenderAttributeString( 'title' ) }}}>{{ settings.title }}</{{ title_tag }}>
567 - <# } #>
412 + <# if ( settings.title ) { #>
413 + <span {{{ view.getRenderAttributeString( 'title' ) }}}>{{{ settings.title }}}</span><#
414 + } #>
568 415 <div {{{ view.getRenderAttributeString( 'progressWrapper' ) }}}>
569 416 <div class="elementor-progress-bar" data-max="{{ progress_percentage }}">
570 - <span {{{ view.getRenderAttributeString( 'inner_text' ) }}}>{{ settings.inner_text }}</span>
571 - <# if ( 'show' === settings.display_percentage ) { #>
417 + <span {{{ view.getRenderAttributeString( 'inner_text' ) }}}>{{{ settings.inner_text }}}</span>
418 + <# if ( 'hide' !== settings.display_percentage ) { #>
572 419 <span class="elementor-progress-percentage">{{{ progress_percentage }}}%</span>
573 420 <# } #>
574 421 </div>
575 422 </div>
576 423 <?php
577 - }
578 -
579 - public function render_markdown(): string {
580 - $settings = $this->get_settings_for_display();
581 - $title = Utils::html_to_plain_text( $settings['title'] ?? '' );
582 - $inner_text = Utils::html_to_plain_text( $settings['inner_text'] ?? '' );
583 - $percent = $settings['percent']['size'] ?? ( $settings['percent'] ?? '' );
584 -
585 - $parts = [];
586 -
587 - if ( ! empty( $title ) ) {
588 - $parts[] = $title;
589 - }
590 -
591 - if ( ! empty( $inner_text ) ) {
592 - $parts[] = $inner_text;
593 - }
594 -
595 - if ( empty( $parts ) && empty( $percent ) ) {
596 - return '';
597 - }
598 -
599 - $label = implode( ' - ', $parts );
600 -
601 - if ( ! empty( $percent ) ) {
602 - return ! empty( $label ) ? $label . ': ' . $percent . '%' : $percent . '%';
603 - }
604 -
605 - return $label;
606 424 }
607 425 }