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

[gatsby-source-wordpress] Refactored featured_media map for deep nodes #2648

Merged
merged 4 commits into from
Oct 27, 2017

Conversation

sebastienfi
Copy link
Contributor

@sebastienfi sebastienfi commented Oct 27, 2017

  • Featured medias could be nested at any level
  • The most certain way to have photos works with this version on the plugin is to either name the field featured_media or include the image as Post Object.
  • Fixed bug where in some case the old featured_media field was not deleted.

Tested with using-wordpress OK.

* Featured medias coul be nested at any level
* The most certain way to have photos works with this version on the plugin is to either name the fiel featured_media or include the image as Post Object.
* Fixed bug where in some case the old featured_media field was not deleted.
@gatsbybot
Copy link
Collaborator

gatsbybot commented Oct 27, 2017

Deploy preview ready!

Built with commit e286a25

https://deploy-preview-2648--gatsbygram.netlify.com

@sebastienfi sebastienfi changed the title Refactored featured_media map for deep nodes [gatsby-source-wordpress] Refactored featured_media map for deep nodes Oct 27, 2017
@sebastienfi
Copy link
Contributor Author

Funny enough pieh has been working on something similar with this PR #2646

I believe my PR is more generic as it allows for featured_medias to be placed anywhere in the JSON tree, let's say for example, in a linked Post Object.

@KyleAMathews
Copy link
Contributor

haha, brilliant minds…

I'll let you make the call on which one to merge.

@pieh
Copy link
Contributor

pieh commented Oct 27, 2017

It's nobrainer that You should take Your code, as most likely You will maintain it ;) Just check my comment #2646 (comment) and I think You can close my PR and focus on this one.

* Most of the credits goes to @pieh for a better solution that solved the same problems and widely improved code simplicity. #2646
* Made the Media lookup begin at JSON tree root instead of keeping this for ACF Field only. Changed constants names accordingly.
* Making thise more generic allorws Custom Post Types to benefit from this improvements and yet unseen objects shapes. 
* Incorporated fix on bug mentionned here #2646 (comment)
* May solve this #2587, this #2492, this #2328
@sebastienfi
Copy link
Contributor Author

sebastienfi commented Oct 27, 2017

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

Successfully merging this pull request may close these issues.

4 participants