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

Call prepare_item_for_response() directly in Comment::create_item() #2038

Merged
merged 1 commit into from
Jan 14, 2016

Conversation

danielbachhuber
Copy link
Member

This lets us pass the original request through to
prepare_item_for_response(), giving it genuine context, and avoids an
unnecessary call to get_item()

This lets us pass the original request through to
`prepare_item_for_response()`, giving it genuine context, and avoids an
unnecessary call to `get_item()`
@danielbachhuber
Copy link
Member Author

@joehoyle how do you feel about this pattern? Creating a new WP_REST_Request object always felt a bit hacky to me — I think this is a bit more true.

@joehoyle
Copy link
Member

Yeah I'm +1 for this, seems more lightweight and I don't see anything important skipped.

@danielbachhuber danielbachhuber added this to the 2.0 Beta 11 milestone Jan 14, 2016
danielbachhuber added a commit that referenced this pull request Jan 14, 2016
Call `prepare_item_for_response()` directly in `Comment::create_item()`
@danielbachhuber danielbachhuber merged commit 70b97c7 into develop Jan 14, 2016
@danielbachhuber danielbachhuber deleted the clean-up-comment-internal-get branch January 14, 2016 23:47
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.

2 participants