| @@ -248,9 +248,11 @@ | ||
| 248 | 248 | $version |
| 249 | 249 | ); |
| 250 | 250 | |
| 251 | 251 | wp_localize_script( 'bp-campaign-list', 'betterPaymentCampaignData', [ |
| 252 | - 'templates' => array_values( TemplateManager::get_all() ), | |
| 252 | + // Picker-facing — retired designs are filtered out here, never in | |
| 253 | + // get_all(), which the renderer reads on every campaign pageview. | |
| 254 | + 'templates' => array_values( TemplateManager::get_for_picker() ), | |
| 253 | 255 | 'categories' => CategoryRegistry::for_client(), |
| 254 | 256 | 'restUrl' => rest_url( 'better-payment/v1/' ), |
| 255 | 257 | 'nonce' => wp_create_nonce( 'wp_rest' ), |
| 256 | 258 | 'adminUrl' => admin_url(), |
| @@ -328,8 +330,13 @@ | ||
| 328 | 330 | self::asset_version( $display_css ) |
| 329 | 331 | ); |
| 330 | 332 | } |
| 331 | 333 | |
| 334 | + // Template theme CSS for the preview modal: fires | |
| 335 | + // `better_payment/campaign/enqueue_styles` ('builder'), where Pro loads its | |
| 336 | + // themes. A free install loads no Pro design here. See CampaignStyles. | |
| 337 | + CampaignStyles::enqueue_theme_styles( 'builder' ); | |
| 338 | + | |
| 332 | 339 | wp_enqueue_media(); |
| 333 | 340 | |
| 334 | 341 | // Zero out all WP admin chrome spacing so the builder fills edge-to-edge. |
| 335 | 342 | // The footer styling mirrors the Better Payment admin footer (see |
| @@ -368,9 +375,17 @@ | ||
| 368 | 375 | } |
| 369 | 376 | |
| 370 | 377 | $data = [ |
| 371 | 378 | 'elements' => array_values( ElementRegistry::get_all() ), |
| 372 | - 'templates' => array_values( TemplateManager::get_all() ), | |
| 379 | + // Picker-facing — retired designs are filtered out here, never in | |
| 380 | + // get_all(), which the renderer reads on every campaign pageview. | |
| 381 | + 'templates' => array_values( TemplateManager::get_for_picker() ), | |
| 382 | + // `template key => theme_class`, over the WHOLE registry rather than | |
| 383 | + // the picker: a campaign on a retired design still renders under its | |
| 384 | + // theme class, and the Advanced tab's Background control reads this | |
| 385 | + // to resolve what that theme actually paints (utils/themeBackground.js). | |
| 386 | + // Keyed, not a list — the builder looks a single key up. | |
| 387 | + 'templateThemes' => TemplateManager::theme_classes(), | |
| 373 | 388 | // The category taxonomy, shared by the template picker's sidebar and |
| 374 | 389 | // the AI wizard's "What are you raising funds for?" tiles. Both used |
| 375 | 390 | // to hardcode their own list and drifted apart; this is the one list. |
| 376 | 391 | 'categories' => CategoryRegistry::for_client(), |