| Server IP : 3.93.235.159 / Your IP : 216.73.216.140 Web Server : Apache System : Linux ip-172-26-0-169 5.10.0-46-cloud-amd64 #1 SMP Debian 5.10.262-1 (2026-07-31) x86_64 User : bitnami ( 1000) PHP Version : 8.2.9 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /bitnami/wordpress/wp-content/plugins/hello-plus/modules/forms/fields/ |
Upload File : |
<?php
namespace HelloPlus\Modules\Forms\Fields;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
}
class Acceptance extends Field_Base {
public function get_type() {
return 'ehp-acceptance';
}
public function get_name() {
return esc_html__( 'Acceptance', 'hello-plus' );
}
public function render( $item, $item_index, $form ) {
$label = '';
$form->add_render_attribute( 'input' . $item_index, 'class', 'elementor-acceptance-field' );
$form->add_render_attribute( 'input' . $item_index, 'type', 'checkbox', true );
if ( ! empty( $item['acceptance_text'] ) ) {
$label = '<label for="' . $form->get_attribute_id( $item ) . '">' . $item['acceptance_text'] . '</label>';
}
if ( ! empty( $item['checked_by_default'] ) ) {
$form->add_render_attribute( 'input' . $item_index, 'checked', 'checked' );
}
?>
<div class="elementor-field-subgroup">
<span class="elementor-field-option">
<input <?php $form->print_render_attribute_string( 'input' . $item_index ); ?>>
<?php
echo wp_kses( $label, [
'label' => [
'for' => true,
'class' => true,
'id' => true,
'style' => true,
],
] ); ?>
</span>
</div>
<?php
}
}