当前位置: 首页>>代码示例>>PHP>>正文


PHP SitePress::get_element_trid方法代码示例

本文整理汇总了PHP中SitePress::get_element_trid方法的典型用法代码示例。如果您正苦于以下问题:PHP SitePress::get_element_trid方法的具体用法?PHP SitePress::get_element_trid怎么用?PHP SitePress::get_element_trid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SitePress的用法示例。


在下文中一共展示了SitePress::get_element_trid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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

示例2:

 function get_post_translations()
 {
     $element_type = $this->package->get_package_element_type();
     $trid = $this->sitepress->get_element_trid($this->package->ID, $element_type);
     return $this->sitepress->get_element_translations($trid, $element_type);
 }
开发者ID:aarongillett,项目名称:B22-151217,代码行数:6,代码来源:wpml-package-translation-metabox.class.php

示例3: get_translations

 public function get_translations()
 {
     $trid = $this->sitepress->get_element_trid($this->wp_post->ID, $this->element_type);
     return $this->sitepress->get_element_translations($trid, $this->element_type);
 }
开发者ID:aarongillett,项目名称:B22-151217,代码行数:5,代码来源:class-wpml-post.php


注:本文中的SitePress::get_element_trid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。