Skip to content

Instantly share code, notes, and snippets.

@MjHead
Created February 20, 2020 14:01
Show Gist options
  • Save MjHead/525db5dd35d3076a74c79cae6ff89086 to your computer and use it in GitHub Desktop.
Save MjHead/525db5dd35d3076a74c79cae6ff89086 to your computer and use it in GitHub Desktop.
Get attachment link by attachment ID callback for JetEngine
@pierrehansen
Copy link

Fantastic! Thanks VERY much!

@pierrehansen
Copy link

pierrehansen commented Mar 5, 2020

One more question: What if I want to show the title of the custom post type and then add to that the link of the media from the media field? So combining two different sources. (The pdf files do have long names which I don't want to show in a listing)

What I don't understand: If I choose "title" as source I still can choose "Get attachment file link by ID" in the callback field, but then the title goes empty. Why is that? Even if the callback isn't valid the title should still show, does it? Same goes if I choose "Embed URL" as callback: title field goes empty. Maybe I don't quite understand what a callback technically is....

Thanks a lot!

@pierrehansen
Copy link

pierrehansen commented Mar 5, 2020

Would be great if the "Dynamic Link" widget would give us the possibility to fetch the URL of the media field. If we now choose the media field as source the ID is being outputted. By using the "Dynamic Link" widget even the added icon would be wrapped into the link which would be great!
https://prnt.sc/rbxlng

@vinnyCalixto
Copy link

Good morning, is this function able to fetch all the files of the post or just one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment