Make WordPress Core

Ticket #49614: 49614.2.diff

File 49614.2.diff, 971 bytes (added by donmhico, 5 years ago)

Add param docs.

  • src/wp-admin/includes/media.php

    diff --git src/wp-admin/includes/media.php src/wp-admin/includes/media.php
    index c50666f6eb..8a23c6dc63 100644
    function wp_media_attach_action( $parent_id, $action = 'attach' ) { 
    37223722                } else {
    37233723                        $result = $wpdb->query( "UPDATE $wpdb->posts SET post_parent = 0 WHERE post_type = 'attachment' AND ID IN ( $ids_string )" );
    37243724                }
     3725        }
    37253726
     3727        if ( isset( $result ) ) {
    37263728                foreach ( $ids as $att_id ) {
     3729                        /**
     3730                         * Fires when media is attached/detached from a post.
     3731                         *
     3732                         * @since 5.5
     3733                         *
     3734                         * @param string $action    Attach/detach action.
     3735                         * @param int    $att_id    The attachment ID.
     3736                         * @param int    $parent_id Attachment parent ID.
     3737                         */
     3738                        do_action( 'wp_media_attach_action', $action, $att_id, $parent_id );
     3739
    37273740                        clean_attachment_cache( $att_id );
    37283741                }
    3729         }
    37303742
    3731         if ( isset( $result ) ) {
    37323743                $location = 'upload.php';
    37333744                $referer  = wp_get_referer();
    37343745