-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: distribute media items by themselves #775
Comments
@dkoo Thanks for the request and all the helpful context. I played around with this myself today to see if existing hooks could get us close to where we would need to be. The short answer is probably but the longer answer follows. As you mention, we explicitly remove We also only support items that have a post status of This does give us the normal Push UI on attachments (when going to the attachment edit screen). For an internal connection, you are able to successfully push the attachment post type but the actual attachment media is not sent along. For external connections, you end up with the error you mention and nothing is pushed. To fix the issue for an internal connection, you would need to hook into For an external connection, this is where it gets trickier. We distribute content to external connections via the proper post type REST API endpoint which in this case is the media endpoint. This endpoint expects you to send across a file object in order to create a media item. This would almost certainly require hooking into All that said, here's a few different approaches we could take:
I really like the idea of getting to the point where Distributor would work for a use-case as described but kind of a toss up in my mind on whether this is worth building as a feature straight into Distributor itself or if it should be maintained as a separate extension. |
Related to #771. |
If you are changing the way media is handled by Distributor. You should also take into account #765, by making sure media is not duplicated anymore. |
Is your enhancement related to a problem? Please describe.
Currently, media attachments are only distributed when they're attached to another post type that's being pushed or pulled. They can't be pushed or pulled by themselves.
Describe the solution you'd like
Ideally, we should be able to push and pull media items like any other post types, either by pushing from the media item's edit page, or by pulling from the "Pull Content" screen. Distributed media items should download the image to the destination site and pull in any caption/credit content and metadata associated with the source item. Distributed media items that remain linked to the source item should sync changes from the source like other post types.
Even better, it would be great to have a bulk push action available in the Media Library screen, where you can select multiple attachments using the existing "Bulk select" feature and push them all to the same site(s).
Currently, it's possible to show the Distributor "push" menu item on media item edit pages by filtering both
distributable_post_types
(to addattachment
) anddt_distributable_post_statuses
(to addinherit
), but attempting to push this way results in an error response:Designs
At minimum, no new UI would be required. For the "bulk push" feature, new UI would be required in the Media Library screen when more than one item is selected.
Describe alternatives you've considered
I thought about the idea of creating a private "exporter" page and adding media items I want to push to the page content, then adding
private
to the allowed statuses via thedt_distributable_post_statuses
filter, then turning on the "Process the featured image and any attached images" option in plugin settings.However, when pushing the private post, the post gets pushed to remote site, but the media items in the post's content don't get pushed as I would expect based on the plugin setting.
Additional context
Being able to distribute media items by themselves would allow Distributor to be used as a sort of basic DAM alternative, where the main site can distribute images along with caption/credit data to other sites and automatically sync any changes to the remote sites.
The text was updated successfully, but these errors were encountered: