Skip to content

Commit fffa64a

Browse files
committed
updated formatting
1 parent 8d8dec3 commit fffa64a

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

wp-serverless-api.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,23 @@ function build_db()
7171
save_db($db);
7272
}
7373

74-
add_action( 'save_post', 'build_db' );
74+
/**
75+
* Build on Post Save
76+
*/
77+
add_action( 'save_post', 'build_db' );
78+
79+
/**
80+
* Build on Plugin Activation
81+
*/
82+
function wp_sls_api_activation_hook() {
83+
build_db();
84+
}
85+
86+
add_action( 'init', 'wp_sls_api_activation_hook' );
87+
88+
function wp_sls_api_install() {
89+
activation_hook();
90+
flush_rewrite_rules();
91+
}
92+
93+
register_activation_hook( __FILE__, 'wp_sls_api_install' );

0 commit comments

Comments
 (0)