You do not post how you add the top level menu page, however I think when you click on a submenu item you have an url like:
http://www.example.com/wp-admin/admin.php?page=theme_admin_{$pageid}
So the id of page is in the $_GET['page']
variable with a fixed string prepended to it.
So why don’t use something like:
function display_page_test() {
$id = (int)str_replace('theme_admin_', '', $_GET['page']);
$page = get_post($id);
$action = isset($_GET['action']) ? $_GET['action'] : '';
// just for test
switch ( $action ) {
case 'edit' :
echo 'Do you want to edit ' . $page->post_title. '?';
return;
case 'delete' :
echo 'Do you want to remove' . $page->post_title . '?';
return;
default :
echo 'Ok, now we only show ' . $page->post_title;
echo '<pre>';
print_r($page);
echo '</pre>';
return;
}
}
Edit
If you do not like the str_replace
stuff, just use the clean post id in the variable:
add_submenu_page('theme_admin2', 'Administration', $v->title, 'edit_posts', 'theme_admin_' . $v->object_id. '&post_id=' . $v->object_id, array(&$this, 'display_page_test'));
Then rely on $_GET['post_id']