← All changes
|
lib/experimental/dashboard-widgets/class-wp-rest-widget-modules-controller.php
+47
-1
23.8.0
→
trunk
View file →
| @@ -218,8 +218,12 @@ | ||
| 218 | 218 | if ( rest_is_field_included( 'actions', $fields ) ) { |
| 219 | 219 | $data['actions'] = $widget_type->actions; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | + if ( rest_is_field_included( 'attributes', $fields ) ) { | |
| 223 | + $data['attributes'] = $widget_type->attributes; | |
| 224 | + } | |
| 225 | + | |
| 222 | 226 | if ( rest_is_field_included( 'keywords', $fields ) ) { |
| 223 | 227 | $data['keywords'] = $widget_type->keywords; |
| 224 | 228 | } |
| 225 | 229 | |
| @@ -336,13 +340,55 @@ | ||
| 336 | 340 | 'label' => array( 'type' => 'string' ), |
| 337 | 341 | 'icon' => array( 'type' => 'string' ), |
| 338 | 342 | 'relevance' => array( |
| 339 | 343 | 'type' => 'string', |
| 340 | - 'enum' => array( 'high', 'low' ), | |
| 344 | + 'enum' => array( 'high', 'medium', 'low' ), | |
| 341 | 345 | ), |
| 342 | 346 | 'href' => array( 'type' => 'string' ), |
| 343 | 347 | 'download' => array( 'type' => array( 'string', 'boolean' ) ), |
| 344 | 348 | 'openInNewTab' => array( 'type' => 'boolean' ), |
| 349 | + ), | |
| 350 | + ), | |
| 351 | + 'context' => array( 'view', 'edit', 'embed' ), | |
| 352 | + 'readonly' => true, | |
| 353 | + ), | |
| 354 | + | |
| 355 | + 'attributes' => array( | |
| 356 | + 'description' => __( 'Attribute schema hosts render settings from: the JSON-expressible subset of a DataViews field per entry. User-facing strings are translatable.', 'gutenberg' ), | |
| 357 | + 'type' => array( 'array', 'null' ), | |
| 358 | + 'items' => array( | |
| 359 | + 'type' => 'object', | |
| 360 | + 'properties' => array( | |
| 361 | + 'id' => array( 'type' => 'string' ), | |
| 362 | + 'type' => array( 'type' => 'string' ), | |
| 363 | + 'label' => array( 'type' => 'string' ), | |
| 364 | + 'header' => array( 'type' => 'string' ), | |
| 365 | + 'description' => array( 'type' => 'string' ), | |
| 366 | + 'placeholder' => array( 'type' => 'string' ), | |
| 367 | + 'readOnly' => array( 'type' => 'boolean' ), | |
| 368 | + 'isDisabled' => array( 'type' => 'boolean' ), | |
| 369 | + 'enableSorting' => array( 'type' => 'boolean' ), | |
| 370 | + 'enableHiding' => array( 'type' => 'boolean' ), | |
| 371 | + 'enableGlobalSearch' => array( 'type' => 'boolean' ), | |
| 372 | + 'elements' => array( | |
| 373 | + 'type' => 'array', | |
| 374 | + 'items' => array( | |
| 375 | + 'type' => 'object', | |
| 376 | + 'properties' => array( | |
| 377 | + 'value' => array( 'type' => array( 'string', 'integer', 'number', 'boolean', 'null' ) ), | |
| 378 | + 'label' => array( 'type' => 'string' ), | |
| 379 | + 'description' => array( 'type' => 'string' ), | |
| 380 | + ), | |
| 381 | + ), | |
| 382 | + ), | |
| 383 | + 'filterBy' => array( 'type' => array( 'object', 'boolean' ) ), | |
| 384 | + 'format' => array( 'type' => 'object' ), | |
| 385 | + 'isValid' => array( 'type' => 'object' ), | |
| 386 | + 'Edit' => array( 'type' => array( 'string', 'object' ) ), | |
| 387 | + 'relevance' => array( | |
| 388 | + 'type' => 'string', | |
| 389 | + 'enum' => array( 'high', 'medium', 'low' ), | |
| 390 | + ), | |
| 345 | 391 | ), |
| 346 | 392 | ), |
| 347 | 393 | 'context' => array( 'view', 'edit', 'embed' ), |
| 348 | 394 | 'readonly' => true, |