PluginProbe
Redirection / 3.3
Redirection v3.3
5.10.0 5.9.0 5.8.1 5.8.0 3.7.2 3.7.3 4.0 4.0.1 4.1 4.1.1 4.2 4.2.1 4.2.2 4.2.3 4.3 4.3.1 4.3.2 4.3.3 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6.2 4.7.1 All 130 releases
redirection / actions / error.php

error.php in Redirection 3.3, at actions/error.php

34 lines 682 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Error_Action extends Red_Action {
4 function process_before( $code, $target ) {
5 $this->code = $code;
6
7 wp_reset_query();
8 set_query_var( 'is_404', true );
9
10 add_filter( 'template_include', array( $this, 'template_include' ) );
11 add_filter( 'pre_handle_404', array( $this, 'pre_handle_404' ) );
12 add_action( 'wp', array( $this, 'wp' ) );
13
14 return false;
15 }
16
17 public function wp() {
18 status_header( $this->code );
19 nocache_headers();
20 }
21
22 public function pre_handle_404() {
23 global $wp_query;
24
25 // Page comments plugin interferes with this
26 $wp_query->posts = false;
27 return false;
28 }
29
30 public function template_include() {
31 return get_404_template();
32 }
33 }
34