In `get_pages()`, `$cache` does not need to be reset to an empty array. `update_post_cache( $pages )` takes care of priming.
In `set_post_thumbnail()`, (accidental) assignment is unnecessary for `$thumbnail_html` as it is not used. See #27882. Built from https://develop.svn.wordpress.org/trunk@28332 git-svn-id: http://core.svn.wordpress.org/trunk@28160 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ef34785160
commit
1aed1f1108
|
@ -4176,9 +4176,6 @@ function get_pages( $args = array() ) {
|
||||||
return $pages;
|
return $pages;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !is_array($cache) )
|
|
||||||
$cache = array();
|
|
||||||
|
|
||||||
$inclusions = '';
|
$inclusions = '';
|
||||||
if ( ! empty( $include ) ) {
|
if ( ! empty( $include ) ) {
|
||||||
$child_of = 0; //ignore child_of, parent, exclude, meta_key, and meta_value params if using include
|
$child_of = 0; //ignore child_of, parent, exclude, meta_key, and meta_value params if using include
|
||||||
|
@ -5608,7 +5605,7 @@ function set_post_thumbnail( $post, $thumbnail_id ) {
|
||||||
$post = get_post( $post );
|
$post = get_post( $post );
|
||||||
$thumbnail_id = absint( $thumbnail_id );
|
$thumbnail_id = absint( $thumbnail_id );
|
||||||
if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) {
|
if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) {
|
||||||
if ( $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' ) )
|
if ( wp_get_attachment_image( $thumbnail_id, 'thumbnail' ) )
|
||||||
return update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id );
|
return update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id );
|
||||||
else
|
else
|
||||||
return delete_post_meta( $post->ID, '_thumbnail_id' );
|
return delete_post_meta( $post->ID, '_thumbnail_id' );
|
||||||
|
|
Loading…
Reference in New Issue