array( 'type' => 'string', 'enum' => array( 'all', 'lscache', 'object', 'opcache', 'css-js', 'ucss', 'front-page' ), 'description' => __( 'Which cache to purge.', 'acrossai-abilities-manager' ), ), ); } protected function required_input(): array { return array( 'target', ); } protected function output_properties(): array { return array( 'target' => array( 'type' => 'string' ), ); } protected function annotations(): array { return array( 'readonly' => false, 'destructive' => false, 'idempotent' => true, ); } protected function run( array $input ) { $target = isset( $input['target'] ) ? (string) $input['target'] : ''; $purged = Purge_Repository::purge( $target ); if ( is_wp_error( $purged ) ) { return $purged; } return array( 'target' => $target, 'message' => sprintf( /* translators: %s: purge target */ __( 'Purged: %s.', 'acrossai-abilities-manager' ), $target ), ); } }