在事件结束时间之后使事件发布过期

时间:2019-03-06 16:43:56

标签: php wordpress

我目前有以下代码:

<?php

global $post;

$date = get_post_meta( $post->ID, 'snbp_event_date', true );

$newDate = date("M<\b\\r><\\s\\t\\r\\o\\n\\g>d</\\s\\t\\r\\o\\n\\g><\b\\r>Y", strtotime($date));

$nowdate = date('M<\b\\r><\\s\\t\\r\\o\\n\\g>d</\\s\\t\\r\\o\\n\\g><\b\\r>Y');

$now = date("M-d-Y", strtotime($date));
$then = date("M-d-Y");
$then2 = strtotime($then);

$exp_date = $date;
$todays_date = date("Y-m-d");

$today = strtotime($todays_date);
$expiration_date = strtotime($exp_date);

echo $newDate

?>

我正在努力做到这一点,以便主题在活动结束后将事件发送到past-events

当前时间保存在以下函数snbp_event_time中,格式为9:00 am - 11:00 am

看来,事件本身结束之前,事件已转换为past-events。我正在尝试编辑函数,以便当前事件在结束后添加past-event类型-而不是在事件进行期间。

注意-事件通常从10p-3a开始运行,这就是为什么我认为事件在结束时间之前“过期”。

任何帮助将不胜感激!

0 个答案:

没有答案
相关问题