Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Add raw and rendered to schema #2693

Merged
merged 6 commits into from Sep 13, 2016

Conversation

websupporter
Copy link
Member

Solves #2670

For usual posts we give the title, the excerpt, the guid and the content in two formats: raw and rendered. In case of revisions, we just gave the raw content. This PR extends the schema, which acts now like we know it from usual posts.

So, instead of content being a string it would now be an object:

content : {
     raw : "",
     rendered: "",
}

The raw property would only be send when context is set to edit.

@codecov-io
Copy link

codecov-io commented Sep 13, 2016

Current coverage is 94.54% (diff: 97.67%)

Merging #2693 into develop will increase coverage by 0.01%

@@            develop      #2693   diff @@
==========================================
  Files            11         11          
  Lines          3617       3627    +10   
  Methods         172        173     +1   
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits           3419       3429    +10   
  Misses          198        198          
  Partials          0          0          

Powered by Codecov. Last update bb69048...a7525c5

@websupporter
Copy link
Member Author

I'll check the password protected. Not quite sure if its really needed. If its needed, the code is missing the function.

@websupporter
Copy link
Member Author

I've made some tests. When I have a password protected post, the password is not written in the database for the revisions. I've removed the password checks.

@BE-Webdesign
Copy link
Member

Looks good to me! Going to do one last look through, I am not sure the consensus on whether to add this feature but +1 from me. It makes for better potential authoring experiences.

@websupporter
Copy link
Member Author

While I was working on it I was thinking of a small slider for loggedin authors in the front end where they would be able to slide back in history and see their revisions rendered in the frontend. Small toy, but hey. Wouldn't work without the rendered properties.

@kadamwhite
Copy link
Contributor

👍 from @rmccue, myself & @BE-Webdesign. There is an open question voiced by Ryan around whether this change moves Revisions sufficiently close to Posts that they should just extend the posts controller. That will be addressed in a separate issue.

@kadamwhite kadamwhite merged commit 427564a into WP-API:develop Sep 13, 2016
@danielbachhuber danielbachhuber modified the milestone: 2.0 Beta 14 Sep 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants