當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EM_Event::load_postdata方法代碼示例

本文整理匯總了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');
         }
     }
 }
開發者ID:KhanMaytok,項目名稱:events-manager,代碼行數:22,代碼來源:em-ml-admin.php


注:本文中的EM_Event::load_postdata方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。