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

Scan files of parent theme if a child theme is active (#1) #62

Merged
merged 4 commits into from
Apr 21, 2020

Conversation

stklcode
Copy link
Contributor

@stklcode stklcode commented Oct 4, 2019

The title tells the whole story. (resolves #1)

I've added a trivial recursion while $theme->parent() provides a valid theme in the _get_current_theme() method. false is only returned if the current theme and the parent theme is empty (probably never happens), but empty child themes (i.e. only CSS changes) are likely to be found in the wild.

Later in the _get_theme_files() phase the file arrays are flattened.

@stklcode stklcode added this to the 1.4.0 milestone Apr 13, 2020
@krafit krafit requested a review from bueltge April 18, 2020 06:44
@bueltge
Copy link
Member

bueltge commented Apr 18, 2020

Hello @stklcode thanks for this enhancement. I leave two comments, maybe you will validate them and get me feedback.

PS. I hope it works, I'm on mobile with a app and I need to learn on this view.

@stklcode
Copy link
Contributor Author

Thanks for the review @bueltge (comments are fine). I've added one change and one comment.

Match commonly used translations for parent/child themes of WP core.
* eliminate default parameter value and call explicitly current theme
* trigger recursion unconditionally with break in the very first line
@stklcode
Copy link
Contributor Author

Discussion is kind of stuck, so I refactored the recursion completely to get rid of at least one point.

@krafit
Copy link
Member

krafit commented Apr 21, 2020

Thank you both ❤️

@krafit krafit merged commit 27dbcfc into master Apr 21, 2020
@stklcode stklcode deleted the feature/1-scan-parent-theme branch July 5, 2020 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scan parent theme too if active theme is a child theme
3 participants