From cbfedff19c896f9b8c1af3ccda71426c3899abb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Maneiro?= <583546+oandregal@users.noreply.github.com> Date: Mon, 31 Aug 2026 11:32:10 +0200 Subject: [PATCH] REST API: Describe the table column styles in the view config schema. Add `description`s to the `styles` property of the table layout schema and to the `ColumnStyle` properties (`width`, `maxWidth`, `minWidth`, `align`), noting that the styles apply to the columns listed in the view fields and not to the primary column, which takes the width the other columns leave over. See #65577. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_017uRqWebcZN8rBktaVL8UUV --- .../class-wp-rest-view-config-controller.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php index 64c1ebe1ba921..42a02018d0dfc 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-view-config-controller.php @@ -508,17 +508,21 @@ protected function get_column_style_schema() { 'type' => 'object', 'properties' => array( 'width' => array( - 'type' => array( 'string', 'number' ), + 'description' => __( 'The width of the column.' ), + 'type' => array( 'string', 'number' ), ), 'maxWidth' => array( - 'type' => array( 'string', 'number' ), + 'description' => __( 'The maximum width of the column.' ), + 'type' => array( 'string', 'number' ), ), 'minWidth' => array( - 'type' => array( 'string', 'number' ), + 'description' => __( 'The minimum width of the column.' ), + 'type' => array( 'string', 'number' ), ), 'align' => array( - 'type' => 'string', - 'enum' => array( 'start', 'center', 'end' ), + 'description' => __( 'The horizontal alignment of the column content.' ), + 'type' => 'string', + 'enum' => array( 'start', 'center', 'end' ), ), ), ); @@ -536,6 +540,7 @@ protected function get_table_layout_schema() { 'type' => 'object', 'properties' => array( 'styles' => array( + 'description' => __( 'Column styles keyed by field id, for the columns listed in the view fields. The primary column (title, media, and description fields) takes the width left over by the other columns and ignores these styles.' ), 'type' => 'object', 'additionalProperties' => $this->get_column_style_schema(), ),