Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
WP API (JSON REST API) at WordCamp Hampton Roads
Search
Nikhil Vimal
October 17, 2015
Programming
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WP API (JSON REST API) at WordCamp Hampton Roads
Nikhil Vimal
October 17, 2015
More Decks by Nikhil Vimal
See All by Nikhil Vimal
Utah WordPress Meetup talk (June 2015)
techvoltz
1
420
WordCamp Miami 2015
techvoltz
0
220
The awesome guide to contributing to WordPress
techvoltz
2
240
Getting started with WordPress development
techvoltz
0
80
WordSesh 2 Creatively Creating Custom Post Types
techvoltz
0
270
Creatively Creating Custom Post Types
techvoltz
0
90
Other Decks in Programming
See All in Programming
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
3
360
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.1k
iOSDC2026登壇資料.pdf
riofujimon
0
170
Java 27新機能 / Java 27 new features
kishida
2
150
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
340
What We Talk About When We Talk About XP
m_seki
2
660
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
210
SREの越境 / SRE Collaboration
y0hgi
2
250
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
370
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
440
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
420
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
220
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.9k
How GitHub (no longer) Works
holman
316
150k
Between Models and Reality
mayunak
4
460
Testing 201, or: Great Expectations
jmmastey
46
8.3k
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
850
Claude Code のすすめ
schroneko
67
230k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
240
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Into the Great Unknown - MozCon
thekraken
41
2.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Transcript
Demo Time!
POST, PUT, DELETE, GET The WP API with Nikhil Vimal
Hi! I’m Nikhil V. I’m 16 and I build stuff.
http://v2.wp-api.org/
None
None
https://github.com/WP-API/WP-API
REST? RESTFUL? SLEEP?
Representational state transfer
Something…Something…HTTP
None
None
POST
DELETE
PUT
GET
/wp-json ?
NOPE!
None
/wp-json/wp/v2/posts
$.ajax({ method: "post", url: ‘http://local.dev/wp-json/ wp/v2/posts', data: data, beforeSend: function
( xhr ) { xhr.setRequestHeader( 'X-WP-Nonce', POST_SUBMITTER.nonce ); }, success : function( response ) { console.log( response ); alert( POST_SUBMITTER.success ); }, fail : function( response ) { console.log( response ); alert( POST_SUBMITTER.failure ); } });
So…why does this matter to me?
With great power comes great…
<?php function my_rest_prepare_post( $data, $post, $request ) { $_data =
$data->data; $thumbnail_id = get_post_thumbnail_id( $post->ID ); $thumbnail = wp_get_attachment_image_src( $thumbnail_id ); $_data['featured_image_thumbnail_url'] = $thumbnail[0]; unset($_data['featured_image']); $data->data = $_data; return $data; } add_filter( 'rest_prepare_post', 'my_rest_prepare_post', 10, 3 );
Please Mr. Postman
Slack + WordPress
None
wp.posts().post({ content_raw: 'my content’, title: ‘look at me go’ })
Custom Dashboards!
None
Authentication…UGH
None
http://www.sitepoint.com/wp-api-and- oauth-using-wordpress-without- wordpress/
None
add_filter('rest_enabled', '__return_false');
Fin @TechVoltz