Repository navigation
Commit 8548db3
committed
REST API: Serve response data that is not an array as returned.
`rest_filter_response_fields()` leaves the response unchanged when its
data is not an array, and keeps list items that are not arrays.
`WP_REST_Server::response_to_data()` returns scalar and object data as
it is instead of adding links to it, and leaves list items that are not
arrays alone when embedding. Routes that return such data no longer
need the `response_processing` option to avoid type errors.
See #66267.1 parent 6684a86 commit 8548db3
4 files changed
Lines changed: 60 additions & 14 deletions
File tree
- src/wp-includes
- rest-api
- tests/phpunit/tests
- blocks
- rest-api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
950 | 950 | | |
951 | 951 | | |
952 | 952 | | |
953 | | - | |
| 953 | + | |
| 954 | + | |
954 | 955 | | |
955 | 956 | | |
956 | 957 | | |
| |||
972 | 973 | | |
973 | 974 | | |
974 | 975 | | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
975 | 981 | | |
976 | 982 | | |
977 | 983 | | |
| |||
1002 | 1008 | | |
1003 | 1009 | | |
1004 | 1010 | | |
1005 | | - | |
| 1011 | + | |
1006 | 1012 | | |
1007 | 1013 | | |
1008 | 1014 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
| 581 | + | |
581 | 582 | | |
582 | | - | |
| 583 | + | |
583 | 584 | | |
584 | 585 | | |
585 | 586 | | |
| |||
624 | 625 | | |
625 | 626 | | |
626 | 627 | | |
627 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
628 | 631 | | |
629 | 632 | | |
630 | 633 | | |
631 | 634 | | |
632 | 635 | | |
633 | 636 | | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
| 637 | + | |
| 638 | + | |
640 | 639 | | |
641 | 640 | | |
642 | | - | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
643 | 648 | | |
644 | 649 | | |
645 | 650 | | |
| |||
653 | 658 | | |
654 | 659 | | |
655 | 660 | | |
656 | | - | |
| 661 | + | |
657 | 662 | | |
658 | 663 | | |
659 | 664 | | |
| |||
933 | 938 | | |
934 | 939 | | |
935 | 940 | | |
| 941 | + | |
936 | 942 | | |
937 | 943 | | |
938 | 944 | | |
939 | 945 | | |
940 | | - | |
| 946 | + | |
941 | 947 | | |
942 | 948 | | |
943 | 949 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
900 | 900 | | |
901 | 901 | | |
902 | 902 | | |
903 | | - | |
| 903 | + | |
904 | 904 | | |
905 | 905 | | |
906 | 906 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3494 | 3494 | | |
3495 | 3495 | | |
3496 | 3496 | | |
| 3497 | + | |
| 3498 | + | |
| 3499 | + | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
| 3505 | + | |
| 3506 | + | |
| 3507 | + | |
| 3508 | + | |
| 3509 | + | |
| 3510 | + | |
| 3511 | + | |
| 3512 | + | |
| 3513 | + | |
| 3514 | + | |
| 3515 | + | |
| 3516 | + | |
| 3517 | + | |
| 3518 | + | |
| 3519 | + | |
| 3520 | + | |
| 3521 | + | |
| 3522 | + | |
| 3523 | + | |
| 3524 | + | |
| 3525 | + | |
| 3526 | + | |
| 3527 | + | |
| 3528 | + | |
| 3529 | + | |
| 3530 | + | |
3497 | 3531 | | |
0 commit comments