Apply checks in [27964] to wp_write_post(), which is unused and due for dismantling and deprecation.

see #27452.


git-svn-id: https://develop.svn.wordpress.org/trunk@27975 602fd350-edb4-49c9-b593-d223f7449a82