-
Notifications
You must be signed in to change notification settings - Fork 23
Footer customizer updates rb #247
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
base: memberlite-footer-variations
Are you sure you want to change the base?
Changes from all commits
f8cf908
884d039
542a1a0
0087f7d
85ac9ea
c198d45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,15 +7,86 @@ | |||||||||||||||||||||
| * @since 7.0 | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| /* | ||||||||||||||||||||||
| * Checks location-specific theme_mods first (single post, page, archives), | ||||||||||||||||||||||
| * then falls back to the global default footer setting. | ||||||||||||||||||||||
| * | ||||||||||||||||||||||
| * @since TBD | ||||||||||||||||||||||
| * | ||||||||||||||||||||||
| * @return string post_name of the memberlite_footer post, or '0' if none is set. | ||||||||||||||||||||||
| */ | ||||||||||||||||||||||
| function memberlite_get_current_footer_post_name() { | ||||||||||||||||||||||
| // Per-page override takes priority over all Customizer settings. | ||||||||||||||||||||||
| if ( is_singular() ) { | ||||||||||||||||||||||
| $override = get_post_meta( get_the_ID(), '_memberlite_footer_override', true ); | ||||||||||||||||||||||
| if ( '' !== $override ) { | ||||||||||||||||||||||
| return $override; | ||||||||||||||||||||||
|
Comment on lines
+22
to
+23
|
||||||||||||||||||||||
| if ( '' !== $override ) { | |
| return $override; | |
| if ( '' !== $override ) { | |
| $override_slug = sanitize_title( $override ); | |
| $footer_variations = get_footer_variations(); | |
| if ( isset( $footer_variations[ $override_slug ] ) ) { | |
| return $override_slug; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$footer_post_nameis taken from theme mods/meta and later used for the footer CPT lookup. Sanitize/normalize it once up-front (e.g.,sanitize_key()/sanitize_title()) and treat invalid/empty values as “legacy footer”, instead of passing the raw value through.