Answer the question
In order to leave comments, you need to log in
How to display links in the order (admin panel)?
I'm trying to display custom links after Billing in an open order (after clicking on the order name)
I'm trying to find a hook that does this, but I can't find it.
In the vastness of the vast, such a solution was found, but it displays it in the wrong place, of course, because of the hook and column.
The code itself:
add_action( 'manage_shop_order_posts_custom_column' , 'custom_orders_list_column_content', 50, 2 );
function custom_orders_list_column_content( $column, $post_id ) {
if ( $column == 'order_number' )
{
global $the_order;
if( $phone = $the_order->get_billing_phone() ){
$phone_wp_dashicon = '<span class="dashicons dashicons-phone"></span> ';
echo '<br><a href="tel:'.$phone.'">' . $phone_wp_dashicon . $phone.'</a></strong>';
}
if( $email = $the_order->get_billing_email() ){
echo '<br><strong><a href="mailto:'.$email.'">' . $email . '</a></strong>';
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question