File tree Expand file tree Collapse file tree 4 files changed +23
-7
lines changed
Expand file tree Collapse file tree 4 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 1+ wp-serverless-api.tgz
2+ wp-serverless-api.zip
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -5,4 +5,10 @@ Explore WordPress data via the WP REST API as a JSON file for static WordPress H
551 . Install as a WordPress Plugin
662 . Activate and save or create a new post or page
773 . 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 `
Original file line number Diff line number Diff line change 22
33/*
44Plugin 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
76Description: WordPress REST API to JSON File
7+ Version: 0.2.0
8+ Author: Shifter
9+ Author URI: https://getshifter.io
810*/
911
1012function 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 ' );
You can’t perform that action at this time.
0 commit comments