';
echo $row_label_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo $this->get_repeater_tools( $field ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
echo '
';
foreach ( $field['fields'] as $sub_field ) {
$default = isset( $sub_field['default'] ) ? $sub_field['default'] : '';
$item_meta = isset( $item[ $sub_field['id'] ] ) ? $item[ $sub_field['id'] ] : $default;
$sub_field['real_id'] = $sub_field['id'];
$sub_field['id'] = $id . '[' . $counter . '][' . $sub_field['id'] . ']';
echo $this->get_metabox_field_html( $sub_field, $item_meta ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
}
echo '
'; // end table
echo '
';
$counter++;
}
}
echo '';
foreach ( $field['options'] as $checkbox_key => $label ) {
$name = $field['id'] . '_' . $checkbox_key;
$checked = ! empty( $saved ) && in_array( $checkbox_key, $saved, true ) ? 'checked' : '';
echo '' . esc_html( $label ) . '';
}
echo '
';
}
private function get_html_tag( $field ) {
$tag = isset( $field['tag'] ) ? $field['tag'] : 'div';
if ( isset( $field['close'] ) && true === $field['close'] ) {
return '' . $tag . '>';
}
return '<' . $tag . ' ' . $this->get_attribute_string( $field['attributes'] ) . '>';
}
private function get_repeater_tools( $field ) {
$confirm = isset( $field['confirm'] ) ? $field['confirm'] : esc_html__( 'Are you sure?', 'elementor-pro' );
$remove_title = isset( $field['remove_title'] ) ? $field['remove_title'] : esc_html__( 'Delete', 'elementor-pro' );
$toggle_title = isset( $field['toggle_title'] ) ? $field['toggle_title'] : esc_html__( 'Edit', 'elementor-pro' );
$close_title = isset( $field['close_title'] ) ? $field['close_title'] : esc_html__( 'Close', 'elementor-pro' );
return '' . $this->get_field_label( $field ) . $field_html . $description . '
';
}
public function sanitize_text_field_recursive( $data ) {
if ( is_array( $data ) ) {
foreach ( $data as $key => $value ) {
$data[ $key ] = $this->sanitize_text_field_recursive( $value );
}
return $data;
}
return sanitize_text_field( $data );
}
public function __construct() {
$this->actions();
}
}