Hiding div based on user role
Basically, just check inside the action if an array of the current user’s roles contains the wholesale role. function content_below_checkout_button() { if ( in_array( ‘wholesale’, wp_get_current_user()->roles ) ) { echo ‘<div style=”text-align: center”><img style=”margin-top:20px; display:inline-block;” src=”/uploads/2020/07/image.png’.$photo->name.'”/></div>’; } } add_action( ‘woocommerce_review_order_after_submit’, ‘content_below_checkout_button’ ); I’m not sure what’s going on with the rest of your code, but … Read more