Make WordPress Core

Ticket #30013: 30013.2.diff

File 30013.2.diff, 448 bytes (added by Kloon, 7 years ago)

Do check in get_post_type_object() instead of $typenow as per Nacin's feedback

  • wp-includes/post.php

     
    11481148function get_post_type_object( $post_type ) {
    11491149        global $wp_post_types;
    11501150
    1151         if ( empty($wp_post_types[$post_type]) )
     1151        if ( ! is_scalar( $post_type ) || empty( $wp_post_types[ $post_type ] ) )
    11521152                return null;
    11531153
    11541154        return $wp_post_types[$post_type];