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