admin管理员组文章数量:1122832
I have defined a custom post type. On the admin listing screen I am filtering this based on a querystring argument. So if my querystring includes 'filter=abc' I show a subset of my custom posts, if the querystring does not include the filter parameter I show a different subset.
The paging navigation buttons respect my querystring parameter, so if I'm on 'filter=abc' and move to the next page, my querystring argument is still present.
However if I use the search box, or navigate directly to a different page number, the parameter is lost. This is obviously because it is not present anywhere in the form with id 'posts-filter'.
I could use DOM manipulation to add a hidden form field to the form, but this feels clumsy. Is there a better way to get WordPress to include my querystring parameter in the form?
Note that I'm not asking about pre_get_posts here, I know how to add this parameter to WP_Query once it is passed to the page. The question is how do I make sure my parameter is passed around when navigating the admin listing page.
Thanks
版权声明:本文标题:wp query - How to add an extra parameter to searches on the admin listing screen for my custom post type 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736298357a1930214.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论