Skip to content
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

Support for [gallery] shortcodes with no specific IDs #68

Closed
leewillis77 opened this issue Oct 12, 2024 · 3 comments
Closed

Support for [gallery] shortcodes with no specific IDs #68

leewillis77 opened this issue Oct 12, 2024 · 3 comments

Comments

@leewillis77
Copy link

Following on from #64 I wanted to provide a sample export file, and demonstration of how that should be handled. A gallery shortcode with no files will create a gallery of all attached media.

See the sample export XML:
https://www.dropbox.com/scl/fi/4d9egeagaqaeq3r3c6mb5/leewillis.WordPress.2024-10-12.xml?rlkey=hmpubv4gxlgpehsyeva0n1t4w&dl=1

Here's the real WordPress page that generated it showing the gallery:
https://www.leewillis.co.uk/product-options-for-wp-e-commerce/

@ashishb
Copy link
Owner

ashishb commented Nov 18, 2024

Thanks @leewillis77 do you know how are images like https://www.leewillis.co.uk/wp-content/uploads/2011/08/screenshot-1.png linked to https://www.leewillis.co.uk/product-options-for-wp-e-commerce/?

I can see attachments like https://www.leewillis.co.uk/wp-content/uploads/2011/08/screenshot-1.png in your XML
I can see pages like https://www.leewillis.co.uk/product-options-for-wp-e-commerce/
However, it is not obvious to me how are they linked to each other in the WordPress XML.
I need that linkage to create a list of IDs for generating the correct gallery code in this case.

@leewillis77
Copy link
Author

@ashishb The post_parent of the attachment is the ID of the page:

Screenshot 2024-11-18 at 07 17 20
Screenshot 2024-11-18 at 07 18 21

ashishb added a commit that referenced this issue Nov 24, 2024
ashishb added a commit that referenced this issue Nov 24, 2024
In WordPress, a gallery shortcode with no files will create a gallery of all attached media.
This commit mimics that behavior.

Ref: #68
@ashishb
Copy link
Owner

ashishb commented Nov 24, 2024

Thanks @leewillis77 for pointing that out.
This feature has been added in 6b550e8

@ashishb ashishb closed this as completed Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants