Skip to content

Commit

Permalink
Fix element id name #2661
Browse files Browse the repository at this point in the history
  • Loading branch information
raftaar1191 committed Jan 17, 2018
1 parent d5431b2 commit 212edb0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions includes/forms/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1113,16 +1113,20 @@ function give_get_register_fields( $form_id ) {
<label for="give-create-account-<?php echo $form_id; ?>">
<?php
// Add attributes to checkbox, if Guest Checkout is disabled.
$is_guest_checkout = give_get_meta( $form_id,'_give_logged_in_only', true );
if( ! give_is_setting_enabled( $is_guest_checkout ) ) {
$is_guest_checkout = give_get_meta( $form_id, '_give_logged_in_only', true );
$id = 'give-create-account-' . $form_id;
if ( ! give_is_setting_enabled( $is_guest_checkout ) ) {
echo Give()->tooltips->render(
array(
'tag_content' => '<input type="checkbox" name="give_create_account" id="give-create-account-" class="give-input" checked disabled /><input type="hidden" name="give_create_account" value="on" />',
'label' => __( 'Registration is required to donate.', 'give' ),
'tag_content' => sprintf(
'<input type="checkbox" name="give_create_account" id="%s" class="give-input" checked disabled /><input type="hidden" name="give_create_account" value="on" />',
$id
),
'label' => __( 'Registration is required to donate.', 'give' ),
) );
} else {
?>
<input type="checkbox" name="give_create_account" id="give-create-account-<?php echo $form_id; ?>" class="give-input" />
<input type="checkbox" name="give_create_account" id="<?php echo $id; ?>" class="give-input"/>
<?php
}
?>
Expand Down

0 comments on commit 212edb0

Please sign in to comment.