【文件属性】:
文件名称:WP_Cron:WordPress Cron系统中更好的API
文件大小:2KB
文件格式:ZIP
更新时间:2021-05-08 09:57:13
PHP
WP_Cron
将API清理到WordPress的Cron系统中
WP_Cron是一个简单易用的类,用于在WordPress中定义cron事件。 简单地,定义一个扩展WP_Cron的类,使用$ every属性设置cron事件的发生频率,然后在handle()方法中编写要执行的代码。
<?php
Class UpdateLondonWeather extends WP_Cron {
public $ every = [
'seconds' => 30 ,
'minutes' => 15 ,
'hours' => 1 ,
];
public function handle (){
$ response = file_get_contents ( 'http://api.openw
【文件预览】:
WP_Cron-master
----src()
--------WP_Cron.php(2KB)
----readme.md(1012B)