This repository has been archived by the owner on Jun 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
json.php
92 lines (86 loc) · 2.05 KB
/
json.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
/*
Plugin Name: WordPress mobile app REST API
Description: Easily Using the WordPress REST API in a mobile app
Author: Ibrahim Mohamed Abotaleb
Version: 1.1
Author URI: http://mrkindy.com/
Text Domain: tl-json
Domain Path: /languages
*/
/**
* Posts API.
*/
require 'api/posts.php';
/**
* Function to register Posts API.
*/
function tl_register_post_rest_routes() {
$controller = new Tech_Labs_Posts_Controller();
$controller->register_routes();
}
add_action( 'rest_api_init', 'tl_register_post_rest_routes' );
/**
* Users API.
*/
require 'api/users.php';
/**
* Function to register Posts API.
*/
function tl_register_users_rest_routes() {
$controller = new Tech_Labs_Users_Controller();
$controller->register_routes();
}
add_action( 'rest_api_init', 'tl_register_users_rest_routes' );
/**
* Categories API.
*/
require 'api/categories.php';
/**
* Function to register Posts API.
*/
function tl_register_categories_rest_routes() {
$controller = new Tech_Labs_Categories_Controller();
$controller->register_routes();
}
add_action( 'rest_api_init', 'tl_register_categories_rest_routes' );
/**
* Comments API.
*/
require 'api/comments.php';
/**
* Function to register Posts API.
*/
function tl_register_comments_rest_routes() {
$controller = new Tech_Labs_Comments_Controller();
$controller->register_routes();
}
add_action( 'rest_api_init', 'tl_register_comments_rest_routes' );
/**
* Menus API.
*/
require 'api/menus.php';
/**
* Function to register Menus API.
*/
function tl_register_menus_rest_routes() {
$controller = new Tech_Labs_Menus_Controller();
$controller->register_routes();
}
add_action( 'rest_api_init', 'tl_register_menus_rest_routes' );
/**
* Pages API.
*/
require 'api/pages.php';
/**
* Function to register Menus API.
*/
function tl_register_pages_rest_routes() {
$controller = new Tech_Labs_Pages_Controller();
$controller->register_routes();
}
add_action( 'rest_api_init', 'tl_register_pages_rest_routes' );
/**
* Register Mobile Menu.
*/
register_nav_menu( 'Mobile', __( 'Mobile Menu', 'tl-json' ) );