Ryan McCue
Forum Replies Created
-
Forum: Plugins
In reply to: [WP REST API (WP API)] Authentication hacksBasic Authentication is being moved to a plugin in the future; see #37
dunar21 answered this one perfectly, closing as resolved.
This is a duplicate of the other post, so I’m marking this one as resolved.
I can post articles, but the content field is ignored. Oddly the content_raw works.
Why is the content field ignored ?
The
contentfield is the parsed content ready for output onto the page, including HTML sanitisation, shortcode replacement and oEmbed parsing. Thecontent_rawfield contains the exact data as stored in the database, and it’s this value that can be edited.Also, I spent a while trying to post a different type of post using ‘post-type’ (https://github.com/WP-API/WP-API/blob/master/docs/schema.md). It works with ‘type’, I mis-read the docs, other people might too.
Ah, sorry about that, the
post-typebit is meant to be the ABNF for it, not the actual field name. That could be confusing though.Forum: Plugins
In reply to: [WP REST API (WP API)] WPML compatibility?Support for WPML is not planned, and is something that needs to be added on the WPML side once this is integrated into core.
but how do I access $context from ‘json_prepare_post’ filter? I tried, doesn’t look like it’s passed in there, php throws an error – what values $context can have?
You’ll need to make sure you get all the parameters by passing
3for the parameter-count value toadd_filter:add_filter( 'json_prepare_post', 'myfunc', 10, 3 );With this, you should get all of the parameter values correctly passed in.
Hi! This looks like a bug we ran into with multisite; it should be fixed in the next version. Thanks for reporting this. π
Forum: Plugins
In reply to: [WP REST API (WP API)] URL rewrite from /wp-json.php to /apiAt the moment, you have to edit the main file yourself. I’ve filed an issue for this. Thanks!
Hi!
That should certainly be possible, however you’ll need to write the logic to bring it across yourself. Theoretically, you could do something like…
$response = wp_remote_get( 'http://example.com/wp-json/posts/4' ); $new_response = wp_remote_post( 'http://example.org/wp-json/posts' );With regards to documentation, take a look at the GitHub repo for that.
Thanks.
Queries aren’t handled the same in WP API, so what you want to do is look at the value of
$contextand base your result off that.Forum: Plugins
In reply to: [WP REST API (WP API)] wp-json.php works OK but all other URLS 404The integrated option is not recommended, and will break at the moment. Sorry about the unclear documentation on that.
Forum: Plugins
In reply to: [WP REST API (WP API)] Filter by meta key/valueThe plugin internally uses the is_protected_meta() function, which has the
is_protected_metafilter.If that doesn’t work, let me know. π
Forum: Plugins
In reply to: [WP REST API (WP API)] php 5.3.x DateTime::createFromFormat()Filed as issue #52. Thanks!
Forum: Plugins
In reply to: [WP REST API (WP API)] How Retrieve all category name ?This should be fixed in 0.7. π
Forum: Plugins
In reply to: [WP REST API (WP API)] Link Header duplicate ?Confirmed and filed, thanks!