Woocommerce订单列表页面-条件行背景色

时间:2020-07-06 12:59:10

标签: php wordpress woocommerce

在WooCommerce管理员订单列表中,如果订单具有特定的发货方式,我想更改行背景色。到目前为止,我已经:

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 I try to check order's shipping method
    $order_shipping_method = 'Royal Mail 24'; 

    <style>
        .status-wc-processing {
            background: #d7f8a7;
            color: #0c942b;
        }
    </style>
    <?php
}

不幸的是,它每隔两行就上色一次,不仅是满足装运方法条件的行顺序。 任何帮助将不胜感激。

0 个答案:

没有答案