Site icon Hip-Hop Website Design and Development

current_user_can comma list vs OR (||) list

Can any help with this?

I like the comma separated version because it’s smaller to write and easy on the eyes, lol, but I can’t make it work.

//** WORKING - Works on the Checkout page
add_action( 'woocommerce_cart_contents', 'pst_pdf_ceckout_page_button' );
function pst_pdf_ceckout_page_button() {
    if( current_user_can('administrator') || current_user_can('ABC') || current_user_can('LMN') || current_user_can('XYZ') ) {
echo '<a class="button bc-pst-pdf-btn" https://LINK TO FILE.pdf" target="_blank">PST Exempt PDF Form </a>';
} 
}


//** NOT WORKING - Won't show up on the Checkout page.
add_action( 'woocommerce_cart_contents', 'pst_pdf_ceckout_page_button' );

function pst_pdf_ceckout_page_button() {
    if ( current_user_has_role( array('administrator', 'ABC', 'LMN', 'XYZ') ) ) {
echo '<a class="button bc-pst-pdf-btn" href="https://LINK TO FILE.pdf" target="_blank">PST Exempt PDF Form </a>';
} 
}