One-shot mu-plugin patches the Footer template (#46) : - Column sub-titles (Solutions / Company / Legal / Contact) now use the eyebrow style : gold, uppercase, 0.75rem, 0.1em letter-spacing — matches the section-eyebrows used across content pages. - Brand heading (ASTERION VR) downsized to 1.125rem so it stops dominating the row; tagline muted to text-tertiary 0.875rem. - Columns wrapper set to align-items: flex-start with consistent 3rem gap → all sub-titles sit at the same vertical baseline. - Each column container tightened to 0.5rem rowGap (less air between heading and links). Patches both content_2 (JSON, source) and footer_2 (serialized, mirrored by the REST bridge). Idempotent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
102 lines
4.1 KiB
PHP
102 lines
4.1 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Asterion — Align + style footer column sub-titles
|
|
* /?av_fix_footer_headings=1
|
|
*
|
|
* Standardizes the 4 footer column headings (Solutions / Company / Legal /
|
|
* Contact) with eyebrow-style typography : gold, uppercase, letter-spacing,
|
|
* consistent size. Tightens the brand heading. Aligns columns to flex-start
|
|
* so sub-titles sit at the same vertical baseline.
|
|
*
|
|
* Idempotent — re-runs are safe.
|
|
*/
|
|
defined('ABSPATH') || exit;
|
|
|
|
add_action('template_redirect', function () {
|
|
if (! in_array($_SERVER['SERVER_NAME'] ?? '', ['localhost', '127.0.0.1'], true)) return;
|
|
if (empty($_GET['av_fix_footer_headings'])) return;
|
|
|
|
header('Content-Type: text/plain; charset=utf-8');
|
|
global $wpdb;
|
|
|
|
$eyebrow_typography = [
|
|
'color' => ['raw' => 'var(--color-brand-gold)'],
|
|
'font-size' => '0.75rem',
|
|
'font-weight' => '600',
|
|
'letter-spacing' => '0.1em',
|
|
'text-transform' => 'uppercase',
|
|
'line-height' => '1.4',
|
|
];
|
|
|
|
foreach (['_bricks_page_content_2', '_bricks_page_footer_2'] as $key) {
|
|
$val = $wpdb->get_var($wpdb->prepare(
|
|
"SELECT meta_value FROM {$wpdb->postmeta} WHERE post_id=%d AND meta_key=%s LIMIT 1",
|
|
46, $key
|
|
));
|
|
if (! is_string($val) || $val === '') continue;
|
|
$is_json = ($val[0] === '[');
|
|
$elements = $is_json ? json_decode($val, true) : @unserialize($val);
|
|
if (! is_array($elements)) continue;
|
|
|
|
$changed = 0;
|
|
foreach ($elements as $i => $el) {
|
|
$id = $el['id'] ?? '';
|
|
|
|
// 1. Footer column sub-titles : eyebrow style
|
|
if (in_array($id, ['ftrh2', 'ftrh3', 'ftrh4', 'ftrh5'], true)) {
|
|
$elements[$i]['settings']['_typography'] = $eyebrow_typography;
|
|
$elements[$i]['settings']['_margin'] = ['top' => '0', 'right' => '0', 'bottom' => '0.5rem', 'left' => '0'];
|
|
$changed++;
|
|
}
|
|
|
|
// 2. Brand heading (ASTERION VR) — smaller so it doesn't dominate
|
|
if ($id === 'ftrbrnd') {
|
|
$elements[$i]['settings']['_typography'] = [
|
|
'color' => ['raw' => 'var(--color-text-on-dark)'],
|
|
'font-size' => '1.125rem',
|
|
'font-weight' => '600',
|
|
'letter-spacing' => '0.08em',
|
|
'line-height' => '1.4',
|
|
];
|
|
$elements[$i]['settings']['_margin'] = ['top' => '0', 'right' => '0', 'bottom' => '0.5rem', 'left' => '0'];
|
|
$changed++;
|
|
}
|
|
|
|
// 3. Brand tagline : muted, smaller
|
|
if ($id === 'ftrtagln') {
|
|
$elements[$i]['settings']['_typography'] = [
|
|
'color' => ['raw' => 'var(--color-text-tertiary)'],
|
|
'font-size' => '0.875rem',
|
|
'line-height' => '1.55',
|
|
];
|
|
$changed++;
|
|
}
|
|
|
|
// 4. Columns wrapper : align children to flex-start so column tops match
|
|
if ($id === 'ftrcols') {
|
|
$elements[$i]['settings']['_alignItems'] = 'flex-start';
|
|
$elements[$i]['settings']['_columnGap'] = '3rem';
|
|
$elements[$i]['settings']['_rowGap'] = '2.5rem';
|
|
$changed++;
|
|
}
|
|
|
|
// 5. Each column container : tight row gap between heading and content
|
|
if (in_array($id, ['ftrcol1', 'ftrcol2', 'ftrcol3', 'ftrcol4', 'ftrcol5'], true)) {
|
|
$elements[$i]['settings']['_rowGap'] = '0.5rem';
|
|
$changed++;
|
|
}
|
|
}
|
|
|
|
if ($changed > 0) {
|
|
$new = $is_json ? wp_json_encode($elements) : maybe_serialize($elements);
|
|
$wpdb->update($wpdb->postmeta, ['meta_value' => $new],
|
|
['post_id' => 46, 'meta_key' => $key], ['%s'], ['%d', '%s']);
|
|
wp_cache_delete(46, 'post_meta');
|
|
echo " $key : $changed element(s) patched\n";
|
|
}
|
|
}
|
|
|
|
echo "\nDONE. Reload any page → footer sub-titles now eyebrow-styled and aligned.\n";
|
|
exit;
|
|
});
|