advanced-access-manager
Last commit date
application
11 months ago
lang
11 months ago
media
11 months ago
vendor
11 months ago
aam.php
11 months ago
autoloader.php
11 months ago
index.php
11 months ago
license.txt
11 months ago
readme.txt
11 months ago
index.php
27 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AAM; |
| 4 | |
| 5 | // Let's determine if core WP load file reachable |
| 6 | $wp_load_fl = realpath(dirname(__DIR__, 3) . '/wp-load.php'); |
| 7 | |
| 8 | if (is_string($wp_load_fl) && file_exists($wp_load_fl)) { |
| 9 | require_once $wp_load_fl; |
| 10 | |
| 11 | global $wp_query; |
| 12 | |
| 13 | if (is_a($wp_query, \WP_Query::class)) { |
| 14 | $wp_query->set_404(); |
| 15 | } |
| 16 | |
| 17 | status_header(404); |
| 18 | nocache_headers(); |
| 19 | |
| 20 | $not_found_tmpl = get_404_template(); |
| 21 | |
| 22 | if (!empty($not_found_tmpl) && file_exists($not_found_tmpl)) { |
| 23 | include $not_found_tmpl; |
| 24 | } |
| 25 | } else { |
| 26 | http_response_code(404); |
| 27 | } |