'Inserted In' and 'Parent ID'
-
Hi David
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 new topic.
The Parent ID is set to the page where the topic editor form is, rather than being set to the topic’s ID. I suppose this is to be expected as the topic doesn’t exist when the media uploads into the editor.
Afterwards, I notice on my MLA page in admin, that the topic ID is available for these uploads in the ‘inserted in’ column.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’d like to link the images to the parent ID to view them in context of where they were uploaded to.
I ‘do_shortcode’ in my php:
[mla_gallery author='.$user_id.' mla_caption="Posted in: <a href={+site_url+}/?p={+parent+}\>{+parent_title+}</a>" mla_rollover_text="Image name - {+name_only+}" link="file" size="medium"]
What I’d like to achieve:
Ideally – to replace the parent ID with the topic ID of any attachments once the topic is submitted.
Alternatively – to link to ‘inserted in’ rather than ‘parent post’ in my gallery shortcode.Thank you for your exemplary support!
Neil
- The topic ‘'Inserted In' and 'Parent ID'’ is closed to new replies.