Changeset 58282
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php
r56586 r58282 225 225 * @since 5.0.0 226 226 * @since 5.9.0 Renamed `$theme` to `$item` to match parent class for PHP 8 named parameter support. 227 227 228 * 228 229 * @param WP_Theme $item Theme object. … … 330 331 if ( rest_is_field_included( 'is_block_theme', $fields ) ) { 331 332 $data['is_block_theme'] = $theme->is_block_theme(); 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 332 349 } 333 350 … … 448 465 'readonly' => true, 449 466 ), 467 468 469 470 471 472 450 473 'template' => array( 451 474 'description' => __( 'The theme\'s template. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme\'s stylesheet.' ), 452 475 'type' => 'string', 476 477 478 479 480 481 453 482 'readonly' => true, 454 483 ), -
trunk/tests/phpunit/tests/rest-api/rest-themes-controller.php
r57987 r58282 163 163 * 164 164 * @ticket 45016 165 165 166 */ 166 167 public function test_get_items() { … … 183 184 'status', 184 185 'stylesheet', 186 185 187 'tags', 186 188 'template', 189 187 190 'textdomain', 188 191 'theme_supports', … … 199 202 * 200 203 * @ticket 50152 204 201 205 */ 202 206 public function test_get_items_inactive() { … … 222 226 'status', 223 227 'stylesheet', 228 224 229 'tags', 225 230 'template', 231 226 232 'textdomain', 227 233 'theme_uri', … … 348 354 * 349 355 * @ticket 45016 356 350 357 */ 351 358 public function test_get_item_schema() { … … 353 360 $data = $response->get_data(); 354 361 $properties = $data['schema']['properties']; 355 $this->assertCount( 1 6, $properties );362 $this->assertCount( 1, $properties ); 356 363 357 364 $this->assertArrayHasKey( 'author', $properties ); … … 378 385 $this->assertArrayHasKey( 'status', $properties ); 379 386 $this->assertArrayHasKey( 'stylesheet', $properties ); 387 380 388 381 389 $this->assertArrayHasKey( 'tags', $properties ); … … 385 393 386 394 $this->assertArrayHasKey( 'template', $properties ); 395 387 396 $this->assertArrayHasKey( 'textdomain', $properties ); 388 397 $this->assertArrayHasKey( 'theme_supports', $properties ); … … 536 545 537 546 /** 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 538 578 * @ticket 49906 539 579 */ … … 554 594 $this->assertArrayHasKey( 'template', $result[0] ); 555 595 $this->assertSame( 'default', $result[0]['template'] ); 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 556 627 } 557 628 … … 1274 1345 'status', 1275 1346 'stylesheet', 1347 1276 1348 'tags', 1277 1349 'template', 1350 1278 1351 'textdomain', 1279 1352 'theme_uri',
Note: See TracChangeset
for help on using the changeset viewer.