Ryan McCue
Forum Replies Created
-
Forum: Plugins
In reply to: [WordPress REST API (Version 2)] WP REST API Plugin support for PHP 7The WordPress REST API is integrated into WordPress since 4.7, so you no longer need this plugin. Additionally, these are all false positives.
Forum: Fixing WordPress
In reply to: REST Api in WP 4.7You need to be using pretty permalinks to access
/wp-json/. If you’re not, you can instead use?rest_route=/to get the index and?rest_route=/wp/v2/posts(e.g.) for specific routes.There are a few restrictions on the data that’s shown here. In particular, only authors (users with published, publicly-available posts) are available when listing, and only information that’s already public is shown.
In particular, things like ID, username, display names, avatar URLs are all publicly-available via theme templates and feeds. We took specific care when designing the API to only expose what was already there.
If you’re concerned about this being an issue, I’d recommend installing a privacy-related plugin that handles all of these (including feeds), such as iThemes Security (see their post on this topic).
Heads up: I filed this on Trac after finding the problem (PHPUnit’s backupGlobals option). The simple solution is to set
protected $backupGlobals = falsein your unit test.Will continue to investigate the problem there. 🙂
Forum: Plugins
In reply to: [WordPress Importer] Notice: wp_get_http is deprecated since version 4.4!It’s like it got dropped 🙁
Not dropped, just in hibernation, as my focus is split across a lot of different projects. The beta importer now has admin UI in the works and coming soon, see this pull request for more about that. I’ll be writing an update about it soon.
You cannot retrieve the password, as passwords are stored in the database after hashing (which is a one-way, irreversible process). The username is available the
slugproperty on the user, which you can get from/users/meAlso, you should update your version of WordPress 🙂
Forum: Plugins
In reply to: [WP REST API (WP API)] Error trying to activate JSON REST API pluginI pinged @tlovett1 (the author of CCF) about this, but doesn’t look like he’s gotten to it yet. 🙂
Forum: Plugins
In reply to: [WP REST API (WP API)] html tags in content- WP REST API pluginThis sounds like an issue with how you’re outputting
curfilm. Not sure what templating language it is, but maybe try{{{curfilm}}}instead.Forum: Plugins
In reply to: [WP REST API (WP API)] Authentication questionThe REST API uses WP’s built-in authentication system, however requires a nonce to be passed unless specific handling is added for it.
Your best bet for custom authentication is to hook into the
determine_current_userfilter in core to do authentication, and then filterjson_authentication_errorsto integrate with the API.WP_JSON_Server::check_authentication()has documentation on how to use the latter. 🙂Forum: Reviews
In reply to: [Test Plugin 3 - Testing plugin] What the hell is going on here(With thanks to https://ww.wp.xz.cn/support/topic/what-the-hell-is-going-on-here)
Forum: Plugins
In reply to: [WP REST API (WP API)] Getting JSON without a curl callYou should be able to do something like the following:
$endpoint = new WP_JSON_Posts(); $data = $endpoint->get_post( 4 );Forum: Plugins
In reply to: [WP REST API (WP API)] JSONP response add /**/ before the function nameThis is intentional, as it secures against an important security issue.
Why do you need to remove this?
Forum: Reviews
In reply to: [WP REST API (WP API)] It could be betterI’d love to hear any feedback on what exactly we could be doing better here. 🙂
Forum: Plugins
In reply to: [WP REST API (WP API)] Filter by Post DateThis is not currently possible, but we are looking at adding it in a future release.
Forum: Plugins
In reply to: [WP REST API (WP API)] Filterig for post_format?WordPress’ WP Query supports this through the
post_formatarg, but this is not marked as a public query argument. You can add the following to your site’s code to enable it as a public query argument, but keep in mind that it may cause privacy concerns:add_filter( 'json_query_vars', function ( $vars ) { $vars[] = 'post_format'; return $vars; } );