[wp-trac] [WordPress Trac] #39947: REST API: Sticky post query returns unsticky posts when no posts are sticky
WordPress Trac
noreply at wordpress.org
Thu Feb 23 16:52:49 UTC 2017
#39947: REST API: Sticky post query returns unsticky posts when no posts are sticky
--------------------------+--------------------
Reporter: ryelle | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.7.4
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+--------------------
Comment (by jnylen0):
@kadamwhite what do you think about getting this into 4.7.3 if we can get
it patched quickly enough?
@ryelle are you available to write a patch and unit tests for this change
today?
As for the patch, I would suggest something like this:
{{{#!php
<?php
$sticky_posts = get_option( 'sticky_posts', array() );
if ( ! is_array( $sticky_posts ) ) {
$sticky_posts = array();
}
if ( $request['sticky'] ) {
// ...
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/39947#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list