Make WordPress Core

Opened 11 years ago

Closed 7 years ago

Last modified 4 years ago

#11890 closed enhancement (wontfix)

allow get_the_content to accept post ID

Reported by: williamsba1 Owned by: williamsba1
Milestone: Priority: normal
Severity: normal Version: 2.9.1
Component: Template Keywords:
Focuses: Cc:


The function get_the_content currently doesn't accept a post ID as a parameter. I'm suggesting adding this as a fourth parameter allowing this function to work like get_the_title does.

I'll supply a patch if this sounds like a good idea

Change History (4)

#1 @Denis-de-Bernardy
11 years ago

  • Component changed from General to Template
  • Keywords close added
  • Milestone changed from Unassigned to Future Release
  • Version set to 2.9.1

It's one of those weirdness'. it's at least partially due to the fact that the_content() and the_permalink() each have a highly popular filter that get_the_content() and get_permalink() don't have.

Suggesting wontfix and that we revisit this after we re-engineer this part of WP.

#2 @c3mdigital
7 years ago

  • Keywords close removed
  • Resolution set to wontfix
  • Status changed from new to closed

We tried it in [24301] then removed it in [24598].

For get_the_content() and the_content(), this only worsens the function prototype. It muddies theme-specific display (more links, etc) with filtered content. apply_filters( 'the_content', $post->post_content ) is sufficient practice for now.

#3 @SergeyBiryukov
7 years ago

  • Milestone Future Release deleted

#4 @ocean90
4 years ago

#34480 was marked as a duplicate.

Note: See TracTickets for help on using tickets.