Initial import of 404 Enhacer

This commit is contained in:
2026-11-16 12:24:05 -05:00
commit cf03c388c3
15 changed files with 1724 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
<?php
error_reporting( E_ALL );
ini_set( 'display_errors', '1' );
define( 'WP_USE_THEMES', true );
$_SERVER['REQUEST_URI'] = '/this-page-does-not-exist-2024/';
$_SERVER['REQUEST_METHOD'] = 'GET';
require dirname( __DIR__, 3 ) . '/wp-load.php';
echo "loaded WP " . get_bloginfo( 'version' ) . "\n";
echo "stylesheet: " . get_stylesheet() . "\n";
echo "template: " . get_template() . "\n";
$GLOBALS['wp_query']->set_404();
echo "is_404: " . var_export( is_404(), true ) . "\n";
echo "plugin active: " . var_export( is_plugin_active( '404-enhancer/404-enhancer.php' ), true ) . "\n";
echo "template_include filter result: " . apply_filters( 'template_include', 'x' ) . "\n";
ob_start();
include dirname( __DIR__ ) . '/templates/404.php';
$html = ob_get_clean();
echo "rendered len=" . strlen( $html ) . "\n";
echo substr( $html, 0, 300 ) . "\n";