WordPress.org

Make WordPress Core

Ticket #23255: 23255.1.diff

File 23255.1.diff, 749 bytes (added by ericlewis, 23 months ago)

Forgot to include the empty( $post ) check in 23255.diff

  • wp-includes/post-formats.php

     
    1111 * 
    1212 * @since 3.1.0 
    1313 * 
    14  * @param int|object $post A post 
     14 * @param int|object $post Post ID or post object. Optional, default is the current post from the loop. 
    1515 * 
    16  * @return mixed The format if successful. False if no format is set. WP_Error if errors. 
     16 * @return mixed The format if successful, false otherwise. 
    1717 */ 
    1818function get_post_format( $post = null ) { 
    1919        $post = get_post($post); 
    2020 
     21        if ( empty( $post ) ) 
     22                return false; 
     23 
    2124        if ( ! post_type_supports( $post->post_type, 'post-formats' ) ) 
    2225                return false; 
    2326