I won’t be adding this to the plugin.
But you could do this yourself by using a filter on WordPress’s own wpquery with a test for is_admin. You can see I’ve done a similar filter on the front end in the plugin itself.
If you can’t do it yourself then I could do it for you for a small donation (if so email me on shawfactor at gmail dot com).
But hopefully you can work it out and do it yourself.
Pete
resolving this for good order, I will still monitor the thread
Thread Starter
Elyx
(@kokers)
Hey Pete, thanks for the info. I will add necessary filters myself, just wanted to know if there are any build in. I will post it here when I’m done in case someone else need this.
Thanks for the plugin!
Okay thsnkyou I’ll add it to the FAQ when you do
Thread Starter
Elyx
(@kokers)
There is something like “show_in_admin_all_list” when new post status is registered that won’t work for some cases, and there is a bug in WP core opened for the past 5 years https://core.trac.ww.wp.xz.cn/ticket/24415 So instead of using simple true/false that could handle this, we need a filter. Because this can’t be that easy ;o) Either way, this is what I used with simple JS count fix. If anyone use this, you might need to adjust to your needs.
function hide_archived_from_all_view($wp_query){
if(!is_admin()){
return;
}
if(isset($_GET['post_status'])){
return;
}
$screen = get_current_screen();
if('edit' !== $screen->base){
return;
}
if($wp_query->is_main_query()){
$wp_query->query_vars['post_status'] = [
'publish',
'private',
'future',
'draft'
];
}
}
add_filter('pre_get_posts', 'hide_archived_from_all_view');
function hide_archived_from_all_view_count_fix(){
$screen = get_current_screen();
if('edit' !== $screen->base){
return;
}
?>
<script>
document.addEventListener("DOMContentLoaded", function(event){
var total = document.querySelector('.subsubsub .all .count').innerHTML.match(/\d+/g).map(Number)[0], archiveCount = document.querySelector('.subsubsub .archive .count').innerHTML.match(/\d+/g).map(Number)[0];
document.querySelector('.subsubsub .all .count').innerHTML='('+(total - archiveCount)+')';
});
</script>
<?php
}
add_action('admin_print_scripts', 'hide_archived_from_all_view_count_fix');