Skip to content

Instantly share code, notes, and snippets.

@namncn
Last active January 12, 2024 17:40
Show Gist options
  • Save namncn/4fd626737f1731cbfc84d19409055fd6 to your computer and use it in GitHub Desktop.
Save namncn/4fd626737f1731cbfc84d19409055fd6 to your computer and use it in GitHub Desktop.
Bật mặc định cho phép đánh giá của WooCommerce
<?php
// Dán đoạn code dưới đây vào file functions.php của theme
function sharexcode_set_reviews_allowed( $product ) {
$product->set_reviews_allowed( true );
}
add_action( 'woocommerce_admin_process_product_object', 'sharexcode_set_reviews_allowed', 99999 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment