Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Rely on parent theme data for block style #712

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

felixarntz
Copy link
Member

See WordPress/wordpress-develop#5593 (comment):

the version always comes from TT4, while the actual button-outline.css file may be loaded from a TT4 child theme. If we want to force that file to always be that of TT4 (which I'd argue is probably the safer call), we should replace the two get_theme_file_*() function calls with their equivalent get_parent_theme_file_*() calls. That way this functionality is consistent and will always rely on the styles from TT4, ignoring any child theme. I'd argue that makes sense here because the block styles registered below can't be overwritten by a child theme either.

This PR addresses the logic so that it always relies on the parent theme data (which will always be TT4, since it cannot be used as a child theme). It's mostly a consistency fix, which ensures we don't accidentally allow child themes to override this while then still relying on the parent theme version for it.

Given the other block styles below can't be overwritten by the child theme, I think allowing that here was mostly by accident.

Copy link
Member

@luminuu luminuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Leaving open for @MaggieCabrera to add to the RC3 PR tomorrow.

Copy link
Collaborator

@huzaifaalmesbah huzaifaalmesbah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Catch.

@MaggieCabrera MaggieCabrera merged commit 5e8a960 into trunk Oct 31, 2023
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants