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.


git-svn-id: https://develop.svn.wordpress.org/trunk@28332 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-05-06 21:38:23 +00:00
parent 11e65eb200
commit 16a58e34a2
1 changed files with 1 additions and 4 deletions

View File

@ -4176,9 +4176,6 @@ function get_pages( $args = array() ) {
return $pages;
}
if ( !is_array($cache) )
$cache = array();
$inclusions = '';
if ( ! empty( $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 );
$thumbnail_id = absint( $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 );
else
return delete_post_meta( $post->ID, '_thumbnail_id' );