Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function remove_core_updates2(){
- global $wp_version;return(object) array('last_checked'=> time(),'version_checked'=> $wp_version,);
- }
- add_filter('pre_site_transient_update_core','remove_core_updates2');
- add_filter('pre_site_transient_update_plugins','remove_core_updates2');
- add_filter('pre_site_transient_update_themes','remove_core_updates2');
- add_filter( 'woocommerce_checkout_fields', 'wc_add_confirm_password_checkout', 10, 1 );
- function wc_add_confirm_password_checkout( $checkout_fields ) {
- if ( get_option( 'woocommerce_registration_generate_password' ) == 'no' ) {
- $checkout_fields['account']['account_password2'] = array(
- 'type' => 'password',
- 'label' => __( 'Confirm password', 'woocommerce' ),
- 'required' => true,
- 'placeholder' => _x( 'Confirm Password', 'placeholder', 'woocommerce' )
- );
- }
- return $checkout_fields;
- }
- // Check the password and confirm password fields match before allow checkout to proceed.
- add_action( 'woocommerce_after_checkout_validation', 'wc_check_confirm_password_matches_checkout', 10, 2 );
- function wc_check_confirm_password_matches_checkout( $posted ) {
- $checkout = WC()->checkout;
- if ( ! is_user_logged_in() && ( $checkout->must_create_account || ! empty( $posted['createaccount'] ) ) ) {
- if ( strcmp( $posted['account_password'], $posted['account_password2'] ) !== 0 ) {
- wc_add_notice( __( 'Passwords do not match.', 'woocommerce' ), 'error' );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement