Eu vou expandir a resposta do MiCc83. Existem algumas coisas que não seguem as perguntas originais do OP, mas no geral é uma ótima solução. Por exemplo, não funcionaria com um evento post_type porque você está verificando o post_type como 'post' na resposta.
add_action( 'admin_init', 'do_something_152677' );
function do_something_152677 () {
// Global object containing current admin page
global $pagenow;
// If current page is post.php and post isset than query for its post type
if ( 'post.php' === $pagenow && isset($_GET['post']) ){
$post_id = $_GET['post'];
// Do something with $post_id. For example, you can get the full post object:
$post = get_post($post_id);
}
}
A condição 'post' === get_post_type( $_GET['post'] )
na resposta anterior impediria que isso funcionasse em um tipo de post 'event'. Você precisaria verificar o tipo de postagem 'event' em vez de 'post'.