wp-papi / papi

:rocket: WordPress Page Type API with custom fields
https://wp-papi.github.io
MIT License
263 stars 32 forks source link

#116 - Add nl2br setting to text property #135

Closed nlemoine closed 8 years ago

nlemoine commented 8 years ago

Ok, finally got it working. Sorry, I'm not familiar with unit testing and struggled a little bit with it.

Am I wrong or is the test case for text property isn't testing settings at all (allow_html)? I also noticed another notice regarding the papi_nl2br but I will address you an specific issue on this.

I also set the default nl2br setting to true, which seems the best behaviour according to me (regular users don't understand why a line break in a textarea don't show as a line break on the front end). I don't know you feel about this. I can change it if you see things differently.

frozzare commented 8 years ago

No problem, looks like the test you did works.

Text test cases are testing allow_html, so if you select a property that has allow_html => true it will allow html.

Yeah, I think true as a default value for nl2br is good or what do you think @rasmusbe?

rasmusbe commented 8 years ago

I agree that default should be nl2br, but it's a breaking change so be sure to write it in the changelog for papi 3.