i'm working on a plugin that generate some pages and they are hidden to User in the wp admin. But i had not choise to do a radical action and hidden ALL pages created from my plugin. The ideal for me is hidden the pages from WP admin in "pages" but make them visible in "Trash". I make this function to hide pages:
add_filter( 'parse_query', 'mic_hide_pages_in_wp_admin' );
function mic_hide_pages_in_wp_admin($query) {
global $pagenow,$post_type,$post_status;
$result = mic_get_all_id();
if (is_admin() && $pagenow=='edit.php' && $post_type =='page') {
$query->query_vars['post__not_in'] = $result;
}
}
mic_get_all_id() is my function that get all ID of generated pages for hide them. Now, how can i make visible all this page when some of them are put in the trash?