| 1 |
<?php |
| 2 |
|
| 3 |
namespace Better_Payment\Lite\Campaign\Templates; |
| 4 |
|
| 5 |
if ( ! defined( 'ABSPATH' ) ) { |
| 6 |
exit; |
| 7 |
} |
| 8 |
|
| 9 |
/** |
| 10 |
* Manages campaign layout templates shown in the template selection modal. |
| 11 |
* |
| 12 |
* Templates define the initial page-level column layout that the builder starts |
| 13 |
* with. Each template specifies a layout type (1-column, 2-column, 3-column) |
| 14 |
* and pre-places elements into columns. |
| 15 |
* |
| 16 |
* To register a custom template from another plugin: |
| 17 |
* add_filter( 'better_payment/campaign_templates', function( $templates ) { |
| 18 |
* $templates['my-template'] = [ ... ]; |
| 19 |
* return $templates; |
| 20 |
* } ); |
| 21 |
*/ |
| 22 |
class TemplateManager { |
| 23 |
|
| 24 |
/** |
| 25 |
* Get all available campaign templates. |
| 26 |
* |
| 27 |
* @return array<string, array> |
| 28 |
*/ |
| 29 |
public static function get_all(): array { |
| 30 |
$first_users = get_users( [ 'fields' => [ 'ID' ], 'number' => 1 ] ); |
| 31 |
$first_creator_id = ! empty( $first_users ) ? (int) $first_users[0]->ID : get_current_user_id(); |
| 32 |
$tpl_img = BETTER_PAYMENT_ASSETS . '/img/campaign/templates'; |
| 33 |
|
| 34 |
$shared_sidebar = [ |
| 35 |
[ |
| 36 |
'id' => 'el_organizer', |
| 37 |
'type' => 'organizer', |
| 38 |
'settings' => [ 'creator_user_id' => $first_creator_id ], |
| 39 |
], |
| 40 |
[ |
| 41 |
'id' => 'el_social_sharing', |
| 42 |
'type' => 'social_sharing', |
| 43 |
'settings' => [ |
| 44 |
'headline' => 'Share Now', |
| 45 |
'twitter' => true, |
| 46 |
'facebook' => true, |
| 47 |
'linkedin' => true, |
| 48 |
'pinterest' => true, |
| 49 |
'mastodon' => true, |
| 50 |
'threads' => false, |
| 51 |
'bluesky' => false, |
| 52 |
], |
| 53 |
], |
| 54 |
[ |
| 55 |
'id' => 'el_social_links', |
| 56 |
'type' => 'social_links', |
| 57 |
'settings' => [ |
| 58 |
'headline' => 'Follow Now', |
| 59 |
'twitter' => 'https://twitter.com/', |
| 60 |
'facebook' => 'https://facebook.com/', |
| 61 |
'linkedin' => 'https://linkedin.com/in/', |
| 62 |
'instagram' => '', |
| 63 |
'tiktok' => '', |
| 64 |
'pinterest' => '', |
| 65 |
'youtube' => '', |
| 66 |
'threads' => '', |
| 67 |
'bluesky' => '', |
| 68 |
'mastodon' => '', |
| 69 |
], |
| 70 |
], |
| 71 |
]; |
| 72 |
|
| 73 |
$templates = [ |
| 74 |
|
| 75 |
'blank-1col' => [ |
| 76 |
'key' => 'blank-1col', |
| 77 |
'category' => 'blank', |
| 78 |
'tags' => [], |
| 79 |
'label' => __( '1 Column', 'better-payment' ), |
| 80 |
'description' => __( 'Single column, vertical stack.', 'better-payment' ), |
| 81 |
'layout' => '1-column', |
| 82 |
'columns' => [ |
| 83 |
[ |
| 84 |
'id' => 'main', |
| 85 |
'label' => __( 'Main Content', 'better-payment' ), |
| 86 |
'width' => '100%', |
| 87 |
'elements' => [], |
| 88 |
], |
| 89 |
], |
| 90 |
], |
| 91 |
|
| 92 |
'blank-2col' => [ |
| 93 |
'key' => 'blank-2col', |
| 94 |
'category' => 'blank', |
| 95 |
'tags' => [], |
| 96 |
'label' => __( '2 Column', 'better-payment' ), |
| 97 |
'description' => __( 'Main content area with sidebar.', 'better-payment' ), |
| 98 |
'layout' => '2-column', |
| 99 |
'columns' => [ |
| 100 |
[ |
| 101 |
'id' => 'main', |
| 102 |
'label' => __( 'Main Content', 'better-payment' ), |
| 103 |
'width' => '65%', |
| 104 |
'elements' => [], |
| 105 |
], |
| 106 |
[ |
| 107 |
'id' => 'sidebar', |
| 108 |
'label' => __( 'Sidebar', 'better-payment' ), |
| 109 |
'width' => '35%', |
| 110 |
'elements' => [], |
| 111 |
], |
| 112 |
], |
| 113 |
], |
| 114 |
|
| 115 |
'blank-3col' => [ |
| 116 |
'key' => 'blank-3col', |
| 117 |
'category' => 'blank', |
| 118 |
'tags' => [], |
| 119 |
'label' => __( '3 Column', 'better-payment' ), |
| 120 |
'description' => __( 'Three equal-width columns.', 'better-payment' ), |
| 121 |
'layout' => '3-column', |
| 122 |
'columns' => [ |
| 123 |
[ |
| 124 |
'id' => 'col1', |
| 125 |
'label' => __( 'Column 1', 'better-payment' ), |
| 126 |
'width' => '33.33%', |
| 127 |
'elements' => [], |
| 128 |
], |
| 129 |
[ |
| 130 |
'id' => 'col2', |
| 131 |
'label' => __( 'Column 2', 'better-payment' ), |
| 132 |
'width' => '33.33%', |
| 133 |
'elements' => [], |
| 134 |
], |
| 135 |
[ |
| 136 |
'id' => 'col3', |
| 137 |
'label' => __( 'Column 3', 'better-payment' ), |
| 138 |
'width' => '33.33%', |
| 139 |
'elements' => [], |
| 140 |
], |
| 141 |
], |
| 142 |
], |
| 143 |
|
| 144 |
'charity-basic' => [ |
| 145 |
'key' => 'charity-basic', |
| 146 |
'category' => 'prebuilt', |
| 147 |
'tags' => [ 'charity' ], |
| 148 |
'preview_image' => 'assets/img/campaign/templates/preview/charity-basic.webp', |
| 149 |
'label' => __( 'Refugee Relief Fund', 'better-payment' ), |
| 150 |
'default_title' => __( 'Refugee Relief Fund', 'better-payment' ), |
| 151 |
'description' => __( 'Support refugee communities with immediate aid and long-term recovery.', 'better-payment' ), |
| 152 |
'layout' => '2-column', |
| 153 |
'columns' => [ |
| 154 |
[ |
| 155 |
'id' => 'main', |
| 156 |
'label' => __( 'Main Content', 'better-payment' ), |
| 157 |
'width' => '65%', |
| 158 |
'elements' => [ |
| 159 |
[ |
| 160 |
'id' => 'el_title', |
| 161 |
'type' => 'campaign_title', |
| 162 |
'settings' => [], |
| 163 |
], |
| 164 |
[ |
| 165 |
'id' => 'el_photo', |
| 166 |
'type' => 'photo', |
| 167 |
'settings' => [ |
| 168 |
'src' => $tpl_img . '/charity/Refugee-Relief-Fund.webp', |
| 169 |
'alt' => 'Humanitarian aid workers helping refugee families', |
| 170 |
], |
| 171 |
], |
| 172 |
[ |
| 173 |
'id' => 'el_desc', |
| 174 |
'type' => 'campaign_description', |
| 175 |
'settings' => [ |
| 176 |
'headline' => 'Help Refugees Find Safety, Shelter, and Hope', |
| 177 |
'content' => 'Millions of people are forced to flee their homes due to conflict, persecution, and disaster. Your donation provides immediate relief — emergency shelter, food, clean water, and medical care — to refugee families who have lost everything. Every contribution, no matter the size, helps rebuild lives and restore dignity.', |
| 178 |
], |
| 179 |
], |
| 180 |
[ |
| 181 |
'id' => 'el_summary', |
| 182 |
'type' => 'campaign_summary', |
| 183 |
'settings' => [ 'show_raised' => true, 'show_donors' => true, 'show_percent' => true, 'show_days' => true ], |
| 184 |
], |
| 185 |
[ |
| 186 |
'id' => 'el_donate', |
| 187 |
'type' => 'donation_form', |
| 188 |
'settings' => [ |
| 189 |
'button_label' => 'Donate Now', |
| 190 |
'button_color' => '#B49A5F', |
| 191 |
'url' => '', |
| 192 |
], |
| 193 |
], |
| 194 |
], |
| 195 |
], |
| 196 |
[ |
| 197 |
'id' => 'sidebar', |
| 198 |
'label' => __( 'Sidebar', 'better-payment' ), |
| 199 |
'width' => '35%', |
| 200 |
'elements' => $shared_sidebar, |
| 201 |
], |
| 202 |
], |
| 203 |
], |
| 204 |
|
| 205 |
'medical-relief' => [ |
| 206 |
'key' => 'medical-relief', |
| 207 |
'category' => 'prebuilt', |
| 208 |
'tags' => [ 'medical' ], |
| 209 |
'preview_image' => 'assets/img/campaign/templates/preview/medical-relief.webp', |
| 210 |
'label' => __( 'Medical Emergency Fund', 'better-payment' ), |
| 211 |
'default_title' => __( 'Medical Emergency Fund', 'better-payment' ), |
| 212 |
'description' => __( 'Bring hope during medical emergencies through compassionate giving.', 'better-payment' ), |
| 213 |
'layout' => '2-column', |
| 214 |
'columns' => [ |
| 215 |
[ |
| 216 |
'id' => 'main', |
| 217 |
'label' => __( 'Main Content', 'better-payment' ), |
| 218 |
'width' => '50%', |
| 219 |
'elements' => [ |
| 220 |
[ |
| 221 |
'id' => 'el_title', |
| 222 |
'type' => 'campaign_title', |
| 223 |
'settings' => [], |
| 224 |
], |
| 225 |
[ |
| 226 |
'id' => 'el_desc1', |
| 227 |
'type' => 'campaign_description', |
| 228 |
'settings' => [ |
| 229 |
'headline' => '', |
| 230 |
'content' => 'On June 12, 2023 Brook\'s wife Maleena was admitted to hospital while 20 weeks pregnant, where she was diagnosed with Stage 4 B-cell Lymphoma. At just 22 years old, she has been confronted with a life-altering diagnosis and is now facing a grueling fight. After experiencing inflammation and pain in her legs in March, Brooke spoke with her GP and sought treatment from chiropractors and physios.', |
| 231 |
], |
| 232 |
], |
| 233 |
[ |
| 234 |
'id' => 'el_photo1', |
| 235 |
'type' => 'photo', |
| 236 |
'settings' => [ |
| 237 |
'src' => $tpl_img . '/medical/Medical-Emergency-Fund.webp', |
| 238 |
'alt' => 'Patient receiving hospital care', |
| 239 |
], |
| 240 |
], |
| 241 |
[ |
| 242 |
'id' => 'el_desc2', |
| 243 |
'type' => 'campaign_description', |
| 244 |
'settings' => [ |
| 245 |
'headline' => '', |
| 246 |
'content' => 'Devastated by Maleena\'s diagnosis, Brooke found himself navigating a whirlwind of emotions and responsibilities. He became Maleena\'s unwavering pillar of support, attending every doctor\'s appointment and chemotherapy session with her, his heart aching at the sight of his young wife enduring such pain. The couple, once planning nursery decorations and baby names, now found themselves discussing treatment options and potential outcomes. Despite the overwhelming fear and uncertainty, they clung to each other, drawing strength from their love and the life growing inside Maleena. Friends and family rallied around them, offering words of encouragement and practical help, reminding them that they were not alone in this battle. In the face of adversity, Brooke and Maleena vowed to fight together, holding onto hope and cherishing every moment they had together, knowing that their love would be the guiding light in the darkest of times.', |
| 247 |
], |
| 248 |
], |
| 249 |
[ |
| 250 |
'id' => 'el_photo2', |
| 251 |
'type' => 'photo', |
| 252 |
'settings' => [ |
| 253 |
'src' => 'https://images.unsplash.com/photo-1631217868264-e5b90bb7e133?auto=format&w=740&q=80&fit=crop', |
| 254 |
'alt' => 'Doctor providing compassionate care', |
| 255 |
], |
| 256 |
], |
| 257 |
], |
| 258 |
], |
| 259 |
[ |
| 260 |
'id' => 'sidebar', |
| 261 |
'label' => __( 'Sidebar', 'better-payment' ), |
| 262 |
'width' => '50%', |
| 263 |
'elements' => [ |
| 264 |
[ |
| 265 |
'id' => 'el_summary', |
| 266 |
'type' => 'campaign_summary', |
| 267 |
'settings' => [ 'show_raised' => true, 'show_donors' => true, 'show_percent' => true, 'show_days' => true ], |
| 268 |
], |
| 269 |
[ |
| 270 |
'id' => 'el_progress', |
| 271 |
'type' => 'progress_bar', |
| 272 |
'settings' => [ 'show_donated' => true, 'show_goal' => true ], |
| 273 |
], |
| 274 |
[ |
| 275 |
'id' => 'el_funding_note', |
| 276 |
'type' => 'campaign_description', |
| 277 |
'settings' => [ |
| 278 |
'headline' => '', |
| 279 |
'content' => 'This project will only be funded if at least $270,000 is raised by December 22, 2025.', |
| 280 |
], |
| 281 |
], |
| 282 |
[ |
| 283 |
'id' => 'el_donate', |
| 284 |
'type' => 'donation_form', |
| 285 |
'settings' => [ |
| 286 |
'button_label' => 'Donate Now', |
| 287 |
'button_color' => '#7A8347', |
| 288 |
'url' => '', |
| 289 |
], |
| 290 |
], |
| 291 |
[ |
| 292 |
'id' => 'el_organizer', |
| 293 |
'type' => 'organizer', |
| 294 |
'settings' => [ 'creator_user_id' => $first_creator_id ], |
| 295 |
], |
| 296 |
], |
| 297 |
], |
| 298 |
], |
| 299 |
], |
| 300 |
|
| 301 |
'education-fund' => [ |
| 302 |
'key' => 'education-fund', |
| 303 |
'category' => 'prebuilt', |
| 304 |
'tags' => [ 'education' ], |
| 305 |
'preview_image' => 'assets/img/campaign/templates/preview/education-fund.webp', |
| 306 |
'label' => __( 'Student Success Fund', 'better-payment' ), |
| 307 |
'default_title' => __( 'Student Success Fund', 'better-payment' ), |
| 308 |
'description' => __( 'Empower the next generation through education.', 'better-payment' ), |
| 309 |
'theme_class' => 'school-trip', |
| 310 |
'preview_color' => '#5c6b38', |
| 311 |
'layout' => '2-column', |
| 312 |
'columns' => [ |
| 313 |
[ |
| 314 |
'id' => 'main', |
| 315 |
'label' => __( 'Main Content', 'better-payment' ), |
| 316 |
'width' => '50%', |
| 317 |
'elements' => [ |
| 318 |
[ |
| 319 |
'id' => 'el_title', |
| 320 |
'type' => 'campaign_title', |
| 321 |
'settings' => [], |
| 322 |
], |
| 323 |
[ |
| 324 |
'id' => 'el_desc', |
| 325 |
'type' => 'campaign_description', |
| 326 |
'settings' => [ |
| 327 |
'headline' => 'Raise fund for our school trip!', |
| 328 |
'content' => 'We are announcing a campaign to make the dream of a once-in-a-lifetime field trip come true for our graduating 5th graders: an unforgettable adventure in California! Your support will enable us to purchase necessary supplies, ensure safe travel, and provide accommodations for both parents and teachers accompanying the students. With your contribution, we can create lasting memories and valuable learning experiences, fostering a sense of camaraderie and curiosity that will stay with these young minds for a lifetime.', |
| 329 |
], |
| 330 |
], |
| 331 |
[ |
| 332 |
'id' => 'el_photo', |
| 333 |
'type' => 'photo', |
| 334 |
'settings' => [ |
| 335 |
'src' => $tpl_img . '/education/Student-Success-Fund.webp', |
| 336 |
'alt' => 'Student on a field trip outdoors', |
| 337 |
], |
| 338 |
], |
| 339 |
], |
| 340 |
], |
| 341 |
[ |
| 342 |
'id' => 'sidebar', |
| 343 |
'label' => __( 'Sidebar', 'better-payment' ), |
| 344 |
'width' => '50%', |
| 345 |
'elements' => [ |
| 346 |
[ |
| 347 |
'id' => 'el_photo_hero', |
| 348 |
'type' => 'photo', |
| 349 |
'settings' => [ |
| 350 |
'src' => 'https://images.unsplash.com/photo-1587560699334-cc4ff634909a?q=80&w=1740&auto=format&fit=crop', |
| 351 |
'alt' => 'Students on a school camping trip', |
| 352 |
], |
| 353 |
], |
| 354 |
[ |
| 355 |
'id' => 'el_summary', |
| 356 |
'type' => 'campaign_summary', |
| 357 |
'settings' => [ 'show_raised' => true, 'show_donors' => true, 'show_percent' => false, 'show_days' => false ], |
| 358 |
], |
| 359 |
[ |
| 360 |
'id' => 'el_quote', |
| 361 |
'type' => 'campaign_description', |
| 362 |
'settings' => [ |
| 363 |
'headline' => 'Together, we can inspire these young minds and equip them with the tools they need to make a positive impact on the world.', |
| 364 |
'content' => '', |
| 365 |
], |
| 366 |
], |
| 367 |
[ |
| 368 |
'id' => 'el_body', |
| 369 |
'type' => 'campaign_description', |
| 370 |
'settings' => [ |
| 371 |
'headline' => '', |
| 372 |
'content' => 'Your generosity will not only provide the means for this adventure but will also contribute to the overall educational enrichment of our students. This trip isn\'t just a mere excursion; it\'s a chance for our 5th graders to expand their horizons, learn about different cultures, and engage with historical and natural wonders that will enhance their academic understanding.', |
| 373 |
], |
| 374 |
], |
| 375 |
[ |
| 376 |
'id' => 'el_progress', |
| 377 |
'type' => 'progress_bar', |
| 378 |
'settings' => [ 'show_donated' => true, 'show_goal' => true ], |
| 379 |
], |
| 380 |
[ |
| 381 |
'id' => 'el_donate', |
| 382 |
'type' => 'donation_form', |
| 383 |
'settings' => [ |
| 384 |
'button_label' => 'Donate Now', |
| 385 |
'button_color' => '#8fa040', |
| 386 |
'url' => '', |
| 387 |
], |
| 388 |
], |
| 389 |
[ |
| 390 |
'id' => 'el_social_links', |
| 391 |
'type' => 'social_links', |
| 392 |
'settings' => [ |
| 393 |
'headline' => 'Follow on', |
| 394 |
'twitter' => 'https://twitter.com/', |
| 395 |
'facebook' => 'https://facebook.com/', |
| 396 |
'linkedin' => 'https://linkedin.com/in/', |
| 397 |
'instagram' => '', |
| 398 |
'tiktok' => '', |
| 399 |
'pinterest' => '', |
| 400 |
'youtube' => '', |
| 401 |
'threads' => '', |
| 402 |
'bluesky' => '', |
| 403 |
'mastodon' => '', |
| 404 |
], |
| 405 |
], |
| 406 |
], |
| 407 |
], |
| 408 |
], |
| 409 |
], |
| 410 |
|
| 411 |
'golf-destinations' => [ |
| 412 |
'key' => 'golf-destinations', |
| 413 |
'category' => 'prebuilt', |
| 414 |
'tags' => [ 'club-organizations' ], |
| 415 |
'preview_image' => 'assets/img/campaign/templates/preview/golf-destinations.webp', |
| 416 |
'label' => __( 'Elite Golf Club Membership', 'better-payment' ), |
| 417 |
'default_title' => __( 'Elite Golf Club Membership', 'better-payment' ), |
| 418 |
'description' => __( 'Join an exclusive golfing experience built for champions.', 'better-payment' ), |
| 419 |
'theme_class' => 'golf-destinations', |
| 420 |
'preview_color' => '#b8a46a', |
| 421 |
'layout' => '2-column', |
| 422 |
'columns' => [ |
| 423 |
[ |
| 424 |
'id' => 'main', |
| 425 |
'label' => __( 'Main Content', 'better-payment' ), |
| 426 |
'width' => '50%', |
| 427 |
'elements' => [ |
| 428 |
[ |
| 429 |
'id' => 'el_photo', |
| 430 |
'type' => 'photo', |
| 431 |
'settings' => [ |
| 432 |
'src' => $tpl_img . '/club-organizations/Elite-Golf-Club-Membership.webp', |
| 433 |
'alt' => 'Golfer taking a swing on the course', |
| 434 |
], |
| 435 |
], |
| 436 |
[ |
| 437 |
'id' => 'el_desc_main', |
| 438 |
'type' => 'campaign_description', |
| 439 |
'settings' => [ |
| 440 |
'headline' => 'With 100% of donations going towards grants and programs', |
| 441 |
'content' => 'Every dollar contributed goes directly to maintaining our beloved club facilities, funding community programs, and supporting the next generation of golfers. Your generosity helps preserve a cherished institution that brings people together — from weekend players to seasoned champions. Join us in securing the future of this extraordinary place.', |
| 442 |
], |
| 443 |
] |
| 444 |
], |
| 445 |
], |
| 446 |
[ |
| 447 |
'id' => 'content', |
| 448 |
'label' => __( 'Donate', 'better-payment' ), |
| 449 |
'width' => '50%', |
| 450 |
'elements' => [ |
| 451 |
[ |
| 452 |
'id' => 'el_desc', |
| 453 |
'type' => 'campaign_description', |
| 454 |
'settings' => [ |
| 455 |
'headline' => 'About This Club', |
| 456 |
'content' => 'We are announcing a campaign to support our cherished local country club, a haven for our community, especially our elderly residents. Our non-profit is passionately rallying for funds to ensure the maintenance of this vital space and to sustain the heartwarming annual events that bring together generations. By contributing, you\'re preserving a beloved institution that unites the young and the old, fostering a sense of belonging and community spirit. Join us in safeguarding this haven for all ages!', |
| 457 |
], |
| 458 |
], |
| 459 |
[ |
| 460 |
'id' => 'el_progress', |
| 461 |
'type' => 'progress_bar', |
| 462 |
'settings' => [ 'show_donated' => true, 'show_goal' => true ], |
| 463 |
], |
| 464 |
[ |
| 465 |
'id' => 'el_summary', |
| 466 |
'type' => 'campaign_summary', |
| 467 |
'settings' => [ 'show_raised' => true, 'show_donors' => true, 'show_percent' => false, 'show_days' => false ], |
| 468 |
], |
| 469 |
[ |
| 470 |
'id' => 'el_donate', |
| 471 |
'type' => 'donation_form', |
| 472 |
'settings' => [ |
| 473 |
'button_label' => 'Donate Now', |
| 474 |
'button_color' => '#b8a46a', |
| 475 |
'url' => '', |
| 476 |
], |
| 477 |
], |
| 478 |
], |
| 479 |
], |
| 480 |
], |
| 481 |
], |
| 482 |
|
| 483 |
'child-healthcare' => [ |
| 484 |
'key' => 'child-healthcare', |
| 485 |
'category' => 'prebuilt', |
| 486 |
'tags' => [ 'medical' ], |
| 487 |
'preview_image' => 'assets/img/campaign/templates/preview/child-healthcare.webp', |
| 488 |
'label' => __( 'Child Healthcare Fund', 'better-payment' ), |
| 489 |
'default_title' => __( 'Child Healthcare Fund', 'better-payment' ), |
| 490 |
'description' => __( 'Help children access life-saving treatments, vaccinations, surgeries, and ongoing medical care.', 'better-payment' ), |
| 491 |
'theme_class' => 'child-healthcare', |
| 492 |
'preview_color' => '#ecc30b', |
| 493 |
'layout' => '2-column', |
| 494 |
'columns' => [ |
| 495 |
[ |
| 496 |
'id' => 'main', |
| 497 |
'label' => __( 'Main Content', 'better-payment' ), |
| 498 |
'width' => '50%', |
| 499 |
'elements' => [ |
| 500 |
[ |
| 501 |
'id' => 'el_photo', |
| 502 |
'type' => 'photo', |
| 503 |
'settings' => [ |
| 504 |
'src' => $tpl_img . '/medical/Child-Healthcare-Fund.webp', |
| 505 |
'alt' => 'Doctor giving compassionate care to a young child patient', |
| 506 |
], |
| 507 |
], |
| 508 |
[ |
| 509 |
'id' => 'el_tagline', |
| 510 |
'type' => 'campaign_description', |
| 511 |
'settings' => [ |
| 512 |
'headline' => 'Every child deserves a healthy future', |
| 513 |
'content' => 'Your generosity funds life-saving treatments, vaccinations, surgeries, and ongoing care for children who need it most. Together we can ensure no child suffers without access to proper medical support.', |
| 514 |
], |
| 515 |
], |
| 516 |
[ |
| 517 |
'id' => 'el_summary_left', |
| 518 |
'type' => 'campaign_summary', |
| 519 |
'settings' => [ 'show_raised' => true, 'show_donors' => true, 'show_percent' => false, 'show_days' => false ], |
| 520 |
], |
| 521 |
], |
| 522 |
], |
| 523 |
[ |
| 524 |
'id' => 'donate', |
| 525 |
'label' => __( 'Donation Panel', 'better-payment' ), |
| 526 |
'width' => '50%', |
| 527 |
'elements' => [ |
| 528 |
[ |
| 529 |
'id' => 'el_label', |
| 530 |
'type' => 'campaign_description', |
| 531 |
'settings' => [ |
| 532 |
'headline' => 'Let\'s Help The Children', |
| 533 |
'content' => '', |
| 534 |
], |
| 535 |
], |
| 536 |
[ |
| 537 |
'id' => 'el_title', |
| 538 |
'type' => 'campaign_title', |
| 539 |
'settings' => [], |
| 540 |
], |
| 541 |
[ |
| 542 |
'id' => 'el_amounts', |
| 543 |
'type' => 'donate_amount', |
| 544 |
'settings' => [ |
| 545 |
'preset_amounts' => '5,10,15,20', |
| 546 |
], |
| 547 |
], |
| 548 |
[ |
| 549 |
'id' => 'el_donate', |
| 550 |
'type' => 'donation_form', |
| 551 |
'settings' => [ |
| 552 |
'button_label' => 'Donate Now', |
| 553 |
'button_color' => '#ecc30b', |
| 554 |
'url' => '', |
| 555 |
], |
| 556 |
], |
| 557 |
[ |
| 558 |
'id' => 'el_sharing', |
| 559 |
'type' => 'social_sharing', |
| 560 |
'settings' => [ |
| 561 |
'headline' => 'Share Now', |
| 562 |
'twitter' => true, |
| 563 |
'facebook' => true, |
| 564 |
'linkedin' => true, |
| 565 |
'pinterest' => true, |
| 566 |
'mastodon' => true, |
| 567 |
'threads' => false, |
| 568 |
'bluesky' => false, |
| 569 |
], |
| 570 |
], |
| 571 |
[ |
| 572 |
'id' => 'el_links', |
| 573 |
'type' => 'social_links', |
| 574 |
'settings' => [ |
| 575 |
'headline' => 'Follow Now', |
| 576 |
'twitter' => 'https://twitter.com/', |
| 577 |
'facebook' => 'https://facebook.com/', |
| 578 |
'linkedin' => '', |
| 579 |
'instagram' => 'https://instagram.com/', |
| 580 |
'tiktok' => '', |
| 581 |
'pinterest' => '', |
| 582 |
'youtube' => '', |
| 583 |
'threads' => '', |
| 584 |
'bluesky' => '', |
| 585 |
'mastodon' => '', |
| 586 |
], |
| 587 |
], |
| 588 |
], |
| 589 |
], |
| 590 |
], |
| 591 |
], |
| 592 |
|
| 593 |
'tree-plantation' => [ |
| 594 |
'key' => 'tree-plantation', |
| 595 |
'category' => 'prebuilt', |
| 596 |
'tags' => [ 'environmental' ], |
| 597 |
'preview_image' => 'assets/img/campaign/templates/preview/tree-plantation.webp', |
| 598 |
'label' => __( 'Tree Plantation Campaign', 'better-payment' ), |
| 599 |
'default_title' => __( 'Tree Plantation Campaign', 'better-payment' ), |
| 600 |
'description' => __( 'Support environmental restoration through tree planting, conservation, and climate action initiatives.', 'better-payment' ), |
| 601 |
'theme_class' => 'tree-plantation', |
| 602 |
'preview_color' => '#61aa4f', |
| 603 |
'layout' => '2-column', |
| 604 |
'columns' => [ |
| 605 |
[ |
| 606 |
'id' => 'main', |
| 607 |
'label' => __( 'Main Content', 'better-payment' ), |
| 608 |
'width' => '50%', |
| 609 |
'elements' => [ |
| 610 |
[ |
| 611 |
'id' => 'el_photo1', |
| 612 |
'type' => 'photo', |
| 613 |
'settings' => [ |
| 614 |
'src' => $tpl_img . '/environmental/Tree-Plantation-Campaign.webp', |
| 615 |
'alt' => 'Hands holding a young plant growing from rich soil', |
| 616 |
], |
| 617 |
], |
| 618 |
[ |
| 619 |
'id' => 'el_desc_body', |
| 620 |
'type' => 'campaign_description', |
| 621 |
'settings' => [ |
| 622 |
'headline' => 'Keep the scene green by taking the lead', |
| 623 |
'content' => 'Your support will make a significant impact, enabling us to organize community clean-up events where volunteers, equipped with the necessary resources, can work together to remove garbage and restore the beach to its natural state. Additionally, your contributions will empower us to implement educational programs aimed at raising awareness about the importance of environmental conservation. We believe that through collective action, we can not only clean up our beloved beach but also inspire a lasting change in our community\'s attitudes towards environmental responsibility. Every donation, no matter how big or small, brings us one step closer to a cleaner, healthier environment for everyone. Join us in this vital endeavor, and let\'s create a positive ripple effect that benefits both our local ecosystem and the people who call this community home.', |
| 624 |
], |
| 625 |
], |
| 626 |
[ |
| 627 |
'id' => 'el_photo2', |
| 628 |
'type' => 'photo', |
| 629 |
'settings' => [ |
| 630 |
'src' => 'https://images.unsplash.com/photo-1520962880247-cfaf541c8724?auto=format&w=1200&q=80&fit=crop', |
| 631 |
'alt' => 'Environmental activists marching for climate action', |
| 632 |
], |
| 633 |
], |
| 634 |
], |
| 635 |
], |
| 636 |
[ |
| 637 |
'id' => 'content', |
| 638 |
'label' => __( 'Donation Content', 'better-payment' ), |
| 639 |
'width' => '50%', |
| 640 |
'elements' => [ |
| 641 |
[ |
| 642 |
'id' => 'el_label', |
| 643 |
'type' => 'campaign_description', |
| 644 |
'settings' => [ |
| 645 |
'headline' => 'Save Earth', |
| 646 |
'content' => 'Together, let\'s reclaim the serenity of our shorelines and ensure a cleaner, greener future for generations to come.', |
| 647 |
], |
| 648 |
], |
| 649 |
[ |
| 650 |
'id' => 'el_title', |
| 651 |
'type' => 'campaign_title', |
| 652 |
'settings' => [], |
| 653 |
], |
| 654 |
[ |
| 655 |
'id' => 'el_desc', |
| 656 |
'type' => 'campaign_description', |
| 657 |
'settings' => [ |
| 658 |
'headline' => '', |
| 659 |
'content' => 'We are announcing a campaign dedicated to restoring the natural beauty of our local beach, which has sadly fallen victim to years of neglect and pollution. Our non-profit is on a mission to raise funds for cleaning supplies, vehicles, and essential costs to orchestrate a massive cleanup effort. By contributing, you\'re not just supporting a cleaner beach but also promoting environmental health and community pride.', |
| 660 |
], |
| 661 |
], |
| 662 |
[ |
| 663 |
'id' => 'el_summary', |
| 664 |
'type' => 'campaign_summary', |
| 665 |
'settings' => [ 'show_raised' => true, 'show_donors' => true, 'show_percent' => false, 'show_days' => false ], |
| 666 |
], |
| 667 |
[ |
| 668 |
'id' => 'el_donate', |
| 669 |
'type' => 'donation_form', |
| 670 |
'settings' => [ |
| 671 |
'button_label' => 'Donate Now', |
| 672 |
'button_color' => '#61aa4f', |
| 673 |
'url' => '', |
| 674 |
], |
| 675 |
], |
| 676 |
[ |
| 677 |
'id' => 'el_social_sharing', |
| 678 |
'type' => 'social_sharing', |
| 679 |
'settings' => [ |
| 680 |
'headline' => 'Share Now', |
| 681 |
'twitter' => true, |
| 682 |
'facebook' => true, |
| 683 |
'linkedin' => true, |
| 684 |
'pinterest' => true, |
| 685 |
'mastodon' => true, |
| 686 |
'threads' => false, |
| 687 |
'bluesky' => false, |
| 688 |
], |
| 689 |
], |
| 690 |
[ |
| 691 |
'id' => 'el_social_links', |
| 692 |
'type' => 'social_links', |
| 693 |
'settings' => [ |
| 694 |
'headline' => 'Follow Now', |
| 695 |
'twitter' => 'https://twitter.com/', |
| 696 |
'facebook' => 'https://facebook.com/', |
| 697 |
'linkedin' => '', |
| 698 |
'instagram' => 'https://instagram.com/', |
| 699 |
'tiktok' => '', |
| 700 |
'pinterest' => '', |
| 701 |
'youtube' => '', |
| 702 |
'threads' => '', |
| 703 |
'bluesky' => '', |
| 704 |
'mastodon' => '', |
| 705 |
], |
| 706 |
], |
| 707 |
], |
| 708 |
], |
| 709 |
], |
| 710 |
], |
| 711 |
|
| 712 |
'animal-rescue' => [ |
| 713 |
'key' => 'animal-rescue', |
| 714 |
'category' => 'prebuilt', |
| 715 |
'tags' => [ 'charity' ], |
| 716 |
'preview_image' => 'assets/img/campaign/templates/preview/animal-rescue.webp', |
| 717 |
'label' => __( 'Animal Rescue Fund', 'better-payment' ), |
| 718 |
'default_title' => __( 'Animal Rescue Fund', 'better-payment' ), |
| 719 |
'description' => __( 'Help rescue abandoned, injured, and homeless animals through shelter, food, medical care, and adoption support.', 'better-payment' ), |
| 720 |
'theme_class' => 'animal-rescue', |
| 721 |
'preview_color' => '#69B0B8', |
| 722 |
'layout' => '2-column', |
| 723 |
'columns' => [ |
| 724 |
[ |
| 725 |
'id' => 'main', |
| 726 |
'label' => __( 'Main Content', 'better-payment' ), |
| 727 |
'width' => '65%', |
| 728 |
'elements' => [ |
| 729 |
[ |
| 730 |
'id' => 'el_photo', |
| 731 |
'type' => 'photo', |
| 732 |
'settings' => [ |
| 733 |
'src' => $tpl_img . '/charity/Animal-Rescue-Fund.webp', |
| 734 |
'alt' => 'Adorable puppies waiting for a loving home', |
| 735 |
], |
| 736 |
], |
| 737 |
[ |
| 738 |
'id' => 'el_title', |
| 739 |
'type' => 'campaign_title', |
| 740 |
'settings' => [], |
| 741 |
], |
| 742 |
[ |
| 743 |
'id' => 'el_desc', |
| 744 |
'type' => 'campaign_description', |
| 745 |
'settings' => [ |
| 746 |
'headline' => 'Donate today to support our mission to rescue, rehabilitate, and rehome', |
| 747 |
'content' => 'I\'m thrilled to launch our new campaign aimed at supporting an incredible cause: an animal sanctuary dedicated to rescuing abandoned and lost animals and finding them loving homes. With your help, we aim to raise funds to maintain this sanctuary, providing a safe haven for these adorable pets and ensuring they receive the care they deserve. Your contributions will not only help us sustain the facility but also enable us to actively seek new, caring families for these animals, giving them a chance at a brighter and happier future. Together, we can make a real difference in the lives of these innocent creatures.', |
| 748 |
], |
| 749 |
], |
| 750 |
[ |
| 751 |
'id' => 'el_summary', |
| 752 |
'type' => 'campaign_summary', |
| 753 |
'settings' => [ 'show_raised' => true, 'show_donors' => true, 'show_percent' => false, 'show_days' => false ], |
| 754 |
], |
| 755 |
[ |
| 756 |
'id' => 'el_donate', |
| 757 |
'type' => 'donation_form', |
| 758 |
'settings' => [ |
| 759 |
'button_label' => 'Donate Now', |
| 760 |
'button_color' => '#69B0B8', |
| 761 |
'url' => '', |
| 762 |
], |
| 763 |
], |
| 764 |
], |
| 765 |
], |
| 766 |
[ |
| 767 |
'id' => 'sidebar', |
| 768 |
'label' => __( 'Sidebar', 'better-payment' ), |
| 769 |
'width' => '35%', |
| 770 |
'elements' => [ |
| 771 |
[ |
| 772 |
'id' => 'el_organizer', |
| 773 |
'type' => 'organizer', |
| 774 |
'settings' => [ 'creator_user_id' => $first_creator_id ], |
| 775 |
], |
| 776 |
[ |
| 777 |
'id' => 'el_social_sharing', |
| 778 |
'type' => 'social_sharing', |
| 779 |
'settings' => [ |
| 780 |
'headline' => 'Share Now', |
| 781 |
'twitter' => true, |
| 782 |
'facebook' => true, |
| 783 |
'linkedin' => true, |
| 784 |
'pinterest' => true, |
| 785 |
'mastodon' => true, |
| 786 |
'threads' => false, |
| 787 |
'bluesky' => false, |
| 788 |
], |
| 789 |
], |
| 790 |
[ |
| 791 |
'id' => 'el_social_links', |
| 792 |
'type' => 'social_links', |
| 793 |
'settings' => [ |
| 794 |
'headline' => 'Follow Now', |
| 795 |
'twitter' => 'https://twitter.com/', |
| 796 |
'facebook' => 'https://facebook.com/', |
| 797 |
'linkedin' => '', |
| 798 |
'instagram' => 'https://instagram.com/', |
| 799 |
'tiktok' => '', |
| 800 |
'pinterest' => '', |
| 801 |
'youtube' => '', |
| 802 |
'threads' => '', |
| 803 |
'bluesky' => '', |
| 804 |
'mastodon' => '', |
| 805 |
], |
| 806 |
], |
| 807 |
], |
| 808 |
], |
| 809 |
], |
| 810 |
], |
| 811 |
|
| 812 |
'disaster-relief' => [ |
| 813 |
'key' => 'disaster-relief', |
| 814 |
'category' => 'prebuilt', |
| 815 |
'tags' => [ 'environmental' ], |
| 816 |
'preview_image' => 'assets/img/campaign/templates/preview/disaster-relief.webp', |
| 817 |
'label' => __( 'Emergency Disaster Relief', 'better-payment' ), |
| 818 |
'default_title' => __( 'Emergency Disaster Relief', 'better-payment' ), |
| 819 |
'description' => __( 'Help communities recover when they need it most.', 'better-payment' ), |
| 820 |
'theme_class' => 'disaster-relief', |
| 821 |
'preview_color' => '#c0392b', |
| 822 |
'layout' => '2-column', |
| 823 |
'columns' => [ |
| 824 |
[ |
| 825 |
'id' => 'main', |
| 826 |
'label' => __( 'Main Content', 'better-payment' ), |
| 827 |
'width' => '65%', |
| 828 |
'elements' => [ |
| 829 |
[ |
| 830 |
'id' => 'el_title', |
| 831 |
'type' => 'campaign_title', |
| 832 |
'settings' => [], |
| 833 |
], |
| 834 |
[ |
| 835 |
'id' => 'el_photo', |
| 836 |
'type' => 'photo', |
| 837 |
'settings' => [ |
| 838 |
'src' => $tpl_img . '/environmental/Emergency-Disaster-Relief.webp', |
| 839 |
'alt' => 'Disaster aftermath showing damaged buildings', |
| 840 |
], |
| 841 |
], |
| 842 |
[ |
| 843 |
'id' => 'el_progress', |
| 844 |
'type' => 'progress_bar', |
| 845 |
'settings' => [ 'show_donated' => true, 'show_goal' => true ], |
| 846 |
], |
| 847 |
[ |
| 848 |
'id' => 'el_desc', |
| 849 |
'type' => 'campaign_description', |
| 850 |
'settings' => [ |
| 851 |
'headline' => 'About This Campaign', |
| 852 |
'content' => 'We are announcing a new campaign aimed at providing crucial support to the victims of a recent devastating natural disaster. Together, we are rallying behind our fellow community members, raising funds through this non-profit initiative to help them rebuild homes, restore essential services, and reclaim their lives. Join us in making a difference, as every contribution brings us one step closer to bringing hope and stability back to those in need.', |
| 853 |
], |
| 854 |
], |
| 855 |
[ |
| 856 |
'id' => 'el_photo2', |
| 857 |
'type' => 'photo', |
| 858 |
'settings' => [ |
| 859 |
'src' => 'https://images.unsplash.com/photo-1547032175-7fc8c7bd15b3?q=80&w=2340&auto=format&fit=crop', |
| 860 |
'alt' => 'Rescue and recovery efforts after disaster', |
| 861 |
], |
| 862 |
], |
| 863 |
], |
| 864 |
], |
| 865 |
[ |
| 866 |
'id' => 'sidebar', |
| 867 |
'label' => __( 'Sidebar', 'better-payment' ), |
| 868 |
'width' => '35%', |
| 869 |
'elements' => [ |
| 870 |
[ |
| 871 |
'id' => 'el_donate_intro', |
| 872 |
'type' => 'campaign_description', |
| 873 |
'settings' => [ |
| 874 |
'headline' => 'Donate Today', |
| 875 |
'content' => 'This project will only be funded if at least $270,000 is raised by December 22, 2025.', |
| 876 |
], |
| 877 |
], |
| 878 |
[ |
| 879 |
'id' => 'el_summary', |
| 880 |
'type' => 'campaign_summary', |
| 881 |
'settings' => [ 'show_raised' => true, 'show_donors' => true, 'show_percent' => false, 'show_days' => false ], |
| 882 |
], |
| 883 |
[ |
| 884 |
'id' => 'el_donate', |
| 885 |
'type' => 'donation_form', |
| 886 |
'settings' => [ |
| 887 |
'button_label' => 'Donate Now', |
| 888 |
'button_color' => '#c0392b', |
| 889 |
'url' => '', |
| 890 |
], |
| 891 |
], |
| 892 |
[ |
| 893 |
'id' => 'el_social_sharing', |
| 894 |
'type' => 'social_sharing', |
| 895 |
'settings' => [ |
| 896 |
'headline' => 'Share', |
| 897 |
'twitter' => true, |
| 898 |
'facebook' => true, |
| 899 |
'linkedin' => true, |
| 900 |
'pinterest' => true, |
| 901 |
'mastodon' => true, |
| 902 |
'threads' => false, |
| 903 |
'bluesky' => false, |
| 904 |
], |
| 905 |
], |
| 906 |
[ |
| 907 |
'id' => 'el_social_links', |
| 908 |
'type' => 'social_links', |
| 909 |
'settings' => [ |
| 910 |
'headline' => 'Follow on', |
| 911 |
'twitter' => 'https://twitter.com/', |
| 912 |
'facebook' => 'https://facebook.com/', |
| 913 |
'linkedin' => '', |
| 914 |
'instagram' => '', |
| 915 |
'tiktok' => '', |
| 916 |
'pinterest' => '', |
| 917 |
'youtube' => '', |
| 918 |
'threads' => '', |
| 919 |
'bluesky' => '', |
| 920 |
'mastodon' => '', |
| 921 |
], |
| 922 |
], |
| 923 |
], |
| 924 |
], |
| 925 |
], |
| 926 |
], |
| 927 |
|
| 928 |
]; |
| 929 |
|
| 930 |
return apply_filters( 'better_payment/campaign_templates', $templates ); |
| 931 |
} |
| 932 |
} |
| 933 |
|