Opened 14 years ago
Closed 13 years ago
#13096 closed enhancement (duplicate)
Use custom taxonomies with get_adjacent_post()
Reported by: | zerzix | Owned by: | Frumph |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Taxonomy | Keywords: | needs-patch |
Focuses: | Cc: |
Description
I would like to use Hierarchical taxonomies in the Get_adjacent_post() function in the pace of the hard coded category. I feel that this is a needed enhancement with the enhanced custom taxonomy functions.
Attachments (2)
Change History (16)
#1
@
14 years ago
- Component changed from General to Taxonomy
- Keywords needs-patch added; taxomixy get_adjacent_post() removed
- Milestone changed from Unassigned to Future Release
- Owner set to filosofo
- Summary changed from use custome taxomonies with get_adjacent_post() to use custom taxomonies with get_adjacent_post()
#2
@
14 years ago
- Summary changed from use custom taxomonies with get_adjacent_post() to Use custom taxonomies with get_adjacent_post()
#6
@
14 years ago
- Keywords needs-patch added; has-patch needs-testing removed
We need to prepare those strings then. We might want to also double-check get_taxonomies to make sure the requested taxonomy is registered.
#11
@
14 years ago
@Sergey Please double check the apply_filters part where I added the _${taxonomy} part if that would work or not, that's an area i'm not familiar with
#12
@
14 years ago
- Keywords needs-patch added; has-patch removed
It seems that the function is not working as is, since there is no post
taxonomy.
#13
@
14 years ago
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
diff for get_adjacent_post, not tested