WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 7 months ago

Last modified 7 months 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:

Description

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 (3)

comment:1 Denis-de-Bernardy4 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.

comment:2 c3mdigital7 months 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.

comment:3 SergeyBiryukov7 months ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.