WordPress.org

Make WordPress Core

Ticket #52196: 52196.2.patch

File 52196.2.patch, 1.0 KB (added by dilipbheda, 6 months ago)

Improve inline Doc.

  • src/wp-includes/post.php

    diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php
    index 947d0477e0..1ff118fa7e 100644
    a b function wp_delete_attachment_files( $post_id, $meta, $backup_sizes, $file ) { 
    60646064 *
    60656065 * @since 2.1.0
    60666066 *
    6067  * @param int  $attachment_id Attachment post ID. Defaults to global $post.
     6067 * @param int $attachment_id Attachment post ID. Default 0.
    60686068 * @param bool $unfiltered    Optional. If true, filters are not run. Default false.
    60696069 * @return array|false {
    60706070 *     Attachment metadata. False on failure.
    function wp_delete_attachment_files( $post_id, $meta, $backup_sizes, $file ) { 
    60806080function wp_get_attachment_metadata( $attachment_id = 0, $unfiltered = false ) {
    60816081        $attachment_id = (int) $attachment_id;
    60826082
     6083        if ( ! $attachment_id ) {
     6084                $post = get_post();
     6085
     6086                if ( ! $post ) {
     6087                        return false;
     6088                }
     6089
     6090                $attachment_id = $post->ID;
     6091        }
     6092
    60836093        $data = get_post_meta( $attachment_id, '_wp_attachment_metadata', true );
    60846094
    60856095        if ( ! $data ) {