Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/settings-page/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
?>
<vrts-settings class="wrap vrts-settings">
<h1><?php echo esc_html( $data['title'] ); ?></h1>
<form method="post" action="options.php">
<form method="post" action="options.php" autocomplete="off">
<?php
settings_fields( $data['settings_fields'] );
do_settings_sections( $data['settings_sections'] );
Expand Down
1 change: 1 addition & 0 deletions includes/core/settings/field-password/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class="regular-text"
name="<?php echo esc_attr( $args['id'] ); ?>"
value="<?php echo esc_attr( $value ); ?>"
placeholder="<?php echo esc_attr( $args['placeholder'] ); ?>"
autocomplete="<?php echo esc_attr( $args['autocomplete'] ?? 'off' ); ?>"
<?php wp_readonly( isset( $args['readonly'] ) && $args['readonly'] ); ?>
<?php disabled( isset( $args['disabled'] ) && $args['disabled'] ); ?>>
<?php
Expand Down
6 changes: 5 additions & 1 deletion includes/core/settings/field-text/index.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<fieldset <?php echo isset( $args['is_pro'] ) && false === $args['is_pro'] ? 'data-a11y-dialog-show="vrts-modal-pro-settings"' : ''; ?>>
<input
type="text" id="<?php echo esc_attr( $args['id'] ); ?>"
type="<?php echo esc_attr( $args['input_type'] ?? 'text' ); ?>" id="<?php echo esc_attr( $args['id'] ); ?>"
class="regular-text"
name="<?php echo esc_attr( $args['id'] ); ?>"
value="<?php echo esc_attr( $value ); ?>"
placeholder="<?php echo esc_attr( $args['placeholder'] ); ?>"
autocomplete="<?php echo esc_attr( $args['autocomplete'] ?? 'off' ); ?>"
<?php if ( isset( $args['multiple'] ) && $args['multiple'] ) : ?>
multiple="multiple"
<?php endif; ?>
<?php wp_readonly( isset( $args['readonly'] ) && $args['readonly'] ); ?>
<?php disabled( isset( $args['disabled'] ) && $args['disabled'] ); ?>>
<?php
Expand Down
11 changes: 11 additions & 0 deletions includes/features/class-settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public function add_settings() {
'sanitize_callback' => 'sanitize_text_field',
'show_in_rest' => true,
'value_type' => 'string',
'autocomplete' => 'off',
'default' => '',
]);

Expand All @@ -111,6 +112,7 @@ public function add_settings() {
'sanitize_callback' => 'sanitize_text_field',
'show_in_rest' => true,
'value_type' => 'string',
'autocomplete' => 'off',
'value' => ! empty( vrts()->settings()->get_option( 'vrts_license_key', false ) ) ? 'XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX' : '',
'default' => '',
]);
Expand Down Expand Up @@ -201,6 +203,9 @@ public function add_settings() {
'title' => esc_html__( 'Schedule', 'visual-regression-tests' ),
'description' => esc_html__( 'Separate multiple email addresses with commas. Or leave blank to disable notifications.', 'visual-regression-tests' ),
'placeholder' => esc_html__( 'Email address(es)', 'visual-regression-tests' ),
'input_type' => 'email',
'multiple' => true,
'autocomplete' => 'email',
'sanitize_callback' => [ Sanitization::class, 'sanitize_multiple_emails' ],
'show_in_rest' => true,
'value_type' => 'string',
Expand All @@ -214,6 +219,9 @@ public function add_settings() {
'section' => 'vrts-settings-section-notifications',
'title' => esc_html__( 'Update', 'visual-regression-tests' ),
'placeholder' => esc_html__( 'Email address(es)', 'visual-regression-tests' ),
'input_type' => 'email',
'multiple' => true,
'autocomplete' => 'email',
'sanitize_callback' => [ Sanitization::class, 'sanitize_multiple_emails' ],
'show_in_rest' => true,
'value_type' => 'string',
Expand All @@ -229,6 +237,9 @@ public function add_settings() {
'section' => 'vrts-settings-section-notifications',
'title' => esc_html__( 'API', 'visual-regression-tests' ),
'placeholder' => esc_html__( 'Email address(es)', 'visual-regression-tests' ),
'input_type' => 'email',
'multiple' => true,
'autocomplete' => 'email',
'sanitize_callback' => [ Sanitization::class, 'sanitize_multiple_emails' ],
'show_in_rest' => true,
'value_type' => 'string',
Expand Down
Loading