PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 3.6.21
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v3.6.21
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.6.21, at app/Modules/ProcessExteriorModule.php

59 lines 1.4 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(defined('CT_VERSION')) {
12 // oxygen page compatibility
13 remove_action( 'wp_head', 'oxy_print_cached_css', 999999 );
14 }
15
16 $this->renderFormPreview(intval($_GET['preview_id']));
17 }
18
19 public function renderFormPreview($form_id)
20 {
21 if (Acl::hasAnyFormPermission($form_id)) {
22 add_filter('fluentform_is_form_renderable', function ($renderable) {
23 $renderable['status'] = true;
24 return $renderable;
25 });
26
27 $form = wpFluent()->table('fluentform_forms')->find($form_id);
28 if ($form) {
29 echo \FluentForm\View::make('frameless.show_review', [
30 'form_id' => $form_id,
31 'form' => $form
32 ]);
33 exit();
34 }
35 }
36 }
37
38 private function loadDefaultPageTemplate()
39 {
40 add_filter('template_include', function ($original) {
41 return locate_template(['page.php', 'single.php', 'index.php']);
42 });
43 }
44
45 /**
46 * Set the posts to one
47 *
48 * @param WP_Query $query
49 *
50 * @return void
51 */
52 public function pre_get_posts($query)
53 {
54 if ($query->is_main_query()) {
55 $query->set('posts_per_page', 1);
56 }
57 }
58 }
59