Custom post type called 'action' messes up dashboard post search and pagination
-
OK, I’m not sure what to call this: a bug possibly? Wondering if someone can help verify the behaviour and let me know if I’m just being stupid or if this needs something in either core, or possibly just the codex, fixed.
I have a custom built theme that contains a custom post-type called “action”.
The site that this is on has a problem in the dashboard: doing a search from the posts list (for ANY post type) returns no results when you’re searching for something that exists.
Disabling the custom post type and re-running the search brings back results.
The codex doesn’t list “action” as a reserved type: https://codex.www.ads-software.com/Function_Reference/register_post_type
I think this behaviour might be because the search generates a URL with a query like: /wp-admin/edit.php?s=work&post_status=all&post_type=page&action=-1&paged=1&action2=-1
I note that if I delete ‘&action=-1’ from the query it works again, so I’m guessing that the action form variable is generating some additional query var that’s adding some condition about the action post type.
The solution would seem to be to rename the “action” post type. But I’m wondering if anyone wants to try and verify this behaviour and help me out with some other suggestions?
Thanks
Ross
- The topic ‘Custom post type called 'action' messes up dashboard post search and pagination’ is closed to new replies.