Last active
July 10, 2022 19:15
-
-
Save tdmrhn/336dc7168d05737936e6d5a5f1531a01 to your computer and use it in GitHub Desktop.
Add Whatsapp - Email icon links to Woo Orders Table
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_action( 'manage_shop_order_posts_custom_column', function ( $column, $post_id ) { | |
if ( $column == 'order_number' ) { | |
global $the_order; | |
if( $phone = $the_order->get_billing_phone() ) { echo ' - <a href="https://wa.me/'.$phone.'" target="_blank"><span class="dashicons dashicons-whatsapp"></span></a>'; } | |
if( $email = $the_order->get_billing_email() ) { echo ' - <a href="mailto:'.$email.'" target="_blank"><span class="dashicons dashicons-email"></span></a>'; } | |
} | |
}, 50, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment