本文整理汇总了PHP中ICanLocalizeQuery::test_affiliate_info方法的典型用法代码示例。如果您正苦于以下问题:PHP ICanLocalizeQuery::test_affiliate_info方法的具体用法?PHP ICanLocalizeQuery::test_affiliate_info怎么用?PHP ICanLocalizeQuery::test_affiliate_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICanLocalizeQuery
的用法示例。
在下文中一共展示了ICanLocalizeQuery::test_affiliate_info方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$iclsettings['st']['translated-users'] = !empty($_POST['users']) ? array_keys($_POST['users']) : array();
$this->save_settings($iclsettings);
if (!empty($iclsettings['st']['translated-users'])) {
$sitepress_settings['st']['translated-users'] = $iclsettings['st']['translated-users'];
icl_st_register_user_strings_all();
}
echo 1;
break;
case 'icl_st_ar_form':
// Auto register string settings.
$iclsettings['st']['icl_st_auto_reg'] = $_POST['icl_auto_reg_type'];
$this->save_settings($iclsettings);
echo 1;
break;
case 'affiliate_info_check':
if ($this->icl_account_configured() && ($iclq = new ICanLocalizeQuery($this->get_setting('site_id'), $this->get_setting('access_key'))) && $iclq->test_affiliate_info($_POST['icl_affiliate_id'], $_POST['icl_affiliate_key'])) {
$error = array('error' => 0);
} else {
$error = array('error' => 1);
}
echo json_encode($error);
break;
case 'icl_hide_languages':
$iclsettings['hidden_languages'] = empty($_POST['icl_hidden_languages']) ? array() : $_POST['icl_hidden_languages'];
$this->set_setting('hidden_languages', array());
//reset current value
$active_languages = $this->get_active_languages();
if (!empty($iclsettings['hidden_languages'])) {
if (1 == count($iclsettings['hidden_languages'])) {
$out = sprintf(__('%s is currently hidden to visitors.', 'sitepress'), $active_languages[$iclsettings['hidden_languages'][0]]['display_name']);
} else {
示例2: foreach
$iclsettings['promote_wpml'] = $_POST['icl_promote'] == 'true' ? 1 : 0;
$this->save_settings($iclsettings);
break;
case 'save_translator_note':
update_post_meta($_POST['post_id'], '_icl_translator_note', $_POST['note']);
break;
case 'icl_st_more_options':
foreach ($_POST['icl_st'] as $k => $v) {
$iclsettings['st'][$k] = $v;
}
$this->save_settings($iclsettings);
echo 1;
break;
case 'affiliate_info_check':
$iclq = new ICanLocalizeQuery($this->settings['site_id'], $this->settings['access_key']);
if ($iclq->test_affiliate_info($_POST['icl_affiliate_id'], $_POST['icl_affiliate_key'])) {
$error = array('error' => 0);
} else {
$error = array('error' => 1);
}
echo json_encode($error);
break;
case 'icl_hide_languages':
$iclsettings['hidden_languages'] = $_POST['icl_hidden_languages'];
$this->settings['hidden_languages'] = array();
//reset current value
$active_languages = $this->get_active_languages();
if (!empty($iclsettings['hidden_languages'])) {
if (1 == count($iclsettings['hidden_languages'])) {
$out = sprintf(__('%s is currently hidden to visitors.', 'sitepress'), $active_languages[$iclsettings['hidden_languages'][0]]['display_name']);
} else {