[wp-trac] [WordPress Trac] #27246: Add function to get the excerpt outside the loop
WordPress Trac
noreply at wordpress.org
Wed Oct 1 09:12:50 UTC 2014
#27246: Add function to get the excerpt outside the loop
-------------------------------+-----------------------------
Reporter: Atoon | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Posts, Post Types | Version: 3.8.1
Severity: normal | Resolution:
Keywords: needs-patch | Focuses: template
-------------------------------+-----------------------------
Comment (by DrewAPicture):
Replying to [comment:3 husobj]:
> I notice get_the_excerpt() current accepts 1 parameter which is
$deprecated since 2.3
>
> It looks like it used to be `get_the_excerpt( $fakeit = true )`
https://core.trac.wordpress.org/browser/tags/1.5/wp-includes/template-
functions-post.php#L110 back as far as 1.5 but $fakeit it doesn't seem to
be used anywhere so I presume we'd be OK to pass a post ID now like
get_the_title()?
We'd still need to pass the `$deprecated` argument, which definitely makes
adding additional parameters a little clunky since you'd effectively call
it as `get_the_excerpt( '', $post_id );`
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27246#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list