Last active
August 16, 2023 10:03
-
-
Save wooxperto/b613a68fb00494b62af72e00253c4dcf to your computer and use it in GitHub Desktop.
Hide SKU at single product page for normal user and only admin can see the prouduct SKU.
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
<?php | |
/** | |
* @snippet Add a continue shopping button at single proudct page | WooCommerce | |
* @author WooXperto | |
* @date 10.08.2023 | |
*/ | |
if( !function_exists("wooXperto_hide_sku_for_normal_users")){ | |
function wooXperto_hide_sku_for_normal_users(){ | |
if( !current_user_can('administrator') && is_product() ){ | |
return false; | |
}else{ | |
return true; | |
} | |
} | |
} | |
add_filter("wc_product_sku_enabled","wooXperto_hide_sku_for_normal_users"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hide sku at single product page for normal user