| @@ -27,10 +27,31 @@ | ||
| 27 | 27 | $wrapper = '.charitable-campaign-wrap.template-' . $charitable_slug; |
| 28 | 28 | $hero_row_class = 'beacon-hero-row'; |
| 29 | 29 | $body_row_class = 'beacon-body-row'; |
| 30 | 30 | |
| 31 | -require_once '../../admin/campaign-builder/templates/functions-campaign-templates.php'; | |
| 31 | +require_once dirname( __DIR__, 2 ) . '/admin/campaign-builder/templates/functions-campaign-templates.php'; | |
| 32 | 32 | |
| 33 | +?> | |
| 34 | + | |
| 35 | +<?php | |
| 36 | +/* | |
| 37 | + * Headline colour. Emitted ONLY when the campaign actually configured a primary | |
| 38 | + * colour (the endpoint omits 'p' otherwise), so a campaign that customised nothing | |
| 39 | + * falls back to the historic #000 in base.css and renders byte-identical. The hex | |
| 40 | + * guard stops a malformed 'p' from emitting an invalid token, which would make the | |
| 41 | + * headline inherit the theme's colour instead of falling back. | |
| 42 | + * | |
| 43 | + * Emitted at the top of the stylesheet rather than appended at the end, because | |
| 44 | + * save-the-museum.php has an unclosed rule near its end that would otherwise nest | |
| 45 | + * this declaration inside it. | |
| 46 | + */ | |
| 47 | +if ( isset( $_GET['p'] ) && preg_match( '/^#[A-Fa-f0-9]{3,6}$/', $primary ) ) : // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 48 | + ?> | |
| 49 | +<?php echo $wrapper; // phpcs:ignore ?> { | |
| 50 | + --charitable_campaign_theme_headline: <?php echo $primary; // phpcs:ignore ?>; | |
| 51 | +} | |
| 52 | + <?php | |
| 53 | +endif; | |
| 33 | 54 | ?> |
| 34 | 55 | |
| 35 | 56 | :root { |
| 36 | 57 | --charitable_campaign_theme_primary: <?php echo $primary; // phpcs:ignore ?>; |