wpsc_ajax_activate_boost()
Admin ajax action: activate Jetpack Boost.
No Hooks.
Return
null
. Nothing (null).
Usage
wpsc_ajax_activate_boost();
wpsc_ajax_activate_boost() wpsc ajax activate boost code WPSCache 1.12.4
function wpsc_ajax_activate_boost() { check_ajax_referer( 'activate-boost' ); if ( ! isset( $_POST['source'] ) ) { wp_send_json_error( 'no source specified' ); } $source = sanitize_text_field( wp_unslash( $_POST['source'] ) ); $result = activate_plugin( 'jetpack-boost/jetpack-boost.php' ); if ( is_wp_error( $result ) ) { wp_send_json_error( $result->get_error_message() ); } wpsc_notify_migration_to_boost( $source ); wp_send_json_success(); }