} ), new Field( 'wordpress:post:ping-status', Field::TYPE_BOOLEAN, __('Post open for pings', 'mailpoet'), function (PostPayload $payload) { $post = $payload->getPost(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $post ? $post->ping_status === 'open' : false; } ), new Field( 'wordpress:post:password', Field::TYPE_STRING, __('Post password', 'mailpoet'), function (PostPayload $payload) { $post = $payload->getPost(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $post ? $post->post_password : null; } ), new Field( 'wordpress:post:slug', Field::TYPE_STRING, __('Post slug', 'mailpoet'), function (PostPayload $payload) { $post = $payload->getPost(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $post ? $post->post_name : null; } ), new Field( 'wordpress:post:parent', Field::TYPE_INTEGER, __('Post parent ID', 'mailpoet'), function (PostPayload $payload) { $post = $payload->getPost(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $post ? $post->post_parent : null; } ), new Field( 'wordpress:post:has-parent', Field::TYPE_BOOLEAN, __('Post has parent', 'mailpoet'), function (PostPayload $payload) { $post = $payload->getPost(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $post ? $post->post_parent > 0 : false; } ), new Field( 'wordpress:post:guid', Field::TYPE_STRING, __('Post guid', 'mailpoet'), function (PostPayload $payload) { $post = $payload->getPost(); return $post ? $post->guid : null; } ), new Field( 'wordpress:post:menu-order', Field::TYPE_INTEGER, __('Post menu order', 'mailpoet'), function (PostPayload $payload) { $post = $payload->getPost(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $post ? $post->menu_order : null; } ), new Field( 'wordpress:post:comment-count', Field::TYPE_INTEGER, __('Number of post comments', 'mailpoet'), function (PostPayload $payload) { $post = $payload->getPost(); //phpcs:ignore Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps return $post ? $post->comment_count : 0; } ), ]; } private function getPostStatuses(): array { $statuses = $this->wp->getPostStatuses(); return array_values(array_map( function($status, $index): array { return [ 'id' => $index, 'name' => $status, ]; }, $statuses, array_keys($statuses) )); } private function getPostTypes(): array { /** @var \WP_Post_Type[] $postTypes */ $postTypes = $this->wp->getPostTypes([], 'objects'); return array_values(array_map( function(\WP_Post_Type $type): array { return [ 'id' => $type->name, 'name' => $type->label, ]; }, array_filter( $postTypes, function(\WP_Post_Type $type): bool { return $type->public; } ) )); } }
Fatal error: Uncaught Error: Class "MailPoet\Automation\Integrations\WordPress\Fields\PostFieldsFactory" not found in /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php:2498 Stack trace: #0 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2528): MailPoetGenerated\FreeCachedContainer->getPostFieldsFactoryService() #1 /htdocs/wp-content/plugins/mailpoet/generated/FreeCachedContainer.php(2548): MailPoetGenerated\FreeCachedContainer->getPostSubjectService() #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 2498