Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/wp-rocket/views/settings/fields/radio-buttons.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 + /**
3 + * Select field template.
4 + *
5 + * @since 3.10
6 + *
7 + * @param array $data {
8 + * Radio buttons arguments.
9 + *
10 + * @type string $id Field identifier.
11 + * @type string $label Field label.
12 + * @type string $container_class Field container class.
13 + * @type string $value Field value.
14 + * @type string $description Field description.
15 + * @type array $options {
16 + * Option options.
17 + *
18 + * @type string $description Option value.
19 + * @type string $label Option label.
20 + * @type array $sub_fields fields to show when option is selected.
21 + * }
22 + * }
23 + */
24 +
25 + defined( 'ABSPATH' ) || exit;
26 +
27 + ?>
28 + <div id = '<?php echo esc_attr( $data['id'] ); ?>' class="wpr-field wpr-radio-buttons <?php echo esc_attr( $data['container_class'] ); ?>" data-default="<?php echo ( ! empty( $data['default'] ) ? 'wpr-radio-' . esc_attr( $data['default'] ) : '' ); ?>" <?php echo $data['parent']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $data['parent'] escaped with esc_attr. ?>>
29 + <div class="wpr-radio-buttons-container">
30 + <?php foreach ( $data['options'] as $value => $option ) : // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound ?>
31 + <button id ="wpr-radio-<?php echo esc_attr( $value ); ?>" class="wpr-button wpr-button--gray <?php echo ( $value === $data['value'] ? 'radio-active' : '' ); ?> <?php echo ( ! empty( $option['warning'] ) ? 'has-warning' : '' ); ?>"
32 + data-value="<?php echo esc_attr( $value ); ?>"
33 + <?php echo ( ! empty( $option['disabled'] ) ? 'disabled=' . esc_attr( $option['disabled'] ) : '' ); ?>
34 + >
35 + <?php echo esc_html( $option['label'] ); ?>
36 + </button>
37 + <?php endforeach; ?>
38 + </div>
39 + <?php foreach ( $data['options'] as $value => $option ) : // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound ?>
40 + <?php if ( ! empty( $option['warning'] ) ) : ?>
41 + <div class="wpr-fieldWarning wpr-radio-warning" data-parent="wpr-radio-<?php echo esc_attr( $value ); ?>">
42 + <div class="wpr-fieldWarning-title wpr-icon-important">
43 + <?php echo esc_html( $option['warning']['title'] ); ?>
44 + </div>
45 + <?php if ( isset( $option['warning']['description'] ) ) : ?>
46 + <div class="wpr-fieldWarning-description">
47 + <?php echo $option['warning']['description']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Dynamic content is properly escaped in the view. ?>
48 + </div>
49 + <?php endif; ?>
50 + <button class="wpr-button wpr-button--small wpr-button--icon wpr-icon-check"><?php echo esc_html( $option['warning']['button_label'] ); ?></button>
51 + </div>
52 + <?php endif; ?>
53 +
54 + <div class="wpr-extra-fields-container wpr-field--children no-space <?php echo ( $value === $data['value'] ? 'wpr-isOpen' : '' ); ?>" data-parent="wpr-radio-<?php echo esc_attr( $value ); ?>">
55 +
56 + <div class="wpr-field-description">
57 + <?php if ( ! empty( $option['description'] ) ) : ?>
58 + <div class="wpr-field-description ">
59 + <?php echo $option['description']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Dynamic content is properly escaped in the view. ?>
60 + </div>
61 + <?php endif; ?>
62 + </div>
63 +
64 + <?php
65 + do_action(
66 + 'rocket_after_settings_radio_options',
67 + [
68 + 'option_id' => $value,
69 + 'sub_fields' => $option['sub_fields'],
70 + ]
71 + );
72 + ?>
73 +
74 + </div>
75 + <?php endforeach; ?>
76 + </div>
77 +
78 +