Skip to content

Commit a4d39ae

Browse files
attempt to have wp_head and wp_footer() calls in form preview
1 parent b4d1cb3 commit a4d39ae

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

includes/forms/views/preview.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
// fake post to prevent notices in wp_enqueue_scripts call
55
$GLOBALS['post'] = new \WP_Post((object) [ 'filter' => 'raw' ]);
6+
$GLOBALS['wp_query'] = new \WP_Query();
67

78
// render simple page with form in it.
89
?><!DOCTYPE html>
@@ -13,22 +14,18 @@
1314
<meta name="robots" content="noindex">
1415
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
1516
<?php
16-
wp_enqueue_scripts();
17-
wp_print_styles();
18-
wp_print_head_scripts();
19-
20-
if (function_exists('wp_custom_css_cb')) {
21-
wp_custom_css_cb();
22-
}
17+
wp_head();
2318
?>
2419
<style>
20+
html,
2521
body{
2622
background: white;
2723
width: 100%;
28-
max-width: 100%;
2924
text-align: left;
3025
}
3126
<?php // hide all other elements except the form preview ?>
27+
html::before,
28+
html::after,
3229
body::before,
3330
body::after,
3431
body > *:not(#form-preview) {
@@ -41,13 +38,14 @@
4138
padding: 20px;
4239
border: 0;
4340
margin: 0;
41+
box-sizing: border-box;
4442
}
4543
</style>
4644
</head>
4745
<body class="page-template-default page">
4846
<div id="form-preview" class="page type-page status-publish hentry post post-content">
4947
<?php mc4wp_show_form($form_id); ?>
5048
</div>
51-
<?php do_action('wp_footer'); ?>
49+
<?php wp_footer(); ?>
5250
</body>
5351
</html>

0 commit comments

Comments
 (0)