Opened 16 years ago
Closed 15 years ago
#13096 closed enhancement (duplicate)
Use custom taxonomies with get_adjacent_post()
| Reported by: | zerzix | Owned by: | Frumph |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Taxonomy | Version: | 3.0 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: | Focuses: |
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
@
16 years ago
- Component General → Taxonomy
- Keywords needs-patch added; taxomixy get_adjacent_post() removed
- Milestone Unassigned → Future Release
- Owner set to
- Summary use custome taxomonies with get_adjacent_post() → use custom taxomonies with get_adjacent_post()
#2
@
16 years ago
- Summary use custom taxomonies with get_adjacent_post() → Use custom taxonomies with get_adjacent_post()
#6
@
16 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
@
16 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
@
16 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
@
16 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
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
diff for get_adjacent_post, not tested