{"id":5075161,"date":"2014-07-07T15:33:51","date_gmt":"2014-07-07T15:33:51","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/inserted-in-and-parent-id\/"},"modified":"2016-08-21T23:02:44","modified_gmt":"2016-08-21T23:02:44","slug":"inserted-in-and-parent-id","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/inserted-in-and-parent-id\/","title":{"rendered":"&#039;Inserted In&#039; and &#039;Parent ID&#039;"},"content":{"rendered":"<p>Hi David<\/p>\n<p>I hope you can point me in the right direction with a problem I have. My site uses bbpress and I allow the subscriber role to have media upload permissions for forum posts. I seem to have all that working, but have an issue with the Parent ID of an attachment when it is uploaded into a <strong>new topic<\/strong>.<br \/>\nThe Parent ID is set to the page where the topic editor form is, rather than being set to the topic&#8217;s ID. I suppose this is to be expected as the topic doesn&#8217;t exist when the media uploads into the editor.<br \/>\nAfterwards, I notice on my MLA page in admin, that the topic ID is available for these uploads in the &#8216;inserted in&#8217; column.<\/p>\n<p>Can I retrieve this information to form a link within the MLA gallery shortcode? I use the MLA gallery shortcode on members pages to display all of their uploaded pictures. I&#8217;d like to link the images to the parent ID to view them in context of where they were uploaded to.<\/p>\n<p>I &#8216;do_shortcode&#8217; in my php:<br \/>\n<code>[mla_gallery author=&#039;.$user_id.&#039;  mla_caption=&quot;Posted in: &lt;a href={+site_url+}\/?p={+parent+}\\&gt;{+parent_title+}&lt;\/a&gt;&quot; mla_rollover_text=&quot;Image name - {+name_only+}&quot; link=&quot;file&quot; size=&quot;medium&quot;]<\/code><\/p>\n<p>What I&#8217;d like to achieve:<br \/>\nIdeally &#8211; to replace the parent ID with the topic ID of any attachments once the topic is submitted.<br \/>\nAlternatively &#8211; to link to &#8216;inserted in&#8217; rather than &#8216;parent post&#8217; in my gallery shortcode.<\/p>\n<p>Thank you for your exemplary support!<br \/>\nNeil<\/p>\n<p>https:\/\/wordpress.org\/plugins\/media-library-assistant\/<\/p>\n","protected":false},"template":"","class_list":["post-5075161","topic","type-topic","status-closed","hentry","topic-tag-mla"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5075161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/5075161\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=5075161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}