Changeset 47913
- Timestamp:
- 06/05/2020 08:28:42 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/media.php
r47909 r47913 3684 3684 3685 3685 /** 3686 * Encapsulate logic for Attach/Detach actions3686 * Encapsulates the logic for Attach/Detach actions. 3687 3687 * 3688 3688 * @since 4.2.0 … … 3707 3707 $ids = array(); 3708 3708 3709 foreach ( (array) $_REQUEST['media'] as $att _id ) {3710 $att _id = (int) $att_id;3711 3712 if ( ! current_user_can( 'edit_post', $att _id ) ) {3709 foreach ( (array) $_REQUEST['media'] as $attachment_id ) { 3710 $attachment_id = (int) $attachment_id; 3711 3712 if ( ! current_user_can( 'edit_post', $attachment_id ) ) { 3713 3713 continue; 3714 3714 } 3715 3715 3716 $ids[] = $att _id;3716 $ids[] = $attachment_id; 3717 3717 } 3718 3718 … … 3728 3728 3729 3729 if ( isset( $result ) ) { 3730 foreach ( $ids as $att _id ) {3730 foreach ( $ids as $attachment_id ) { 3731 3731 /** 3732 * Fires when media is attached /detached from a post.3732 * Fires when media is attached or detached from a post. 3733 3733 * 3734 * @since 5.5 3734 * @since 5.5.0 3735 3735 * 3736 * @param string $action Attach/detach action.3737 * @param int $att _idThe attachment ID.3738 * @param int $parent_id Attachment parent ID.3736 * @param string $action Attach/detach action. Accepts 'attach' or 'detach'. 3737 * @param int $attachment_id The attachment ID. 3738 * @param int $parent_id Attachment parent ID. 3739 3739 */ 3740 do_action( 'wp_media_attach_action', $action, $att _id, $parent_id );3741 3742 clean_attachment_cache( $att _id );3740 do_action( 'wp_media_attach_action', $action, $attachment_id, $parent_id ); 3741 3742 clean_attachment_cache( $attachment_id ); 3743 3743 } 3744 3744 -
trunk/tests/phpunit/tests/rest-api/rest-controller.php
r47911 r47913 270 270 } 271 271 272 // ignored properties272 // Ignored properties. 273 273 $this->assertArrayNotHasKey( 'ignored_prop', $args['someobject'] ); 274 274 … … 276 276 277 277 /** 278 * @dataProvider data_get_fields_for_response ,278 * @dataProvider data_get_fields_for_response 279 279 */ 280 280 public function test_get_fields_for_response( $param, $expected ) {
Note: See TracChangeset
for help on using the changeset viewer.