I am tuning my new site and i what to disable Content Editor for post created after date X, but for posts that created before that date Content Editor must be on its place.
1 comment
Comments are closed.
I am tuning my new site and i what to disable Content Editor for post created after date X, but for posts that created before that date Content Editor must be on its place.
Comments are closed.
I couldn’t find a great hook for this but
add_post_meta_boxes_*
is early enough, and it passes the$post
object to the callback.Basically the filter checks the post on the post edit screen and removes post type support based on the post age. I used two months as the cutoff but that is easily altered.
I don’t see the point of worrying about the editor except on the backend, unless you have a front-end posting mechanism.
Removing the editor makes the page a bit ugly, but I think that adding some kind of message meta box via
edit_form_after_title
would sort that out– as done here: https://wordpress.stackexchange.com/a/100495/21376Reference
http://codex.wordpress.org/Function_Reference/remove_post_type_support