'unapproved') { $status = 'hold'; } return $status; }, [ 'options' => $this->getCommentStatuses(), ] ), new Field( 'wordpress:comment:comment-agent', Field::TYPE_STRING, __('Comment user agent', 'mailpoet'), function (CommentPayload $payload) { $comment = $payload->getComment(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $comment ? $comment->comment_agent : null; } ), new Field( 'wordpress:comment:comment-type', Field::TYPE_STRING, __('Comment type', 'mailpoet'), function (CommentPayload $payload) { $comment = $payload->getComment(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $comment ? $comment->comment_type : null; } ), new Field( 'wordpress:comment:comment-parent', Field::TYPE_INTEGER, __('Comment parent ID', 'mailpoet'), function (CommentPayload $payload) { $comment = $payload->getComment(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $comment ? (int)$comment->comment_parent : null; } ), new Field( 'wordpress:comment:has-children', Field::TYPE_BOOLEAN, __('Comment has replies', 'mailpoet'), function (CommentPayload $payload) { $comment = $payload->getComment(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $comment ? count($comment->get_children()) > 0 : false; } ), ]; } private function getCommentStatuses(): array { $statuses = $this->wp->getCommentStatuses(); return array_values(array_map( function($name, $id): array { return [ 'id' => $id, 'name' => $name, ]; }, $statuses, array_keys($statuses) )); } }
Fatal error: Uncaught Error: Class "MailPoet\Automation\Integrations\WordPress\Fields\CommentFieldsFactory" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:2488 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2518): MailPoetGenerated\FreeCachedContainer->getCommentFieldsFactoryService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2548): MailPoetGenerated\FreeCachedContainer->getCommentSubjectService() #2 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(1675): MailPoetGenerated\FreeCachedContainer->getWordPressIntegrationService() #3 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2640): MailPoetGenerated\FreeCachedContainer->getEngineService() #4 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(122): MailPoetGenerated\FreeCachedContainer->getInitializerService() #5 /htdocs/wp-content/plugins/mailpoet/vendor-prefixed/symfony/dependency-injection/Container.php(110): MailPoetVendor\Symfony\Component\DependencyInjection\Container->make('MailPoet\\Config...', 1) #6 /htdocs/wp-content/plugins/mailpoet/lib/DI/ContainerWrapper.php(39): MailPoetVendor\Symfony\Component\DependencyInjection\Container->get('MailPoet\\Config...') #7 /htdocs/wp-content/plugins/mailpoet/mailpoet_initializer.php(89): MailPoet\DI\ContainerWrapper->get('MailPoet\\Config...') #8 /htdocs/wp-content/plugins/mailpoet/mailpoet.php(194): require_once('/htdocs/wp-cont...') #9 /htdocs/wp-settings.php(526): include_once('/htdocs/wp-cont...') #10 /htdocs/wp-config.php(85): require_once('/htdocs/wp-sett...') #11 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #12 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #13 /htdocs/index.php(17): require('/htdocs/wp-blog...') #14 {main} thrown in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php on line 2488