New to Translating WordPress? Read through our Translator Handbook to get started. Hide
| Prio | Original string | Translation | — |
|---|---|---|---|
| ↑ | A RESTful API for WordPress | You have to log in to add a translation. | Details |
Original untranslated |
|||
| ↑ | JSON API | You have to log in to add a translation. | Details |
Original untranslated |
|||
| You should see the test results print out culminating in a summary: | You have to log in to add a translation. | Details | |
Original untranslated
You should see the test results print out culminating in a summary:
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| Change directory to <code>tests</code> and run the following: | You have to log in to add a translation. | Details | |
Original untranslated
Change directory to <code>tests</code> and run the following:
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| From the command line, make sure you have the HTTP_Client PEAR package installed: | You have to log in to add a translation. | Details | |
Original untranslated
From the command line, make sure you have the HTTP_Client PEAR package installed:
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| There are a few necessary steps that need to be carried out before the test suite will run properly. | You have to log in to add a translation. | Details | |
Original untranslated
There are a few necessary steps that need to be carried out before the test suite will run properly.
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| JSON API comes with a set of tests that should make it easier to maintain and reveal incompatibilities when they might occur. This is an ongoing process, I hope to improve the test coverage going forward. | You have to log in to add a translation. | Details | |
Original untranslated
JSON API comes with a set of tests that should make it easier to maintain and reveal incompatibilities when they might occur. This is an ongoing process, I hope to improve the test coverage going forward.
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| The following are constants you can define in your <code>wp-config.php</code> folder: | You have to log in to add a translation. | Details | |
Original untranslated
The following are constants you can define in your <code>wp-config.php</code> folder:
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| It is recommended that custom controllers are kept outside of <code>json-api/controllers</code> in order to avoid accidental deletion during upgrades or site migrations. To make your controller visible from an external plugin or theme directory you will need to use two filters: <code>json_api_controllers</code> and <code>json_api_[controller]_controller_path</code>. Move the <code>hello.php</code> file from the steps above into your theme's directory. Then add the following to your theme's <code>functions.php</code> file (if your theme doesn't have a file called <code>functions.php</code> you can create one). | You have to log in to add a translation. | Details | |
Original untranslated
It is recommended that custom controllers are kept outside of <code>json-api/controllers</code> in order to avoid accidental deletion during upgrades or site migrations. To make your controller visible from an external plugin or theme directory you will need to use two filters: <code>json_api_controllers</code> and <code>json_api_[controller]_controller_path</code>. Move the <code>hello.php</code> file from the steps above into your theme's directory. Then add the following to your theme's <code>functions.php</code> file (if your theme doesn't have a file called <code>functions.php</code> you can create one).
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| Here is an example of how you might use the introspector: | You have to log in to add a translation. | Details | |
Original untranslated
Here is an example of how you might use the introspector:
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| Your controller can use any of the <a href="http://codex.wordpress.org/Function_Reference">existing WordPress functions</a> to collect data, but JSON API also includes an introspector that wraps data in objects defined in the <code>json-api/models</code> directory. These are the same data models described in <em>Section 4: Response objects</em>. | You have to log in to add a translation. | Details | |
Original untranslated
Your controller can use any of the <a href="http://codex.wordpress.org/Function_Reference">existing WordPress functions</a> to collect data, but JSON API also includes an introspector that wraps data in objects defined in the <code>json-api/models</code> directory. These are the same data models described in <em>Section 4: Response objects</em>.
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| Now append the <code>name</code> query var to the method call: <code>http://www.example.org/api/hello/hello_world/?dev=1&name=Alice</code> or <code>http://www.example.org/?json=hello.hello_world&dev=1&name=Alice</code>. | You have to log in to add a translation. | Details | |
Original untranslated
Now append the <code>name</code> query var to the method call: <code>http://www.example.org/api/hello/hello_world/?dev=1&name=Alice</code> or <code>http://www.example.org/?json=hello.hello_world&dev=1&name=Alice</code>.
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| To customize the behavior of your controller, you will want to make use of the global <code>$json_api->query</code> object. Add the following method to your controller: | You have to log in to add a translation. | Details | |
Original untranslated
To customize the behavior of your controller, you will want to make use of the global <code>$json_api->query</code> object. Add the following method to your controller:
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| Next, activate your controller from the WordPress admin interface, available from the menu under Settings > JSON API. You can either click on the link to your <code>hello_world</code> method from the admin interface or enter it manually. It should have the form: <code>http://www.example.org/api/hello/hello_world/?dev=1</code> or <code>http://www.example.org/?json=hello.hello_world&dev=1</code> (note the use of the <code>dev</code> argument to enable human-readable output). You should get the following output: | You have to log in to add a translation. | Details | |
Original untranslated
Next, activate your controller from the WordPress admin interface, available from the menu under Settings > JSON API. You can either click on the link to your <code>hello_world</code> method from the admin interface or enter it manually. It should have the form: <code>http://www.example.org/api/hello/hello_world/?dev=1</code> or <code>http://www.example.org/?json=hello.hello_world&dev=1</code> (note the use of the <code>dev</code> argument to enable human-readable output). You should get the following output:
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
| Your controller is now available as <code>hello</code>, and exposes one <code>hello_world</code> method. | You have to log in to add a translation. | Details | |
Original untranslated
Your controller is now available as <code>hello</code>, and exposes one <code>hello_world</code> method.
CommentFound in remaining content paragraph. You have to log in to edit this translation. |
|||
Export as
Comment
Short description.