Skip to content

Instantly share code, notes, and snippets.

View AlexNetsov's full-sized avatar
🚀
Conquering

Alex AlexNetsov

🚀
Conquering
View GitHub Profile
@hiendnguyen
hiendnguyen / registration-form.php
Last active November 17, 2021 14:53
WooCommerce Registration Custom Fields Validation
<?php
/** Validate the extra register fields. */
function wooc_validate_extra_register_fields( $username, $email, $validation_errors ) {
if ( isset( $_POST['billing_first_name'] ) && empty( $_POST['billing_first_name'] ) ) {
$validation_errors->add( 'billing_first_name_error', __( 'What\'s your first name?', 'woocommerce' ) );
}
if ( isset( $_POST['billing_last_name'] ) && empty( $_POST['billing_last_name'] ) ) {
$validation_errors->add( 'billing_last_name_error', __( 'What\'s your last name?', 'woocommerce' ) );
@kirandash
kirandash / Gravity Forms + Bootstrap
Created July 14, 2016 10:00
Helpful function for adding Bootstrap classes to Gravity Forms fields.
<?php
/**
* Gravity Forms Bootstrap Styles
*
* Applies bootstrap classes to various common field types.
* Requires Bootstrap to be in use by the theme.
*
* Using this function allows use of Gravity Forms default CSS
* in conjuction with Bootstrap (benefit for fields types such as Address).
*