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


PHP SitePress::set_element_language_details方法代碼示例

本文整理匯總了PHP中SitePress::set_element_language_details方法的典型用法代碼示例。如果您正苦於以下問題:PHP SitePress::set_element_language_details方法的具體用法?PHP SitePress::set_element_language_details怎麽用?PHP SitePress::set_element_language_details使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SitePress的用法示例。


在下文中一共展示了SitePress::set_element_language_details方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: prepare_missing_originals

 /**
  * Assigns language information to terms that are to be treated as originals at the time of
  * their taxonomy being set to translated instead of 'do nothing'.
  */
 private function prepare_missing_originals()
 {
     foreach ($this->missing_terms as $ttid => $missing_lang_data) {
         if (!isset($this->data[$ttid]['tlang']['trid'])) {
             foreach ($missing_lang_data as $lang => $post_ids) {
                 $this->sitepress->set_element_language_details($ttid, 'tax_' . $this->taxonomy, null, $lang);
                 $trid = $this->sitepress->get_element_trid($ttid, 'tax_' . $this->taxonomy);
                 if ($trid) {
                     $this->data[$ttid]['tlang']['trid'] = $trid;
                     $this->data[$ttid]['tlang']['lang'] = $lang;
                     unset($this->missing_terms[$ttid][$lang]);
                     break;
                 }
             }
         }
         if (isset($this->data[$ttid]['tlang']['trid'])) {
             $this->prepare_missing_translations($this->data[$ttid]['tlang']['trid'], $this->data[$ttid]['tlang']['lang'], array_keys($this->missing_terms[$ttid]));
         }
     }
 }
開發者ID:aarongillett,項目名稱:B22-151217,代碼行數:24,代碼來源:wpml-term-language-synchronization.class.php


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