开发者 |
tollmanz
10up |
---|---|
更新时间 | 2012年11月24日 11:28 |
PHP版本: | 3.3 及以上 |
WordPress版本: | trunk |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
function my_ostrichcized_plugins( $slugs ) {
$slugs[] = 'debug-bar-cron';
return $slugs;
}
function my_pre_my_ostrichcized_plugins() {
add_filter( 'ostrichcized_plugins', 'my_ostrichcized_plugins' );
}
add_action( 'plugins_loaded', 'my_pre_my_ostrichcized_plugins', 1 );
Note that the filter must be added before any offending code is run in order to redefine the error reporting function
before it is first called. The means that in most cases, this code will need to run from a plugin and not a theme.
To turn off PHP error reporting for a theme, run:
function my_ostrichcize_theme() {
add_filter( 'ostrichcize_theme', '__return_true' );
}
add_action( 'plugins_loaded', 'my_ostrichcize_theme', 1 );
Thanks to Jeremy Felt (@jeremyfelt) for assistance naming the plugin!
No. At this time, I really only want developer's using this tool. Any WordPress developer that is messing with error handling should easily be able to make this plugin work. If not, the developer should not be using this tool. Similarly, users should not be messing with error reporting.
You certainly can, but that is not the intent of the tool. It is best to only run this in development.
This plugin is inspired by having installed countless plugins that throw error notices. Many times, these are small, non-critical errors. Since I often do not have time to fix the errors myself, I allow them to continue to muck up my error logs or on screen display of errors. I thought it would be nice to have a way to hide these errors so that only errors due to my custom code are displayed. Ostrichcize allows you to do just that.