这里会显示出您选择的修订版和当前版本之间的差别。
— |
zblogphp:development:plugin:interfacestc:filter_plugin_postpage_core [2020/07/25 15:38] (当前版本) 唐朝 创建 |
||
---|---|---|---|
行 1: | 行 1: | ||
+ | 案例(晚上10点到次日8点之间发布的页面自动转到草稿栏): | ||
+ | <code php> | ||
+ | function ActivePlugin_tc_cs() { | ||
+ | Add_Filter_Plugin('Filter_Plugin_PostPage_Core','ytecn_postpage_core'); | ||
+ | } | ||
+ | |||
+ | function ytecn_postpage_core(&$article) { | ||
+ | $a=date('H',time()); | ||
+ | $a=(int)$a; | ||
+ | if($a>=22){ | ||
+ | $states=1; | ||
+ | } | ||
+ | if($a<8){ | ||
+ | $states=1; | ||
+ | } | ||
+ | if($states == 1){ | ||
+ | $article->Status=1; | ||
+ | } | ||
+ | } | ||
+ | </code> |