Opened 14 years ago
Closed 11 years ago
#17920 closed enhancement (fixed)
Unnecessary code in wp.getPage
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.1 | Priority: | normal |
Severity: | minor | Version: | 3.2 |
Component: | XML-RPC | Keywords: | has-patch dev-feedback |
Focuses: | Cc: |
Description
Pages Does not have categories
Attachments (2)
Change History (11)
#2
in reply to:
↑ 1
@
14 years ago
Replying to F J Kaiser:
But categories can be added to pages.
Agreed. On one of my sites, pages rely on categories to display specific posts from said categories. At the time it was in deference to creating a new custom post type.
#3
@
14 years ago
- Keywords close added; 2nd-opinion removed
I close it now as I think there are enough use cases for this left.
#4
follow-up:
↓ 5
@
14 years ago
We could wrap this into a post_type_supports check and save the queries.
#5
in reply to:
↑ 4
@
14 years ago
Replying to nacin:
We could wrap this into a post_type_supports check and save the queries.
Would this add any performance in- or decrease?
#6
@
13 years ago
Now there is wp_getPost. I recommend using that instead of wp_getPage. That said I'm not sure how to use post_type_supports. There isn't one for categories, right?
Weird thing is that we expect only categories and not tags or custom taxonomies. I think we should copy the stuff from _prepare_post to _prepare_page and that will solve the issue with a fallback for categories
#7
@
13 years ago
- Keywords dev-feedback added; close removed
- Summary changed from Unnecessary code to Unnecessary code in wp.getPage
Wonder if we can inherit most of the getPost functionality in getPage.
#8
@
11 years ago
- Milestone changed from Awaiting Review to 4.1
- Type changed from defect (bug) to enhancement
Created a new patch that adds a is_object_in_taxonomy() check. It will prevent one query like this one:
SELECT t.term_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON tt.term_id = t.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (2) ORDER BY t.name ASC
Moving to 4.1 for consideration.
But categories can be added to pages.