当前位置: 首页>>代码示例>>PHP>>正文


PHP ICanLocalizeQuery::test_affiliate_info方法代码示例

本文整理汇总了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 {
开发者ID:PHQ-Design,项目名称:souza-lima,代码行数:31,代码来源:ajax.php

示例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 {
开发者ID:winyatasenjaya,项目名称:sitepress-multilingual-cms,代码行数:31,代码来源:ajax.php


注:本文中的ICanLocalizeQuery::test_affiliate_info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。