array( 'type' => 'array', 'items' => array( 'type' => 'string', 'enum' => Status_Tools_Repository::PANELS, ), 'description' => __( 'Panels to include. Omit for everything.', 'acrossai-abilities-manager' ), ), ); } protected function output_properties(): array { return array( 'panels' => array( 'type' => 'array' ), 'data' => array( 'type' => 'object' ), 'keys' => array( 'type' => 'array' ), ); } 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 ) { $panels = isset( $input['panels'] ) && is_array( $input['panels'] ) ? $input['panels'] : array(); $result = Status_Tools_Repository::export_settings( $panels ); if ( is_wp_error( $result ) ) { return $result; } $result['message'] = sprintf( /* translators: %s: comma-separated panel names */ __( 'Exported Rank Math settings for: %s.', 'acrossai-abilities-manager' ), array() === $result['panels'] ? __( 'no panels', 'acrossai-abilities-manager' ) : implode( ', ', $result['panels'] ) ); return $result; } }