array( 'type' => 'array', 'items' => array( 'type' => 'string' ), 'description' => __( 'Post types to scan. Defaults to post and page.', 'acrossai-abilities-manager' ), ), 'per_page' => array( 'type' => 'integer', 'default' => 50, 'minimum' => 1, 'maximum' => 200 ), 'page' => array( 'type' => 'integer', 'default' => 1, 'minimum' => 1 ), ); } protected function output_properties(): array { return array( 'items' => array( 'type' => 'array' ), 'count' => array( 'type' => 'integer' ), 'total' => array( 'type' => 'integer' ), 'page' => array( 'type' => 'integer' ), 'pages' => array( 'type' => 'integer' ), ); } protected function required_input(): array { return array(); } protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true ); } /** * @param array $input * @return array|WP_Error */ protected function run( array $input ) { $result = Content_Audit_Repository::audit_faq_blocks( $input ); $result['message'] = 0 === $result['count'] ? __( 'No FAQ block problems were found.', 'acrossai-abilities-manager' ) : sprintf( /* translators: %d: number of posts with FAQ problems */ _n( '%d post has FAQ block problems.', '%d posts have FAQ block problems.', $result['count'], 'acrossai-abilities-manager' ), $result['count'] ); return $result; } }