Skip to content

Commit f96b884

Browse files
committed
0.2.0
1 parent 8fb35e0 commit f96b884

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
wp-serverless-api.tgz
2+
wp-serverless-api.zip

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.PHONY: archive clean
2+
3+
archive: clean
4+
zip -r wp-serverless-api.zip *.php *.md
5+
6+
clean:
7+
rm -f wp-serverless-api.zip

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@ Explore WordPress data via the WP REST API as a JSON file for static WordPress H
55
1. Install as a WordPress Plugin
66
2. Activate and save or create a new post or page
77
3. Create a new static Artifact on Shifter
8-
4. Visit your new WP Serverless API endpoint at `example.com/wp-content/uploads/wp-sls-api/db.json`
8+
4. Visit your new WP Serverless API endpoint at `example.com/wp-content/wp-sls-api/db.json`
9+
10+
## CHANGELOG
11+
12+
### 0.2.0
13+
14+
- [BREAKING CHANGE] Change save path from `/wp-content/uploads/wp-sls-api/db.json` to `/wp-content/wp-sls-api/db.json`

wp-serverless-api.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
/*
44
Plugin Name: WP Serverless API
5-
Author: Daniel Olson
6-
Author URI: https://github.com/emaildano/wp-serverless-api
5+
Plugin URI: https://github.com/getshifter/wp-serverless-api
76
Description: WordPress REST API to JSON File
7+
Version: 0.2.0
8+
Author: Shifter
9+
Author URI: https://getshifter.io
810
*/
911

1012
function enable_permalinks_notice() {
@@ -51,10 +53,9 @@ function save_db(
5153
$db,
5254
$file_name = 'db.json'
5355
) {
54-
$upload_dir = wp_get_upload_dir();
55-
$save_path = $upload_dir['basedir'] . '/wp-sls-api/' . $file_name;
56+
$save_path = WP_CONTENT_DIR . '/wp-sls-api/' . $file_name;
5657
$dirname = dirname($save_path);
57-
58+
5859
if (!is_dir($dirname))
5960
{
6061
mkdir($dirname, 0755, true);
@@ -74,4 +75,4 @@ function build_db()
7475
/**
7576
* Build on Post Save
7677
*/
77-
add_action( 'save_post', 'build_db' );
78+
add_action( 'save_post', 'build_db' );

0 commit comments

Comments
 (0)