Created
October 25, 2019 09:19
-
-
Save duongthanhthai/164ceae3aefac42530dcfa9e32ef924a to your computer and use it in GitHub Desktop.
Disabling the entire 'reviews' tab on a product's WooCommmerce page, add this to your functions.php file in Wordpress.
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_filter( 'woocommerce_product_tabs', 'wcs_woo_remove_reviews_tab', 98 ); | |
function wcs_woo_remove_reviews_tab($tabs) { | |
unset($tabs['reviews']); | |
return $tabs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Function validate SĐT ở Contact Form 7. Update các đầu số di động của VN
function thai_validate_sdt( $result, $tag ) {
$name = $tag->name;
$value = isset( $_POST[$name] ) ? trim( wp_unslash( strtr( (string) $_POST[$name], "\n", " " ) ) ) : '';
$errorMessage = 'Số điện thoại không hợp lệ!';
if ( 'tel' == $tag->basetype ) {
if( !preg_match('/^(032|033|034|035|036|037|038|039|086|096|097|098|081|082|083|084|085|088|091|094|056|058|092|070|076|077|078|079|089|090|093|099|059)+([0-9]{7})$/', $value ) ){
$result->invalidate( $tag, $errorMessage );
}
}
return $result;
}
add_filter('wpcf7_validate_tel*', 'tmdev_validate_sdt', 10, 2);