Last active
July 17, 2023 09:36
-
-
Save webdados/0f1a8e5ca2cd98276a9ae73918e9b842 to your computer and use it in GitHub Desktop.
Shop as Client - Allow other user roles to use the functionality (Shop managers and Administrators already have the ability to do so)
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 | |
add_filter( 'shop_as_client_allow_checkout', function() { | |
$user = wp_get_current_user(); | |
return in_array( 'whatver_role', (array) $user->roles ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment