From d0dc5cf6d7780d29cd8158f8544aa4c65b2eabba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Peles=CC=8Cev?= Date: Tue, 13 Jan 2015 13:10:30 +0200 Subject: [PATCH] Added errors filtering so plugin/theme authors can intercept error handling. --- wp-ffpc-class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-ffpc-class.php b/wp-ffpc-class.php index 9e3eb64..2fe6ace 100644 --- a/wp-ffpc-class.php +++ b/wp-ffpc-class.php @@ -251,8 +251,11 @@ class WP_FFPC extends PluginAbstract { } } - foreach ( $this->errors as $e => $msg ) { - $this->utils->alert ( $msg, LOG_WARNING, $this->network ); + $filtered_errors = apply_filters('wp_ffpc_post_init_errors_array', $this->errors); + if ($filtered_errors) { + foreach ( $this->errors as $e => $msg ) { + $this->utils->alert ( $msg, LOG_WARNING, $this->network ); + } } }