[wp-trac] [WordPress Trac] #24613: get_uploaded_header_images returns empty

WordPress Trac noreply at wordpress.org
Wed Jun 19 23:31:52 UTC 2013


#24613: get_uploaded_header_images returns empty
--------------------------+-----------------------------
 Reporter:  mhzmaster     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.5.1
 Severity:  normal        |   Keywords:  needs-patch
--------------------------+-----------------------------
 Should be a simple fix. I wanted to document a bug I found which causes
 the built-in Random Header feature to break in WordPress 3.5.1 and trunk.

 The call to get_uploaded_header_images() in _get_random_header_data()
 always returns an empty array, causing get_random_header_image() and
 get_header_image() to also return null. This results in an empty header
 image in themes which should support custom headers, including random
 ones.

 I've traced the error to improper arguments to get_post() within the body
 of get_uploaded_header_images()

 wp-includes/theme.php:1003:
 {{{
         $headers = get_posts( array( 'post_type' => 'attachment',
 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' =>
 get_option('stylesheet'), 'orderby' => 'none', 'nopaging' => true ) );
 }}}

 the 'orderby' => 'none' parameter is not a valid argument and causes the
 query to fail.
 with the 'orderby' parameter removed, get_uploaded_header_images() works
 as intended and header images are shown properly.

 I've patched my install of wordpress successfully. A bugfix would be much
 appreciated.

 Thanks!

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24613>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list