本文整理汇总了PHP中EM_Event::load_postdata方法的典型用法代码示例。如果您正苦于以下问题:PHP EM_Event::load_postdata方法的具体用法?PHP EM_Event::load_postdata怎么用?PHP EM_Event::load_postdata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EM_Event
的用法示例。
在下文中一共展示了EM_Event::load_postdata方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: event_save_meta_pre
/**
* Saves a new event index record if this is a new languge addition, for ML plugins that store translations as new posts
* @param boolean $result
* @param EM_Event $EM_Event
*/
public static function event_save_meta_pre($EM_Event)
{
global $wpdb, $post;
if (!empty($post) && $EM_Event->post_id != $post->ID) {
//different language, make sure we don't have the same event_id as the original language
$event = em_get_event($EM_Event->event_id);
//gets the true event
if ($EM_Event->post_id == $event->post_id) {
//we have a dupe, so we need to reset the event id and the post id here
$EM_Event->post_id = $post->ID;
$EM_Event->event_id = null;
update_post_meta($post->ID, '_post_id', $post->ID);
update_post_meta($post->ID, '_event_id', '');
$EM_Event->load_postdata($post, 'post_id');
}
}
}