Make WordPress Core

Ticket #28135: 28135.ew_holmes.patch

File 28135.ew_holmes.patch, 744 bytes (added by ew_holmes, 11 years ago)

Checking for post type before trying to create a post.

  • post.php

    # This patch file was generated by NetBeans IDE
    # Following Index: paths are relative to: /Applications/MAMP/htdocs/wordpress_develop/src/wp-includes
    # This patch can be applied using context Tools: Patch action on respective folder.
    # It uses platform neutral UTF-8 encoding and \n newlines.
    # Above lines and this line are ignored by the patching process.
     
    29312931
    29322932        $postarr = wp_parse_args($postarr, $defaults);
    29332933
     2934        if( ! post_type_exists( $postarr['post_type'] ) ) {
     2935                return new WP_Error( 'invalid_post_type', __( 'Post type does not exist.' ) );
     2936        }
     2937       
    29342938        unset( $postarr[ 'filter' ] );
    29352939
    29362940        $postarr = sanitize_post($postarr, 'db');