Abstracts WP's remove_all_filters function and fixes export test
This commit is contained in:
@ -26,6 +26,10 @@ class Hooks {
|
|||||||
return self::callWithFallback('remove_action', func_get_args());
|
return self::callWithFallback('remove_action', func_get_args());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function removeAllFilters() {
|
||||||
|
return self::callWithFallback('remove_all_filters', func_get_args());
|
||||||
|
}
|
||||||
|
|
||||||
private static function callWithFallback($func, $args) {
|
private static function callWithFallback($func, $args) {
|
||||||
$local_func = __NAMESPACE__ . '\\' . $func;
|
$local_func = __NAMESPACE__ . '\\' . $func;
|
||||||
if(function_exists($local_func)) {
|
if(function_exists($local_func)) {
|
||||||
|
@ -86,6 +86,7 @@ class DynamicSubscribersGetterTest extends \MailPoetTest {
|
|||||||
$entity->value = $this->subscribers_data[1][1];
|
$entity->value = $this->subscribers_data[1][1];
|
||||||
$entity->save();
|
$entity->save();
|
||||||
|
|
||||||
|
Hooks::removeAllFilters('mailpoet_get_segment_filters');
|
||||||
Hooks::addAction(
|
Hooks::addAction(
|
||||||
'mailpoet_get_segment_filters',
|
'mailpoet_get_segment_filters',
|
||||||
function($segment_id) {
|
function($segment_id) {
|
||||||
|
Reference in New Issue
Block a user