Opened 11 years ago
Closed 10 years ago
#34480 closed enhancement (duplicate)
get_the_content inconsistent with get_the_title
| Reported by: | atomicjack | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Posts, Post Types | Version: | 4.4 |
| Severity: | normal | Keywords: | has-patch 2nd-opinion |
| Cc: | Focuses: | template |
Description
get_the_title accepts a post id parameter, to target a specific post outside of the loop; one would assume that get_the_content would work the same way.
That is not the case.
get_the_content does not currently accept a post id as the first parameter - which goes against what would be assumed after having used get_the_title.
TLDR: add post id parameter to get_the_content.
Attachments (2)
Change History (7)
#3
@
11 years ago
- Keywords has-patch 2nd-opinion added
34480.diff add the additional id param to both get_the_content and get_the_excerpt. It is a bit strange that they are in different positions (second and third) and after deprecated params but the use case seems to make sense.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Note:
get_the_excerpt()doesn't support a post parameter either. It has a deprecated function argument though.