[wp-trac] [WordPress Trac] #33921: Twenty Fourteen: Featured_Content::get_sticky_posts() getting also non published posts
WordPress Trac
noreply at wordpress.org
Fri Sep 18 12:39:01 UTC 2015
#33921: Twenty Fourteen: Featured_Content::get_sticky_posts() getting also non
published posts
-------------------------------+------------------------------
Reporter: stode | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bundled Theme | Version: trunk
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Changes (by SergeyBiryukov):
* keywords: => reporter-feedback
* focuses: accessibility =>
Comment:
Hi @stode, welcome to Trac!
I could not reproduce the issue. My steps:
1. Create a draft sticky post.
2. Make sure I don't have a `featured` tag.
3. Clear the `'featured_content_ids'` transient in the database.
4. The featured content section displays published sticky posts, but not
the draft post.
[source:tags/4.3.1/src/wp-content/themes/twentyfourteen/inc/featured-
content.php#L189 Featured_Content::get_sticky_posts()] indeed just returns
the value of `'sticky_posts'` option without any further checking.
However, when [source:tags/4.3.1/src/wp-content/themes/twentyfourteen/inc
/featured-content.php#L114 Featured_Content::get_featured_posts()] calls
`get_posts()` later, the implicit default `post_status` value is applied,
which is [source:tags/4.3.1/src/wp-includes/post.php?marks=1886,1887#L1875
publish].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33921#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list