PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.8.1
GiveWP – Donation Plugin and Fundraising Platform v4.16.8.1
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
give / src / Campaigns / Blocks / CampaignForm / render.php

render.php in GiveWP – Donation Plugin and Fundraising Platform 4.16.8.1, at src/Campaigns/Blocks/CampaignForm/render.php

43 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 use Give\Campaigns\Models\Campaign;
4 use Give\Campaigns\Repositories\CampaignRepository;
5
6 /**
7 * @var array $attributes
8 * @var Campaign $campaign
9 *
10 * @unrelesed
11 */
12
13 if (! isset($attributes['campaignId']) ||
14 ! ($campaign = give(CampaignRepository::class)->getById($attributes['campaignId']))
15 ) {
16 return;
17 }
18
19 ob_start();
20 $atts = [
21 'campaign_id' => $attributes['campaignId'],
22 'block_id' => $attributes['blockId'] ?? '',
23 'prev_id' => $attributes['prevId'] ?? 0,
24 'id' => $attributes['id'],
25 'display_style' => $attributes['displayStyle'] ?? 'onpage',
26 'continue_button_title' => $attributes['continueButtonTitle'] ?? __('Donate Now', 'give'),
27 'show_title' => $attributes['showTitle'] ?? true,
28 'content_display' => $attributes['contentDisplay'] ?? 'above',
29 'show_goal' => $attributes['showGoal'] ?? true,
30 'show_content' => $attributes['showContent'] ?? true,
31 'use_default_form' => $attributes['useDefaultForm'] ?? true,
32 ];
33
34 if ($atts['use_default_form'] === true) {
35 $atts['id'] = $campaign->defaultFormId;
36 }
37
38 echo give_form_shortcode($atts);
39
40 $final_output = ob_get_clean();
41
42 echo $final_output;
43