PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.3.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.3.1
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
← All changes | includes/Frontend/InitRoutes.php +48 -2 2.03.3.1 View file →
@@ -1,7 +1,53 @@
1 1 <?php
2 2
3 +if (!defined('ABSPATH')) {
4 + exit;
5 +}
6 +
3 7 use BitCode\BitForm\Frontend\CustomRoutes;
8 +use BitCode\BitForm\Frontend\FormEntryView;
4 9 use BitCode\BitForm\Frontend\StandaloneFormView;
5 10
6 -$routes = new CustomRoutes();
7 -$routes->add('bitform-form-view/([0-9]+)/?', [StandaloneFormView::class, 'preview']);
11 +$bitforms_routes = new CustomRoutes();
12 +// $bitforms_routes->add('bitform-form-view/([0-9]+)/?', [StandaloneFormView::class, 'preview']);
13 +// $bitforms_routes->add('bitform-form-entry-edit/([0-9]+)/?([0-9]+)/?', [FormEntryView::class, 'preview']);
14 +
15 +// if (class_exists('\BitCode\BitFormPro\Admin\DownloadFile')) {
16 +// $routes->add('bitform-download-file', [\BitCode\BitFormPro\Admin\DownloadFile::class, 'download']); // for all users
17 +// $routes->add('bitform-download-pdf', [\BitCode\BitFormPro\Admin\DownloadFile::class, 'adminDownloadPDF']); // for admin users
18 +// }
19 +
20 +add_action('template_redirect', function () {
21 + // form preview
22 + // url structure = siteurl/?bitform-form-view=2
23 + if (isset($_REQUEST['bitform-form-view'])) {
24 + StandaloneFormView::preview();
25 + exit;
26 + }
27 +
28 + // form entry edit
29 + // url structure = siteurl/?bitform-form-entry-edit=1&formid=3&entryid=23
30 + if (isset($_REQUEST['bitform-form-entry-edit'], $_REQUEST['formId'], $_REQUEST['entryId']) && 1 === intval(sanitize_text_field(wp_unslash($_REQUEST['bitform-form-entry-edit'])))) {
31 + FormEntryView::preview();
32 + exit;
33 + }
34 +
35 + //pdf file preview
36 + //url structure = siteurl/?bitform-download-pdf=1&formID=1&pdftemp=1&entryId=35
37 + if (
38 + (isset($_REQUEST['bitform-download-pdf'], $_REQUEST['formID'], $_REQUEST['pdftemp'],$_REQUEST['entryId']) ||
39 + isset($_REQUEST['bitform-download-file'], $_REQUEST['token']))
40 + && class_exists('\BitCode\BitFormPro\Admin\DownloadFile')) {
41 + // admin download pdf
42 + if (1 === intval(sanitize_text_field(wp_unslash($_REQUEST['bitform-download-pdf']))) && !isset($_REQUEST['bitform-download-file'])) {
43 + \BitCode\BitFormPro\Admin\DownloadFile::adminDownloadPDF();
44 + exit;
45 + }
46 +
47 + // all user
48 + if (1 === intval(sanitize_text_field(wp_unslash($_REQUEST['bitform-download-file']))) && !isset($_REQUEST['bitform-download-pdf'])) {
49 + \BitCode\BitFormPro\Admin\DownloadFile::download();
50 + exit;
51 + }
52 + }
53 +});