array( 'type' => 'string', 'description' => __( 'Optional title substring filter.', 'acrossai-abilities-manager' ), ), 'limit' => array( 'type' => 'integer', 'minimum' => 1, 'maximum' => 200, 'default' => 100, ), 'offset' => array( 'type' => 'integer', 'minimum' => 0, 'default' => 0, ), ); } protected function output_properties(): array { return array( 'forms' => array( 'type' => 'array' ), 'count' => array( 'type' => 'integer' ), ); } protected function required_input(): array { return array(); } protected function annotations(): array { return array( 'readonly' => true, 'destructive' => false, 'idempotent' => true, ); } protected function run( array $input ) { $forms = Form_Repository::list_all( isset( $input['search'] ) ? sanitize_text_field( (string) $input['search'] ) : '', isset( $input['limit'] ) ? absint( $input['limit'] ) : 100, isset( $input['offset'] ) ? absint( $input['offset'] ) : 0 ); return array( 'forms' => $forms, 'count' => count( $forms ), 'message' => sprintf( /* translators: %d: number of forms */ _n( '%d contact form.', '%d contact forms.', count( $forms ), 'acrossai-abilities-manager' ), count( $forms ) ), ); } }