function delete_all_posts() { require_once "lib" . DIRECTORY_SEPARATOR . "ModelPost.php"; $model_post = new ModelPost(null, null, null, null, null, get_option('elasticsearch_settings_server')); $model_post->documentIndex = get_option('elasticsearch_settings_index_name'); $model_post->deleteAll(); }