Can I get the post id when trying to make a new post using xmlrpc?

This isn’t possible. The post id is only created during post creation in the database; if you see the post id in the admin editing screen before you hit ‘publish’ or ‘save as draft’ then an autosave created the record for you. If you ‘fake’ getting the next post id (such as fetching the highest … Read more

Encrypt API key [duplicate]

There is no point in doing that. Anyone that has access to the DB and the code will be able to decrypt, and the admin is likely to have this kind of access.

Best way to make a JSON API from WordPress?

I dont know how to edit question, I found this: but this way I cannot specify my requests, is there any way to modify this code so that I can specify it? function check_api_data() { if(isset($_GET[‘api’]) ) { if ($_GET[‘api’] == ‘json’){ $args = array( ‘post_status’ => ‘publish’, ‘nopaging’ => true, ‘orderby’ => ‘title’, ‘order’ … Read more

Why does “if statement” has to “die()”, otherwise wont work?

Most likely it’s simply because $_GET[‘first’] is not defined when you try with ?second=case&id=204. Instead, try this CODE (assuming first & second can’t appear at the same time): if (isset($_GET[‘api’])) { if (isset($_GET[‘first’]) && $_GET[‘first’] == ‘case’ && isset($_GET[‘id’])) { // $query is the WP_Query Object $post = get_post($_GET[‘id’]); // $post contains the post object … Read more

Instructure Canvas API with WordPress [closed]

Generally speaking, you will need to create a plugin to accomplish the connection and manipulate data. It looks like Canvas uses JSON in their API. There is a good overview of handling JSON in PHP – the rest you will probably need to piece together from Canvas’s API documentation. Before you get started, make sure … Read more

How to display parent category with first level child in REST API

I am assuming you want these taxonomies data in each item of post_type JSON, but the logic is the same for taxonomies endpoint and JSON response. I see two ways of achieving it. filtering the data using rest_prepare_post_type filter (Reference) or creating new field(s) using the register_rest_field function. (Reference) I would recommend the second approach. … Read more

Expand author, tags and categories in the WordPress JSON API

I figured this out, you have to add _embed=1 to any request so: /posts?_embed=1&orderby=date&order=asc for instance. Then it will include an _embeddable key. Annoyingly all the terms come under here so you have to do some extra work to extract the difference between tags and categories etc.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)