本文整理匯總了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);
}