Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

posts endpoint example code PHP/jQuery #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Shelob9
Copy link
Contributor

@Shelob9 Shelob9 commented Nov 4, 2014

#33

I am submitting this pull request to give context to my questions in #33 about where this should go. Line 1-5 of the PHP example is mostly general information that should go in an introductory section or one of the existing guides.


All URLs should be constructed using either the function `json_url()` or `get_json_url()` when using multisite. These functions will return the root URL for the API, according to the current permalink structure. In addition, they will take into account the current value of the 'json_url' filter, which can be used to change the root url for the API.

The URL for the simplest request to the posts route, which would return the most recent posts, would be constructed with `json_url( 'posts' );`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gives you the URL for the local installation, but if you're running this locally, it's simpler just to run the code internally. Presumably you'll want external URLs instead.

@Shelob9
Copy link
Contributor Author

Shelob9 commented Nov 4, 2014

I made changes based on feedback form @rmccue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants