3

So with WordPress 4.7 the REST API endpoints will be merged into the core which I'm really looking forward to.

On setting up a test site with the 4.7 beta 4 installed, I wasn't able to find the endpoints that have been available through the REST API Plugin.

Looking at /wp-json I don't see any endpoints either:

{
    "name": "API Test",
    "description": "Eine weitere WordPress-Seite",
    "url": "http:\/\/testsite.net",
    "home": "http:\/\/testsite.net",
    "namespaces": ["oembed\/1.0"],
    "authentication": [],
    "routes": {
        "\/": {
            "namespace": "",
            "methods": ["GET"],
            "endpoints": [{
                "methods": ["GET"],
                "args": {
                    "context": {
                        "required": false,
                        "default": "view"
                    }
                }
            }],
            "_links": {
                "self": "http:\/\/testsite.net\/wp-json\/"
            }
        },
        "\/oembed\/1.0": {
            "namespace": "oembed\/1.0",
            "methods": ["GET"],
            "endpoints": [{
                "methods": ["GET"],
                "args": {
                    "namespace": {
                        "required": false,
                        "default": "oembed\/1.0"
                    },
                    "context": {
                        "required": false,
                        "default": "view"
                    }
                }
            }],
            "_links": {
                "self": "http:\/\/testsite.net\/wp-json\/oembed\/1.0"
            }
        },
        "\/oembed\/1.0\/embed": {
            "namespace": "oembed\/1.0",
            "methods": ["GET"],
            "endpoints": [{
                "methods": ["GET"],
                "args": {
                    "url": {
                        "required": true
                    },
                    "format": {
                        "required": false,
                        "default": "json"
                    },
                    "maxwidth": {
                        "required": false,
                        "default": 600
                    }
                }
            }],
            "_links": {
                "self": "http:\/\/testsite.net\/wp-json\/oembed\/1.0\/embed"
            }
        }
    },
    "_links": {
        "help": [{
            "href": "http:\/\/v2.wp-api.org\/"
        }]
    }
}

Do I still need the plugin or activate those endpoints in the wp-config.php file?

5

According to ticket #38373 the following endpoints will be supported in version 4.7.

Let me quote Rachel Baker:

REST API endpoints for your WordPress content. These endpoints provide machine-readable external access to your WordPress site with a clear, standards-driven interface, allowing new and innovative apps for interacting with your site.

These endpoints support all of the following:

  • Posts: Read and write access to all post data, for all types of post-based data, including pages and media.

  • Comments: Read and write access to all comment data. This includes pingbacks and trackbacks.

  • Terms: Read and write access to all term data.

  • Users: Read and write access to all user data. This includes public access to some data for post authors.

  • Meta: Read and write access to metadata for posts, comments, terms, and users, on an opt-in basis from plugins.

  • Settings: Read and write access to settings, on an opt-in basis from plugins and core. This enables API management of key site content values that are technically stored in options, such as site title and byline.

I'm not sure what version you tested, but I just tested 4.7-beta4-39320 and it seems to have the above endpoints.

You can checkout the changeset in the ticket.

We can e.g. see the new REST controllers here: /wp-includes/rest-api/endpoints

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.