From 3939af33969912e52c4c61e2f4c84eb2a63c3615 Mon Sep 17 00:00:00 2001 From: NIU Administrator Date: Thu, 17 Dec 2020 19:26:44 +0900 Subject: [PATCH] force accept to add topic by anonymous user. --- functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 913a2d1..8772510 100644 --- a/functions.php +++ b/functions.php @@ -497,11 +497,12 @@ function cbsonline_wpforo_topic_get_topics($args = [], &$items_count = 0, $count return $topics; } } -// - force approve edit by anonymous user +// - force approve add/edit by anonymous user +add_filter('wpforo_add_topic_data_filter', 'cbsonline_wpforo_edit_topic_data_filter', 100); add_filter('wpforo_edit_topic_data_filter', 'cbsonline_wpforo_edit_topic_data_filter', 100); function cbsonline_wpforo_edit_topic_data_filter($args) { - if (isset($args['name']) && isset($args['email'])) { + if (!is_user_logged_in() && isset($args['name']) && isset($args['email'])) { $args['status'] = 0; }