You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
REST API: Add additional default template data fields for the active theme.
The active theme(s) now return two additional properties, `default_template_types` and `default_template_part_areas`, in the REST response.
Props mamaduka, joemcgill, timothyblynjacobs, audrasjb, gigitux, peterwilsoncc, youknowriad, jorbin.
Fixes #62574.
git-svn-id: https://develop.svn.wordpress.org/trunk@59965 602fd350-edb4-49c9-b593-d223f7449a82
@@ -459,29 +472,29 @@ public function get_item_schema() {
459
472
'title' => 'theme',
460
473
'type' => 'object',
461
474
'properties' => array(
462
-
'stylesheet' => array(
475
+
'stylesheet'=> array(
463
476
'description' => __( 'The theme\'s stylesheet. This uniquely identifies the theme.' ),
464
477
'type' => 'string',
465
478
'readonly' => true,
466
479
),
467
-
'stylesheet_uri' => array(
480
+
'stylesheet_uri'=> array(
468
481
'description' => __( 'The uri for the theme\'s stylesheet directory.' ),
469
482
'type' => 'string',
470
483
'format' => 'uri',
471
484
'readonly' => true,
472
485
),
473
-
'template' => array(
486
+
'template'=> array(
474
487
'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.' ),
475
488
'type' => 'string',
476
489
'readonly' => true,
477
490
),
478
-
'template_uri' => array(
491
+
'template_uri'=> array(
479
492
'description' => __( 'The uri for the theme\'s template directory. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme\'s stylesheet directory.' ),
480
493
'type' => 'string',
481
494
'format' => 'uri',
482
495
'readonly' => true,
483
496
),
484
-
'author' => array(
497
+
'author'=> array(
485
498
'description' => __( 'The theme author.' ),
486
499
'type' => 'object',
487
500
'readonly' => true,
@@ -496,7 +509,7 @@ public function get_item_schema() {
496
509
),
497
510
),
498
511
),
499
-
'author_uri' => array(
512
+
'author_uri'=> array(
500
513
'description' => __( 'The website of the theme author.' ),
501
514
'type' => 'object',
502
515
'readonly' => true,
@@ -513,7 +526,7 @@ public function get_item_schema() {
513
526
),
514
527
),
515
528
),
516
-
'description' => array(
529
+
'description'=> array(
517
530
'description' => __( 'A description of the theme.' ),
518
531
'type' => 'object',
519
532
'readonly' => true,
@@ -528,12 +541,12 @@ public function get_item_schema() {
528
541
),
529
542
),
530
543
),
531
-
'is_block_theme' => array(
544
+
'is_block_theme'=> array(
532
545
'description' => __( 'Whether the theme is a block-based theme.' ),
533
546
'type' => 'boolean',
534
547
'readonly' => true,
535
548
),
536
-
'name' => array(
549
+
'name'=> array(
537
550
'description' => __( 'The name of the theme.' ),
538
551
'type' => 'object',
539
552
'readonly' => true,
@@ -548,23 +561,23 @@ public function get_item_schema() {
548
561
),
549
562
),
550
563
),
551
-
'requires_php' => array(
564
+
'requires_php'=> array(
552
565
'description' => __( 'The minimum PHP version required for the theme to work.' ),
553
566
'type' => 'string',
554
567
'readonly' => true,
555
568
),
556
-
'requires_wp' => array(
569
+
'requires_wp'=> array(
557
570
'description' => __( 'The minimum WordPress version required for the theme to work.' ),
558
571
'type' => 'string',
559
572
'readonly' => true,
560
573
),
561
-
'screenshot' => array(
574
+
'screenshot'=> array(
562
575
'description' => __( 'The theme\'s screenshot URL.' ),
563
576
'type' => 'string',
564
577
'format' => 'uri',
565
578
'readonly' => true,
566
579
),
567
-
'tags' => array(
580
+
'tags'=> array(
568
581
'description' => __( 'Tags indicating styles and features of the theme.' ),
569
582
'type' => 'object',
570
583
'readonly' => true,
@@ -582,18 +595,18 @@ public function get_item_schema() {
582
595
),
583
596
),
584
597
),
585
-
'textdomain' => array(
598
+
'textdomain'=> array(
586
599
'description' => __( 'The theme\'s text domain.' ),
587
600
'type' => 'string',
588
601
'readonly' => true,
589
602
),
590
-
'theme_supports' => array(
603
+
'theme_supports'=> array(
591
604
'description' => __( 'Features supported by this theme.' ),
592
605
'type' => 'object',
593
606
'readonly' => true,
594
607
'properties' => array(),
595
608
),
596
-
'theme_uri' => array(
609
+
'theme_uri'=> array(
597
610
'description' => __( 'The URI of the theme\'s webpage.' ),
598
611
'type' => 'object',
599
612
'readonly' => true,
@@ -610,16 +623,60 @@ public function get_item_schema() {
610
623
),
611
624
),
612
625
),
613
-
'version' => array(
626
+
'version'=> array(
614
627
'description' => __( 'The theme\'s current version.' ),
615
628
'type' => 'string',
616
629
'readonly' => true,
617
630
),
618
-
'status' => array(
631
+
'status'=> array(
619
632
'description' => __( 'A named status for the theme.' ),
620
633
'type' => 'string',
621
634
'enum' => array( 'inactive', 'active' ),
622
635
),
636
+
'default_template_types' => array(
637
+
'description' => __( 'A list of default template types.' ),
638
+
'type' => 'array',
639
+
'readonly' => true,
640
+
'items' => array(
641
+
'type' => 'object',
642
+
'properties' => array(
643
+
'slug' => array(
644
+
'type' => 'string',
645
+
),
646
+
'title' => array(
647
+
'type' => 'string',
648
+
),
649
+
'description' => array(
650
+
'type' => 'string',
651
+
),
652
+
),
653
+
),
654
+
),
655
+
'default_template_part_areas' => array(
656
+
'description' => __( 'A list of allowed area values for template parts.' ),
0 commit comments