本文整理匯總了PHP中TranslationManagement::save_settings方法的典型用法代碼示例。如果您正苦於以下問題:PHP TranslationManagement::save_settings方法的具體用法?PHP TranslationManagement::save_settings怎麽用?PHP TranslationManagement::save_settings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TranslationManagement
的用法示例。
在下文中一共展示了TranslationManagement::save_settings方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: update_tm_settings
private function update_tm_settings(array $config)
{
$section_singular = $this->index_singular;
$config = array_filter($config);
$config[$section_singular] = isset($config[$section_singular]) ? $config[$section_singular] : array();
$this->sync_settings($config);
// taxonomies - check what's been removed
if (!empty($this->tm_instance->settings[$this->index_ro])) {
$config_values = array();
foreach ($config[$section_singular] as $config_value) {
$config_values[$config_value['value']] = $config_value['attr']['translate'];
}
foreach ($this->tm_instance->settings[$this->index_ro] as $key => $translation_option) {
if (!isset($config_values[$key])) {
unset($this->tm_instance->settings[$this->index_ro][$key]);
}
}
$this->tm_instance->save_settings();
}
}