Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix element id name #2661 #2662

Merged
merged 2 commits into from
Jan 17, 2018
Merged
Changes from 1 commit
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
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