Стиль нескольких пользовательских заказов - PullRequest
0 голосов
/ 12 апреля 2020

Как изменить следующий текст, чтобы он работал для двух пользовательских стилей статуса заказа? Он отлично работает для одного, но не для обоих.

// ADD COLOR TO IN PROGRESS BUTTON
add_action('admin_head', 'styling_admin_order_list' );
function styling_admin_order_list() {
    global $pagenow, $post;

    if( $pagenow != 'edit.php') return; // Exit
    if( get_post_type($post->ID) != 'shop_order' ) return; // Exit

    // HERE below set your custom status
    $order_status = 'awaiting shipment'; // <==== HERE
    ?>
    <style>
        .order-status.status-<?php echo sanitize_title( $order_status ); ?> {
            background: #cc0099;
            color: #ffffff;
        }
    </style>
         $order_status = 'shipped'; // <==== HERE
    ?>
    <style>
        .order-status.status-<?php echo sanitize_title( $order_status ); ?> {
            background: ##34cfeb;
            color: #ffffff;
        }
    </style>
           <?php
}
...