Skip to content

Commit 1a4d8cc

Browse files
author
wokamoto
authored
Merge pull request #2 from getshifter/fix/db.json
ローカル環境でも db.json が生成されるように修正
2 parents f96b884 + 2f4f619 commit 1a4d8cc

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

wp-serverless-api.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: WP Serverless API
55
Plugin URI: https://github.com/getshifter/wp-serverless-api
66
Description: WordPress REST API to JSON File
7-
Version: 0.2.0
7+
Version: 0.2.1
88
Author: Shifter
99
Author URI: https://getshifter.io
1010
*/
@@ -32,12 +32,7 @@ function compile_db(
3232
$db_array = array();
3333

3434
foreach ($routes as $route) {
35-
if (getenv("SHIFTER_ACCESS_TOKEN") === false) {
36-
$url = 'https://demo.wp-api.org/wp-json/wp/v2/' . $route;
37-
} else {
38-
$url = esc_url( home_url( '/' ) ) . 'wp-json/wp/v2/' . $route;
39-
}
40-
35+
$url = esc_url( home_url( '/' ) ) . 'wp-json/wp/v2/' . $route;
4136
$jsonData = json_decode( file_get_contents($url) );
4237

4338
$db_array[$route] = (array) $jsonData;

0 commit comments

Comments
 (0)