Refactor UPE Appearance transients constants #8801
Labels
focus: checkout payments
type: technical debt
This issue/PR represents/solves the technical debt of the project.
Description
WooPayments now has several transients related to UPE themes and styles. While working on #8249, I created a general
APPEARANCE_THEME_TRANSIENTS
constant on theWC_Payment_Gateway_WCPay
class to be able to access these transients’ names (from outside the class) without having to remember each individual constant (or transient) name. It resulted in being able to access the theme for a specific location and context in a readable way like this:I think we should refactor our usage of the appearance and theme transients to follow a similar format and update how we’re accessing these transient names throughout the plugin.
Acceptance criteria
Dev notes
Here’s the first idea I had on structure:
That would give an access structure like
$transients[ $location ][ $context ][ $type ]
though I’m open to other ideas as well.The text was updated successfully, but these errors were encountered: