もともとtrにはステータスによってオリジナルのクラスがつけられているので、それに対してCSSを設定すればいい話でした。
こちらは背景色を変更+下書きという帯を付ける例です。
.status-draft {
background-color: #f4f4f4 !important;
position: relative;
}
.status-draft:after {
background-color: rgba(0, 0, 0, 0.75);
color: #fff;
content: "下書き";
display: block;
font-size: 14px;
padding: 5px 0;
position: absolute;
text-align: center;
top: 0;
width: 5em;
left: 0;
}
管理画面用のCSSがない場合は以下をfunctions.phpに追加することで反映されます。
function change_post_status_background_color() {
?>
<style type="text/css">
.status-draft {
background-color: #f4f4f4 !important;
position: relative;
}
.status-draft:after {
background-color: rgba(0, 0, 0, 0.75);
color: #fff;
content: "下書き";
display: block;
font-size: 14px;
padding: 5px 0;
position: absolute;
text-align: center;
top: 0;
width: 5em;
left: 0;
}
</style>
<?php }
add_action( 'admin_head', 'change_post_status_background_color' );


