We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 822dfd4 commit 35bf57aCopy full SHA for 35bf57a
search.php
@@ -4,4 +4,16 @@
4
*
5
* @package multiloquent\template_parts
6
*/
7
-get_template_part('archive');
+
8
+if (empty( $_POST['name_of_nonce_field']) || ! wp_verify_nonce( $_POST['search'], 'search' ) ) {
9
+ // 404 ?
10
+ get_header();
11
+ echo '<div class="container post"> ';
12
+ get_template_part('error-snippet');
13
+ echo '</div>';
14
+ get_footer();
15
+ exit;
16
+} else {
17
+ // process form data
18
+ get_template_part('archive');
19
+}
searchform.php
@@ -14,5 +14,6 @@
<span class="input-group-addon">
<label title="search" for="s" class="" style="margin:0"><span class="fa fa-search fafw"></span></label>
</span>
+ <?php wp_nonce_field('search','search'); ?>
</div>
</form>
0 commit comments