Repository navigation
Commit 4603e92
committed
Media: Skip the edit root link when the edit root cannot be read.
The `wp:edit-root` link promises that `_embed` can fetch the edit root, but
the recorded ID is not checked, so an edit root that no longer exists, or
one the user cannot read, was still offered as a link.
The link now uses the same check as the `featured_media` link: it is added
only when the edit root is published or the user can read it. The
`edit_root` field still reports the recorded ID as is.
Follows WordPress/gutenberg#81803.
See #65987.1 parent ea3620e commit 4603e92
2 files changed
Lines changed: 30 additions & 1 deletion
File tree
- src/wp-includes/rest-api/endpoints
- tests/phpunit/tests/rest-api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1694 | 1694 | | |
1695 | 1695 | | |
1696 | 1696 | | |
| 1697 | + | |
| 1698 | + | |
1697 | 1699 | | |
1698 | 1700 | | |
1699 | 1701 | | |
1700 | 1702 | | |
1701 | 1703 | | |
1702 | 1704 | | |
1703 | 1705 | | |
1704 | | - | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
1705 | 1710 | | |
1706 | 1711 | | |
1707 | 1712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6567 | 6567 | | |
6568 | 6568 | | |
6569 | 6569 | | |
| 6570 | + | |
| 6571 | + | |
| 6572 | + | |
| 6573 | + | |
| 6574 | + | |
| 6575 | + | |
| 6576 | + | |
| 6577 | + | |
| 6578 | + | |
| 6579 | + | |
| 6580 | + | |
| 6581 | + | |
| 6582 | + | |
| 6583 | + | |
| 6584 | + | |
| 6585 | + | |
| 6586 | + | |
| 6587 | + | |
| 6588 | + | |
| 6589 | + | |
| 6590 | + | |
| 6591 | + | |
| 6592 | + | |
| 6593 | + | |
6570 | 6594 | | |
6571 | 6595 | | |
6572 | 6596 | | |
| |||
0 commit comments