This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Email < ActiveRecord::Base | |
# Nope, it's not RFC compliant. F*** that regex. | |
# http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html | |
EmailRegex = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i.freeze | |
before_validation :strip_spaces | |
# Public: The email address. | |
# column :address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inputs = %w[ | |
CollectionSelectInput | |
DateTimeInput | |
FileInput | |
GroupedCollectionSelectInput | |
NumericInput | |
PasswordInput | |
RangeInput | |
StringInput | |
TextInput |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add the field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; | |
/** |