Last active
September 15, 2024 16:02
-
-
Save iwek/7960079 to your computer and use it in GitHub Desktop.
Send WordPress Plugin Activation Errors to a File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('activated_plugin','save_error'); | |
function save_error(){ | |
file_put_contents(ABSPATH. 'wp-content/plugins/PLUGIN_FOLDER/error.html', ob_get_contents()); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Captain’s Log (Stardate 2024.09.15):
“Plugin ‘CleanSweep’ activated. Scotty grumbled about missing semicolons. Spock raised an eyebrow. All systems nominal… except for that pesky whitespace issue in line 42.”
“Scotty’s Scottish Accent” Flavor: error_log("Captain, I cannae change the laws of PHP! But I found a bug in the dilithium matrix (line 23).");