No, 'wp'
action hook is not triggered on post edit page.
This hook is a query-related hook, it means that it runs everytime a posts query is triggered from an url.
For this reason it’s a more frontend
hook (it runs on every frontend request), even if is triggered in some edit pages, more specifically, in the admin pages that do a post query: edit.php
(so post, page and every cpt list) and upload.php
(that show a list of media, i.e. attachment post type).
When you are on single post edit, no post query is triggered, because the current post is retrieved by WP with get_post()
.
'posts_selection'
is another query-related hook, so it runs on every frontend request and on admin pages that run a post query (just like the 'wp'
hook).
If you need and early action hook that runs on post edit page, a good idea is look at 'load-post.php'
hook (one of the 'load-{$page}'
hooks), that is fired only on post edit page.
In a function that runs on that hook, you can access to the post id being edited using $_GET['post']
variable.