Woocommerce – Default product image by user role
/** * Only allowing the customer and admin user role to view the product images * * @param $value * * @return bool */ function woocommerce_product_get_image_id_callback( $value ) { global $current_user; if ( in_array( ‘customer’, (array) $current_user->roles ) || in_array( ‘administrator’, (array) $current_user->roles ) ) { return $value; } else { return false; } } … Read more