Title: Ostrichcize
Author: Zack Tollman
Published: <strong>2012 年 11 月 24 日</strong>
Last modified: 2012 年 11 月 24 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/ostrichcize_4c3a2b.svg)

# Ostrichcize

 作者：[Zack Tollman](https://profiles.wordpress.org/tollmanz/)

[下载](https://downloads.wordpress.org/plugin/ostrichcize.0.1.zip)

 * [详情](https://cn.wordpress.org/plugins/ostrichcize/#description)
 * [评价](https://cn.wordpress.org/plugins/ostrichcize/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/ostrichcize/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/ostrichcize/#developers)

 [支持](https://wordpress.org/support/plugin/ostrichcize/)

## 描述

At the first sign of trouble, an ostrich buries its head in the sand. Ostrichcize
allows a plugin or theme developer to
 bury his or her head in the sand by turning
off error reporting for select plugins or the current theme.

If you have ever installed a plugin or worked on a site with a plugin that throws
numerous of errors and notices, but do
 not have the time to fix the issue, you 
can turn off those notices with this plugin. By simply filtering the plugin, you
can add to the list of plugins for which no notices will be shown.

To add to this list simply write something like:

    ```
    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 );
    </pre>
    ```

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 );
    </pre>
    ```

Thanks to Jeremy Felt (@jeremyfelt) for assistance naming the plugin!

## 安装

 1. Install Ostrichcize if not already installed (https://wordpress.org/extend/plugins/
    ostrichcize/)
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Setup Ostrichcize rules as noted above

## 常见问题

  Is there a UI to add ostrichcize rules?

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.

  Can I run this in production?

You certainly can, but that is not the intent of the tool. It is best to only run
this in development.

  What is the use case?

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.

## 评价

![](https://secure.gravatar.com/avatar/c20ed8035774fbf90f733d29f0aa4c7bc7e4173de7295f8ffb30278343e2e9ef?
s=60&d=retro&r=g)

### 󠀁[Works, but wish it had a UI](https://wordpress.org/support/topic/works-but-wish-it-had-a-ui/)󠁿

 [alphatriumph](https://profiles.wordpress.org/alphatriumph/) 2016 年 9 月 3 日

Works, and is nice for those of us who like to use notices/warnings to keep us honest
in our PHP while still utilizing poorly-written plugins. Wish this had a UI to configure
it, instead of just hooks, especially since you need to have a plugin to take advantage
of it.

 [ 阅读所有1条评价 ](https://wordpress.org/support/plugin/ostrichcize/reviews/)

## 贡献者及开发者

「Ostrichcize」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Zack Tollman ](https://profiles.wordpress.org/tollmanz/)
 *   [ 10up ](https://profiles.wordpress.org/10up/)

[帮助将「Ostrichcize」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/ostrichcize)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/ostrichcize/)，查看[SVN仓库](https://plugins.svn.wordpress.org/ostrichcize/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/ostrichcize/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/ostrichcize/)。

## 更新日志

#### 0.1

 * Initial release

## 额外信息

 *  版本 **0.1**
 *  最后更新：**14 年前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 3.3 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/ostrichcize/)
 * 标签
 * [debug](https://cn.wordpress.org/plugins/tags/debug/)[error reporting](https://cn.wordpress.org/plugins/tags/error-reporting/)
 *  [高级视图](https://cn.wordpress.org/plugins/ostrichcize/advanced/)

## 评级

 4 星（最高 5 星）。

 *  [  0 条 5 星评价     ](https://wordpress.org/support/plugin/ostrichcize/reviews/?filter=5)
 *  [  1 条 4 星评价     ](https://wordpress.org/support/plugin/ostrichcize/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/ostrichcize/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/ostrichcize/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/ostrichcize/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/ostrichcize/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/ostrichcize/reviews/)

## 贡献者

 *   [ Zack Tollman ](https://profiles.wordpress.org/tollmanz/)
 *   [ 10up ](https://profiles.wordpress.org/10up/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/ostrichcize/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](http://wordpress.org)