Implements weeks 1–4 of the CMO brand identity sprint. Key changes: - CSS token system (assets/css/brand.css): full palette, verdict tokens, component styles - Poppins/Inter/IBM Plex Mono Google Fonts loading with preload - Full favicon/PWA/OG asset pack (peptide-repo-brand v1.0.0) - 5-state verdict badge + card + evidence row components - verdict_state + signal_row post meta on pr_peptide CPT - Homepage hero: teal bg, new H1/subhead, lime search bar - Archive verdict filter chips (CSS + pre_get_posts query hook) - Affiliate disclosure component (3 contexts) - page-how-we-review.php + page-about.php templates - Footer Our Method links - a11y: skip-to-content, reduced-motion, aria on verdict badges QA: PASS (0 blockers) — qa-reviews/peptide-starter-theme/2026-04-26-a2bff59.md Staging verified: https://staging.peptiderepo.com
53 lines
2.0 KiB
PHP
53 lines
2.0 KiB
PHP
<?php
|
|
/**
|
|
* Affiliate Disclosure Component
|
|
*
|
|
* Displays FTC-compliant disclosure about affiliate commissions.
|
|
* Three contexts: inline (default), banner, footer.
|
|
* Accepts $args['context'].
|
|
*
|
|
* @package peptide-starter
|
|
*/
|
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
|
exit;
|
|
}
|
|
|
|
$context = isset( $args['context'] ) ? sanitize_text_field( $args['context'] ) : 'inline';
|
|
|
|
// Copy variants (verbatim per CMO spec).
|
|
$inline_copy = 'If you buy through this link, the seller pays Peptide Repo a commission. We don\'t pay to feature any peptide, and our verdicts don\'t change based on who pays.';
|
|
|
|
$banner_copy = 'Peptide Repo earns a commission when readers buy through links to our fulfillment partners. We are funded by those commissions, not by the peptide brands themselves. No peptide on this site appears here because someone paid us. Our verdicts are decided before we negotiate any partnership, and we drop partners whose product or process degrades.';
|
|
|
|
$footer_copy = 'Peptide Repo earns a commission on some links. <a href="' . esc_url( home_url( '/about/' ) ) . '#disclosures">' . esc_html__( 'How we work', 'peptide-starter' ) . ' →</a>';
|
|
|
|
switch ( $context ) {
|
|
case 'banner':
|
|
?>
|
|
<aside class="pr-disclosure pr-disclosure--banner" aria-label="<?php esc_attr_e( 'Affiliate disclosure', 'peptide-starter' ); ?>">
|
|
<span class="pr-disclosure__label"><?php esc_html_e( 'A note on commerce.', 'peptide-starter' ); ?></span>
|
|
<?php echo wp_kses_post( $banner_copy ); ?>
|
|
</aside>
|
|
<?php
|
|
break;
|
|
|
|
case 'footer':
|
|
?>
|
|
<p class="pr-disclosure pr-disclosure--footer">
|
|
<?php echo wp_kses_post( $footer_copy ); ?>
|
|
</p>
|
|
<?php
|
|
break;
|
|
|
|
case 'inline':
|
|
default:
|
|
?>
|
|
<aside class="pr-disclosure pr-disclosure--inline" aria-label="<?php esc_attr_e( 'Affiliate disclosure', 'peptide-starter' ); ?>">
|
|
<span class="pr-disclosure__label"><?php esc_html_e( 'How we make money:', 'peptide-starter' ); ?></span>
|
|
<?php echo wp_kses_post( $inline_copy ); ?>
|
|
</aside>
|
|
<?php
|
|
break;
|
|
}
|