Disable wallet for different user roles

[ad_1]

@ronanprado You can use the attached code to block wallet usage for author user role.

add_filter( 'woo_wallet_is_user_wallet_locked', 'woo_wallet_is_user_wallet_locked_callback', 10, 2 );
if ( ! function_exists( 'woo_wallet_is_user_wallet_locked_callback' ) ) {
	function woo_wallet_is_user_wallet_locked_callback( $is_locked, $user_id ) {
		$user = new WP_User( $user_id );
		if ( in_array( 'author', (array) $user->roles, true ) ) {
			// The user has the "author" role so block wallet.
			$is_locked = true;
		}
		return $is_locked;
	}
}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer