WP Async Task

联合创作 · 2023-09-28

WP Async Task 是 TechCrunch 推出的 WordPress 的异步任务插件,该插件用于  TechCrunch.com 网站。

示例代码:

<?php

class JPB_Async_Task extends WP_Async_Task {

    protected $action = 'save_post';

    /**
     * Prepare data for the asynchronous request
     *
     * @throws Exception If for any reason the request should not happen
     *
     * @param array $data An array of data sent to the hook
     *
     * @return array
     */
    protected function prepare_data( $data ) {}

    /**
     * Run the async task action
     */
    protected function run_action( $data ) {}

}
浏览 3
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报