WordPress.org

Make WordPress Core

Ticket #37813: 37813.patch

File 37813.patch, 1.2 KB (added by grapplerulrich, 4 years ago)
  • src/wp-includes/post.php

    diff --git src/wp-includes/post.php src/wp-includes/post.php
    index a93fc25..905a99a 100644
    function is_local_attachment($url) { 
    46944694 * setting the value for the 'comment_status' key.
    46954695 *
    46964696 * @since 2.0.0
    4697  * @since 4.7.0 Add fourth paramater `$wp_error` to allow  return of WP_Error on failure.
    46984697 *
    46994698 * @see wp_insert_post()
    47004699 *
    47014700 * @param string|array $args   Arguments for inserting an attachment.
    47024701 * @param string       $file   Optional. Filename.
    47034702 * @param int          $parent Optional. Parent post ID.
    4704  * @param bool  $wp_error Optional. Whether to allow return of WP_Error on failure. Default false.
    4705  * @return int|WP_Error The attachment ID on success. The value 0 or WP_Error on failure.
     4703 * @return int Attachment ID.
    47064704 */
    4707 function wp_insert_attachment( $args, $file = false, $parent = 0, $wp_error = false ) {
     4705function wp_insert_attachment( $args, $file = false, $parent = 0 ) {
    47084706        $defaults = array(
    47094707                'file'        => $file,
    47104708                'post_parent' => 0
    function wp_insert_attachment( $args, $file = false, $parent = 0, $wp_error = fa 
    47184716
    47194717        $data['post_type'] = 'attachment';
    47204718
    4721         return wp_insert_post( $data, $wp_error );
     4719        return wp_insert_post( $data );
    47224720}
    47234721
    47244722/**