Changes between Version 4 and Version 5 of Ticket #23422, comment 7
- Timestamp:
- 05/06/2016 11:31:20 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #23422, comment 7
v4 v5 9 9 Essentially this filters the post-type list and only displays the posts associated to the selected taxonomy term. Nice feature when working with multiple terms per taxonomy. In theory & practice if you have a post-type and 3 taxonomies you can drill-down via this method with a select per taxonomy. 10 10 11 Example code below I've used in my own framework :11 Example code below I've used in my own framework. Note this was used in a class, so $this in code examples: 12 12 13 13 {{{#!php 14 14 <?php 15 add_action( 'restrict_manage_posts', '_post_type_filter' );16 function _post_type_filter() {15 add_action( 'restrict_manage_posts', array( $this, '_post_type_filter' ) ); //in __construct 16 public function _post_type_filter() { 17 17 18 18 //required presets … … 54 54 {{{#!php 55 55 <?php 56 add_filter( 'parse_query', array( $this, '_post_type_filter_query') ); 56 add_filter( 'parse_query', array( $this, '_post_type_filter_query') ); //in construct 57 57 public function _post_type_filter_query( $query ) { 58 58