Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Suppress errors generated by specified WordPress plugins.
- *
- * Put this in /wp-content/mu-plugins/
- *
- * @param string $errno The error number.
- * @param string $errstr The error message.
- * @param string $errfile Path to the file that caused the error.
- * @param int $errline Line number of the error.
- * @return bool True to suppress error reporting; false to use default error handler.
- */
- function my_error_handler( $errno, $errstr, $errfile, $errline ) {
- if ( E_STRICT == $errno ) {
- // Return true to disable all strict notices.
- //return true;
- }
- // bbPress creates this when the current user is set up too early
- if ( false !== strpos( $errstr, 'bbp_setup_current_user was called' ) ) {
- return true;
- }
- // BuddyPress creates this when the current user is set up too early
- if ( false !== strpos( $errstr, 'bp_setup_current_user was called' ) ) {
- return true;
- }
- // Older BuddyPress group extensions
- if ( false !== strpos( $errstr, 'Group_Extension::display' ) ) {
- return true;
- }
- // CBOX Theme
- $patterns = array(
- 'themes/cbox-theme',
- );
- foreach ( $patterns as $pattern ) {
- $pattern = str_replace( array( '/', '\\' ), DIRECTORY_SEPARATOR, $pattern );
- if ( false !== strpos( $errstr, $pattern ) ) {
- return true;
- }
- if ( false !== strpos( $errfile, $pattern ) ) {
- return true;
- }
- }
- // The path was not found, so report the error.
- return false;
- }
- set_error_handler( 'my_error_handler' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement