PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 3.2.3
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v3.2.3
6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 3.6.66 All 195 releases
fluentform / app / Modules / ProcessExteriorModule.php

ProcessExteriorModule.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 3.2.3, at app/Modules/ProcessExteriorModule.php

58 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Modules;
4
5 use FluentForm\App\Modules\Acl\Acl;
6
7 class ProcessExteriorModule
8 {
9 public function handleExteriorPages()
10 {
11 if (isset($_GET['fluentform_pages']) && $_GET['fluentform_pages'] == 1) {
12 if (isset($_GET['preview_id']) && $_GET['preview_id']) {
13 $this->renderFormPreview(intval($_GET['preview_id']));
14 }
15 }
16 }
17
18 public function renderFormPreview($form_id)
19 {
20 if (Acl::hasAnyFormPermission($form_id)) {
21 add_filter('fluentform_is_form_renderable', function ($renderable) {
22 $renderable['status'] = true;
23 return $renderable;
24 });
25
26 $form = wpFluent()->table('fluentform_forms')->find($form_id);
27 if ($form) {
28 echo \FluentForm\View::make('frameless.show_review', [
29 'form_id' => $form_id,
30 'form' => $form
31 ]);
32 exit();
33 }
34 }
35 }
36
37 private function loadDefaultPageTemplate()
38 {
39 add_filter('template_include', function ($original) {
40 return locate_template(['page.php', 'single.php', 'index.php']);
41 });
42 }
43
44 /**
45 * Set the posts to one
46 *
47 * @param WP_Query $query
48 *
49 * @return void
50 */
51 public function pre_get_posts($query)
52 {
53 if ($query->is_main_query()) {
54 $query->set('posts_per_page', 1);
55 }
56 }
57 }
58