我有一些季节性产品。我想使用“post expirator插件”,但这并没有管理“Annual”选项。所以我想这样做:
function saison(){
$current_month = date(\'M\');
if( $current_month == \'Dec\' || $current_month == \'Jan\' ) {
wp_update_post( array(
\'ID\' => 789,
\'post_status\' => \'publish\'
));
} else {
wp_update_post( array(
\'ID\' => 789,
\'post_status\' => \'draft\'
));
}
}有人知道如何在我的函数中生成这样的东西。php?