Opened 23 months ago
Last modified 11 months ago
#17920 new defect (bug)
Unnecessary code in wp.getPage
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | XML-RPC | Version: | 3.2 |
| Severity: | minor | Keywords: | has-patch dev-feedback |
| Cc: |
Description
Pages Does not have categories
Attachments (1)
Change History (8)
nprasath002 — 23 months ago
comment:1
follow-up:
↓ 2
F J Kaiser — 19 months ago
- Keywords 2nd-opinion added
comment:2
in reply to:
↑ 1
DrewAPicture — 19 months 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.
comment:3
F J Kaiser — 19 months ago
- Keywords close added; 2nd-opinion removed
I close it now as I think there are enough use cases for this left.
We could wrap this into a post_type_supports check and save the queries.
comment:5
in reply to:
↑ 4
F J Kaiser — 19 months 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?
comment:6
markoheijnen — 11 months 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
comment:7
markoheijnen — 11 months 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.

But categories can be added to pages.