Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#24403 closed enhancement (worksforme)

Bug - uploadedTo argument for wp.media

Reported by: jamesmehorter Owned by:
Priority: normal Milestone:
Component: Media Version: 3.5.1
Severity: normal Keywords: close
Cc: Focuses: multisite

Description

Adding a 'uploadedTo' value for wp.media causes files uploaded in the current frame to not display in the library frame, see attached screenshot. It appears the 'library' state is not updating. The screenshot was taken immediately after dropping an image onto the frame to be uploaded.

Expectation: After dropping a new upload onto the frame, you should see the uploaded file with the currently uploaded files and it should automatically be selected (the exact behavior that is shown without the 'uploadedTo' argument)

Code to reproduce:

<script>
	(function($){
		my_frame = wp.media({
			title: 'Select Your Images',
			button: {
				text: 'Choose'
			},
			multiple: true,
			library: {
				type: 'image',
				uploadedTo: some_post_id  //Only display attachments for current post in the 'Library' state
			}
		});

		my_frame.open();
	})(jQuery);
</script>

Attachments (1)

wp.media frame library state not updating.png​ (119.9 KB ) - added by jamesmehorter 13 years ago.
This is the view seen immediately after uploading an image by dropping it onto the frame

Download all attachments as: .zip

Change History (5)

@jamesmehorter
13 years ago

This is the view seen immediately after uploading an image by dropping it onto the frame

#1 @nacin
13 years ago

  • Cc koopersmith added

#3 @ericlewis
12 years ago

  • Focuses multisite added
  • Keywords close added
  • Type defect (bug) → enhancement

Related to #26587 (wp.media library argument post_ _not_in breaks the uploads), see comment 2.

This isn't the proper way to interact with the API for this purpose.

#4 @wonderboymusic
12 years ago

  • Milestone Awaiting Review
  • Resolution → worksforme
  • Status new → closed

This works now. There has been so much churn in the past year and a half, I am not sure what the exact fix was.

Note: See TracTickets for help on using tickets.