A
A
Artem Fedorov2020-10-14 19:49:19
WordPress
Artem Fedorov, 2020-10-14 19:49:19

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.
5f872bd88d8f6409038774.jpeg
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>';
        }
    }
}


Output is required here:
5f872bf504149956259677.jpeg
Instead of e-mail and phone or after them. How to do it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question