Skip to content

Commit

Permalink
Note about undocumented controller usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclay authored Aug 19, 2019
1 parent 3bfcc02 commit a7c4cbc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/pages/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class Preview extends Component {
componentDidMount() {
const { url } = this.props;
const { id, rev, type, wpnonce } = url.query;
// The REST posts controller handles both posts/#/revisions/# and pages/#/revisions/#
// but the latter isn't documented.
fetch(
`${Config.apiUrl}/wp/v2/${type}s/${id}/revisions/${rev}?_wpnonce=${wpnonce}`,
{ credentials: 'include' }, // required for cookie nonce auth
Expand Down

0 comments on commit a7c4cbc

Please sign in to comment.