PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.7
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.7
6.2.14 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 All 196 releases
fluentform / app / Modules / ProcessExteriorModule.php

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

69 lines 1.8 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 defined('ABSPATH') or die;
6
7 use FluentForm\App\Models\Form;
8 use FluentForm\App\Modules\Acl\Acl;
9
10 class ProcessExteriorModule
11 {
12 public function handleExteriorPages()
13 {
14 if (defined('CT_VERSION')) {
15 // oxygen page compatibility
16 remove_action('wp_head', 'oxy_print_cached_css', 999999);
17 }
18 wp_register_script(
19 'fluentform_editor_helper',
20 fluentFormMix('js/fluent_forms_editor_helper.js'),
21 array('jquery'),
22 FLUENTFORM_VERSION,
23 true
24 );
25 $this->renderFormPreview(intval(wpFluentForm('request')->get('preview_id')));
26 }
27
28 public function renderFormPreview($form_id)
29 {
30 if (Acl::hasAnyFormPermission($form_id)) {
31 add_filter('fluentform/is_form_renderable', function ($renderable) {
32 $renderable['status'] = true;
33 return $renderable;
34 });
35
36 $form = Form::find($form_id);
37 if ($form) {
38 wp_enqueue_script('fluentform_editor_helper');
39 wpFluentForm('view')->render('frameless.show_preview', [
40 'form_id' => $form_id,
41 'form' => $form,
42 ]);
43 exit();
44 }
45 }
46 }
47
48 private function loadDefaultPageTemplate()
49 {
50 add_filter('template_include', function ($original) {
51 return locate_template(['page.php', 'single.php', 'index.php']);
52 });
53 }
54
55 /**
56 * Set the posts to one
57 *
58 * @param WP_Query $query
59 *
60 * @return void
61 */
62 public function pre_get_posts($query)
63 {
64 if ($query->is_main_query()) {
65 $query->set('posts_per_page', 1);
66 }
67 }
68 }
69