← Back
Editing: defaultFormTemplate.php
<?php /** * Donation form view. * * @since 4.19.1 Escape output. * @since 2.7.0 */ use Give\Helpers\Form\Template\Utils\Frontend as FrontendFormTemplateUtils; use Give\Views\IframeContentView; if (!defined('ABSPATH')) { exit; } // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- template variables; this file is included inside a function, so they are not globals. $formId = FrontendFormTemplateUtils::getFormId(); $iframeView = new IframeContentView(); // Fetch the Give Form. ob_start(); give_get_donation_form(['id' => $formId]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- IframeContentView::render() escapes internally; the buffered form output is already escaped by includes/forms/template.php. echo $iframeView->setTitle(get_post_field('post_title', $formId))->setPostId($formId)->setBody(ob_get_clean())->render();
Save File
Cancel