本文整理汇总了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]));
}
}
}
示例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);
}
示例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);
}