REST API

REST API
An answer from the REST API. It’s a Json object, that was send to a Linux terminal via curl ( it’s a tool to transfer data from or to a server).

“WordPress 4.7 comes with REST API endpoints for posts, comments, terms, users, meta, and settings.” (Source: WordPress’ text about the API).

One of the great news in WordPress 4.7 is the REST API. Now it is possible to exchange data in the form of Json Objects.

Let’s try out the REST API in a simple terminal. In bash try this:

curl http://research-wordpress.dk/wp-json/wp/v2/categories

Perhaps the result above seems like gibberish to the uninitiated. But if we use a Json parser online, you’ll get a human readable result.

The Json object unfolded. You can see one category.
The Json object unfolded. You can see one category.

If you’re eyes are in top condition, you can see:

  • name: “Book Review”
  • description: “As a researcher I read a lot of books … etc.”

So a standard WordPress installation is able to exchange data between a behemoth of platforms, such as apps on mobile devices, and any kind of code that’s able to process Json, such as:

  • Ajax
  • Python
  • Bash
  • PHP
  • Ruby
  • Nodejs
  • etc.

The possibilities are virtually endless. REST API marks a huge step foreward.

Read more: REST API Reference.

Statistics

  • WordPress 102
  • CMS 100 (should include all, in theory but does not)
  • Joomla 11
  • Drupal 8
  • Magento 11

Occurence of the word x in reports at Office365 @BAAA (visited: Oct. 10th 2016)

Take these numbers with a grain of salt. As far as I can see the system counts the occurrence of the word – not the number of reports. A dedicated fan might write WordPress many, many times …

The Core Team

core-groups-puzzle

What does the WP core team do? The WP core is a huge project that involves the coordination of several teams. This plan for the next week in Core gives an idea of complexity of the project:

 

 

Following WP training

Started browsing through the online lessons. Following the debate and progress in general. Skimmed the loop lesson.

IMHO colored syntax and line numbers is missing. It is hard to read the samples.

Also – from a teacher’s point of view – I’d like to know something about the outer framework. How long is the lesson intended to last? How many students are in the class? Where do the students get hands on experience?

I miss a didactic strategy:

  • A time to talk
  • A time to work
  • A time to give feedback

The loop lecture

You cannot set time aside to “install WordPress” in this lecture. If there is no running WP on all PCs you’ll end up using all the time for database or serverside issues. And get nowhere.

When I read a subsection like “Setting up a default loop” there is a # link. But a # does not say anything about the link. So the reader is lost. Text and code mingle in a way that makes the lesson hard to read. Here is a sample:

It sets up all the template tags, like the_title(),
to display the correct information for each item.
–>
<?php while ( have_posts() ) : the_post() ?>

<!–
This code will be repeated for each item in the loop.

Reading stuff like this is hard. Here I’d prefer a colored syntax. And it would be supercool if it was possible to experiment with different loops on the website.

There is room for improvement in the “Make WP training” Codex.