wordpresswp-admin

How to change background-color in wp-admin/post.php


I want to change background-color or add text "It's draft" or anything in wp-admin/post.php according to the value of the post status. I know how to change it on the list page(wp-admin/edit.php). But I don't know what to do in wp-admin/post.php

Is there a dedicated filter / hook or html-class?


Solution

  • In your functions.php:

    Use the admin_body_class hook to add the post status to the body of the post backend. Then create a custom stylesheet and enqueue it with the admin_enqueue_scripts hook.

    Hope this helps.