Hi
I have an events custom post type and I’m trying to hide past events in the WordPress admin screen. I’ve looked all over but everything I’ve found only relates to the front end.
Can anyone point me in the right direction?
Thanks
I didn’t see what this has to do with ACF.
And why do you want to hide these post on the admin screen. If you hide them, how to get access to them?
@alryalls did you ever arrive at a solution to this?
And to Thomas, the ACF is controlling, I assume, the Event Date and the answer to your question is it will need to be toggled.
@tmconnect is correct, this is not really an ACF question even if the field you want to filter posts by is an acf field. But here is an overview of how to do this.
You need to add a pre_get_post filter to WP, check that the query is being done:
- In the admin
is_admin()
- hat the query is the main query
$query->is_main_query()
- The the query is being done on your post type, here you need to check the $query->query array to see what is being queried