forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reusable blocks: Use view context, always include title.raw and conte…
…nt.raw (WordPress#12084) * Reusable blocks: Use view context Existing reusable blocks on a post would not render if the user was an author or a contributor. This happened because requests to fetch a single block or post are blocked when ?context=edit is passed and the current user is not an editor. The fix is to stop passing `?context=edit` to block requests, but this causes another problem which is that Gutenberg needs access to both `title.raw` and `content.raw` in the API response. We therefore both stop passing `?context=edit` to block requests *and* modify the blocks API so that `title.raw` and `content.raw` are always provided. Lastly, we modify the blocks API to always omit `content.rendered`, as it doesn't make sense for a reusable block to have rendered content on its own, since rendering a block requires it to be inside a post or a page. * Delete fake user after each test case, not after all test cases * Typo: /** → /* Co-Authored-By: noisysocks <[email protected]> * Create all fake data before any test runs * Omit `title.rendered` from the blocks REST API The rendered title isn't used, so we may as well remove it so that `content` and `title` are aligned. * Fix fetching when using reusable blocks as a contributor * Fix reusable block effect tests * Fix reusable block E2E tests
- Loading branch information
1 parent
2945a62
commit b462725
Showing
6 changed files
with
115 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters