Skip to content

Instantly share code, notes, and snippets.

@ocws-gh
ocws-gh / wordpress_rest_api_sample.js
Last active September 15, 2018 05:19
WordPress REST API 取得表示
export default function getRestApi () {
let $wppost = $('.wp-post ul');
if($wppost.length > 0) {
$.ajax({
url: 'https://koukitips.net/wp-json/wp/v2/posts?per_page=3&_embed'
}).then(
response => {
$.each(response, function(i, item) {
// title
test
{todos.map(todo =>
<Todo
key={todo.id}
{...todo}
onClick={() => onTodoClick(todo.id)}
/>
)}