[wp-trac] [WordPress Trac] #13096: Use custom taxonomies with get_adjacent_post()

WordPress Trac wp-trac at lists.automattic.com
Mon Jan 3 05:35:18 UTC 2011


#13096: Use custom taxonomies with get_adjacent_post()
-------------------------+-----------------------------
 Reporter:  zerzix       |       Owner:  Frumph
     Type:  enhancement  |      Status:  assigned
 Priority:  normal       |   Milestone:  Future Release
Component:  Taxonomy     |     Version:  3.0
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |
-------------------------+-----------------------------

Comment (by Frumph):

 http://wp.pastebin.com/j61WThB6

 Yep, okay here's a different route,

 Excerpt:
 {{{
 function get_adjacent_post($in_same_category = false, $previous = true,
 $excluded_categories = '', $taxonomy = '') {
         global $post, $wpdb;

         if ( empty( $post ) || ( !empty($taxonomy) && !taxonomy_exists(
 $taxonomy ) ) )
                 return null;
 }}}

 If it's an empty post, or it's not an empty taxonomy && the taxonomy
 doesn't exist, return null

 that should be a good sanity check on the taxonomy

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13096#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list