filmov
tv
Wordpress JSON REST API Tutorial for beginners(#13) How can Register a REST API route in wordpress

Показать описание
In this video we have discussed about,
How can Register a REST API route in wordpress
register_rest_route( string $namespace, string $route, array $args = array(), bool $override = false )
add_action("rest_api_init","owt_first_custom_route");
function owt_first_custom_route(){
register_rest_route("owt/v1","/simple",array(
"method"="GET",
"callback"="call_me_simple_route"
));
}
function call_me_simple_route(){
global $wpdb;
$users_list = $wpdb-get_results(
$wpdb-prepare(
"SELECT * from ".$wpdb-prefix."users ORDER by ID desc",""
),ARRAY_A
);
//return array("status"=1,"message"="Simple Route has been called","method"="GET");
return $users_list;
}
Get All Post
Delete Post
GITHub Link:
Documentation Study:
SOCIAL :
===============
Also you can learn Wordpress Custom
===============
Tags
===================
Wordpress JSON REST API Development tutorial for beginners step by step,
Wordpress JSON REST API Development tutorial,
Wordpress JSON REST API Development tutorial in hindi,
Wordpress JSON REST API Development,
Wordpress JSON REST API Development for beginners,
Wordpress JSON REST API Development tutorial for beginners,
Wordpress JSON REST API Development tutorial for beginners,
Wordpress JSON REST API Development tutorials guide,
learn Wordpress JSON REST API Development framework step by step,
learn Wordpress JSON REST API Development from scratch,
WordPress JSON REST API,
WordPress JSON REST API Development for Beginners: Developing a JSON REST API,
Get started with the WordPress JSON REST API,
The WordPress JSON REST API,
online web tutor,
profotech solutions,
Thanks
Online Web Tutor
Keep learning and Sharing :)
How can Register a REST API route in wordpress
register_rest_route( string $namespace, string $route, array $args = array(), bool $override = false )
add_action("rest_api_init","owt_first_custom_route");
function owt_first_custom_route(){
register_rest_route("owt/v1","/simple",array(
"method"="GET",
"callback"="call_me_simple_route"
));
}
function call_me_simple_route(){
global $wpdb;
$users_list = $wpdb-get_results(
$wpdb-prepare(
"SELECT * from ".$wpdb-prefix."users ORDER by ID desc",""
),ARRAY_A
);
//return array("status"=1,"message"="Simple Route has been called","method"="GET");
return $users_list;
}
Get All Post
Delete Post
GITHub Link:
Documentation Study:
SOCIAL :
===============
Also you can learn Wordpress Custom
===============
Tags
===================
Wordpress JSON REST API Development tutorial for beginners step by step,
Wordpress JSON REST API Development tutorial,
Wordpress JSON REST API Development tutorial in hindi,
Wordpress JSON REST API Development,
Wordpress JSON REST API Development for beginners,
Wordpress JSON REST API Development tutorial for beginners,
Wordpress JSON REST API Development tutorial for beginners,
Wordpress JSON REST API Development tutorials guide,
learn Wordpress JSON REST API Development framework step by step,
learn Wordpress JSON REST API Development from scratch,
WordPress JSON REST API,
WordPress JSON REST API Development for Beginners: Developing a JSON REST API,
Get started with the WordPress JSON REST API,
The WordPress JSON REST API,
online web tutor,
profotech solutions,
Thanks
Online Web Tutor
Keep learning and Sharing :)
Комментарии