Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Reusable blocks: Use view context, always include title.raw and content.raw #12084
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
The fix is to stop passing
We therefore both stop passing
How to test
Wasn't able to re-open #11891 so this is a new PR to replace it.
I updated the inline comment to explain how
Given that we should really only ever need the
raw post data, and not the
rendered post data, I'm inclined to think that we should remove
rendered from the returned data. This will help to avoid the confusion from an API perspective.
I've made this change and added some comments explaining the rationale.
Thanks for the eyes, @gziolo!
Contributors aren't allowed to create or edit reusable blocks. It seems that step 1 of your instructions is silently failing and inserting an invalid
It's important that we get the PHP changes in this PR in sooner than later so I think we should address the bug you've found as a separate issue.
There's a few UI issues surrounding reusable blocks and permissions. I'll try to address as many as I can tonight and tomorrow.