Skip to content

Instantly share code, notes, and snippets.

@patrickposner
Created July 3, 2018 07:43
Show Gist options
  • Select an option

  • Save patrickposner/3c824a863e24825c36fec3e4f618c108 to your computer and use it in GitHub Desktop.

Select an option

Save patrickposner/3c824a863e24825c36fec3e4f618c108 to your computer and use it in GitHub Desktop.
Datenschutz Checkbox in Atomion
/**
* Privacy Declaration for My Account Registration
*
* @wp-hook woocommerce_register_form
* @since 3.6
* @static
* @access public
* @return void
**/
public static function my_account_registration_fields() {
if ( get_option( 'gm_checkbox_5_my_account_registration_activation', 'on' ) == 'on' ) {
$default_text = __( 'I have read and accept the [link-privacy]privacy policy[/link-privacy].', 'woocommerce-german-market' );
$text = get_option( 'gm_checkbox_5_my_account_registration_text', $default_text );
$text = apply_filters( 'german_market_checkout_checkbox_text_markup', self::replace_placeholders_terms_privacy_revocation( $text ) );
if ( get_option( 'gm_checkbox_5_my_account_registration_opt_in', 'on' ) == 'on' ) {
?>
<p class="form-row validate-required" id="german_market_privacy_declaration_field" data-priority="999"><span class="woocommerce-input-wrapper">
<input class="woocommerce-form__input woocommerce-form__input-checkbox" name="german_market_privacy_declaration" type="checkbox" id="german_market_privacy_declaration" value="1" />
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox inline" for="german_market_privacy_declaration">
<span class="required">*</span>
<span><?php echo $text; ?>&nbsp</span>
</label>
</p>
<?php } else {
echo '<div class="woocommerce-privacy-policy-text"><p>';
echo $text;
echo '</p></div>';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment