mirror of
https://ghproxy.net/https://github.com/elementor/wp2static.git
synced 2025-08-30 15:52:47 +08:00
ajaxify archive generation
This commit is contained in:
parent
547e3bf2d6
commit
65c7b8475b
5 changed files with 22 additions and 25 deletions
|
@ -43,11 +43,13 @@ function myplugin_init() {
|
|||
}
|
||||
add_action('plugins_loaded', 'myplugin_init');
|
||||
|
||||
add_action( 'wp_ajax_my_action', 'my_action_callback' );
|
||||
add_action( 'wp_ajax_generate_archive', 'generate_archive' );
|
||||
|
||||
function my_action_callback() {
|
||||
function generate_archive() {
|
||||
|
||||
echo 'some response this is!';
|
||||
$plugin = StaticHtmlOutput::getInstance();
|
||||
|
||||
wp_die(); // this is required to terminate immediately and return a proper response
|
||||
$plugin->genArch();
|
||||
|
||||
wp_die();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue