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


PHP SitePress::set_setting方法代码示例

本文整理汇总了PHP中SitePress::set_setting方法的典型用法代码示例。如果您正苦于以下问题:PHP SitePress::set_setting方法的具体用法?PHP SitePress::set_setting怎么用?PHP SitePress::set_setting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SitePress的用法示例。


在下文中一共展示了SitePress::set_setting方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: set_language

 public function set_language($domain, $lang)
 {
     $this->language_of_domain[$domain] = $lang;
     $string_settings = $this->sitepress->get_setting('st');
     $string_settings['lang_of_domain'] = $this->language_of_domain;
     $this->sitepress->set_setting('st', $string_settings, true);
 }
开发者ID:studiopengpeng,项目名称:ASCOMETAL,代码行数:7,代码来源:class-wpml-language-of-domain.php

示例2: intval

 function ajax_set_xliff_options()
 {
     check_ajax_referer('icl_xliff_options_form_nonce', 'security');
     $newlines = intval($_POST['icl_xliff_newlines']);
     $this->sitepress->set_setting("xliff_newlines", $newlines, true);
     $version = intval($_POST['icl_xliff_version']);
     $this->sitepress->set_setting("tm_xliff_version", $version, true);
     wp_send_json_success(array('message' => 'OK', 'newlines_saved' => $newlines, 'version_saved' => $version));
 }
开发者ID:nayabbukhari,项目名称:circulocristiano,代码行数:9,代码来源:class-wpml-tm-xliff-frontend.php

示例3: mark_command_as_executed

 /**
  * @param string $class
  */
 private function mark_command_as_executed($class)
 {
     $id = call_user_func(array($class, 'get_command_id'));
     $this->string_settings[$id . '_has_run'] = true;
     $this->sitepress->set_setting('st', $this->string_settings, true);
     wp_cache_flush();
 }
开发者ID:studiopengpeng,项目名称:ASCOMETAL,代码行数:10,代码来源:class-wpml-st-upgrade.php

示例4: IN

 function reset_pro_translation_configuration()
 {
     $translation_service_name = $this->TranslationProxy->get_current_service_name();
     $this->sitepress->set_setting('content_translation_languages_setup', false);
     $this->sitepress->set_setting('content_translation_setup_complete', false);
     $this->sitepress->set_setting('content_translation_setup_wizard_step', false);
     $this->sitepress->set_setting('translator_choice', false);
     $this->sitepress->set_setting('icl_lang_status', false);
     $this->sitepress->set_setting('icl_balance', false);
     $this->sitepress->set_setting('icl_support_ticket_id', false);
     $this->sitepress->set_setting('icl_current_session', false);
     $this->sitepress->set_setting('last_get_translator_status_call', false);
     $this->sitepress->set_setting('last_icl_reminder_fetch', false);
     $this->sitepress->set_setting('icl_account_email', false);
     $this->sitepress->set_setting('translators_management_info', false);
     $this->sitepress->set_setting('site_id', false);
     $this->sitepress->set_setting('access_key', false);
     $this->sitepress->set_setting('ts_site_id', false);
     $this->sitepress->set_setting('ts_access_key', false);
     if (class_exists('TranslationProxy_Basket')) {
         //Cleaning the basket
         TranslationProxy_Basket::delete_all_items_from_basket();
     }
     $sql_for_remote_rids = $this->wpdb->prepare("FROM {$this->wpdb->prefix}icl_translation_status\n\t\t\t\t\t\t\t\t \t\t\t\tWHERE translation_service != 'local'\n\t\t\t\t\t\t\t\t \t\t\t\t\tAND translation_service != 0\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND status IN ( %d, %d )", ICL_TM_WAITING_FOR_TRANSLATOR, ICL_TM_IN_PROGRESS);
     //Delete all translation service jobs with status "waiting for translator" or "in progress"
     $this->wpdb->query("DELETE FROM {$this->wpdb->prefix}icl_translate_job WHERE rid IN (SELECT rid {$sql_for_remote_rids})");
     //Delete all translation statuses with status "waiting for translator" or "in progress"
     $this->wpdb->query("DELETE {$sql_for_remote_rids}");
     //Cleaning up Translation Proxy settings
     $this->sitepress->set_setting('icl_html_status', false);
     $this->sitepress->set_setting('language_pairs', false);
     if (!$this->TranslationProxy->has_preferred_translation_service()) {
         $this->sitepress->set_setting('translation_service', false);
         $this->sitepress->set_setting('icl_translation_projects', false);
     }
     $this->sitepress->save_settings();
     $this->wpdb->query("TRUNCATE TABLE {$this->wpdb->prefix}icl_core_status");
     $this->wpdb->query("TRUNCATE TABLE {$this->wpdb->prefix}icl_content_status");
     $this->wpdb->query("TRUNCATE TABLE {$this->wpdb->prefix}icl_string_status");
     $this->wpdb->query("TRUNCATE TABLE {$this->wpdb->prefix}icl_node");
     $this->wpdb->query("TRUNCATE TABLE {$this->wpdb->prefix}icl_reminders");
     if ($this->TranslationProxy->has_preferred_translation_service() && $translation_service_name) {
         $confirm_message = 'The translation process with %1$s was reset.';
     } elseif ($translation_service_name) {
         $confirm_message = 'Your site was successfully disconnected from %1$s. Go to the translators tab to connect a new %1$s account or use a different translation service.';
     } else {
         $confirm_message = 'PRO translation has been reset.';
     }
     $response = sprintf(__($confirm_message, 'wpml-translation-management'), $translation_service_name);
     return $response;
 }
开发者ID:studiopengpeng,项目名称:ASCOMETAL,代码行数:51,代码来源:class-wpml-tm-troubleshooting-reset-pro-trans-config.php

示例5: maybe_migrate_string_name

 public function maybe_migrate_string_name()
 {
     global $wpdb;
     $slug_settings = $this->sitepress->get_setting('posts_slug_translation');
     if (!isset($slug_settings['string_name_migrated'])) {
         $queryable_post_types = get_post_types(array('publicly_queryable' => true));
         foreach ($queryable_post_types as $type) {
             $post_type_obj = get_post_type_object($type);
             $slug = trim($post_type_obj->rewrite['slug'], '/');
             if ($slug) {
                 // First check if we should migrate from the old format URL slug: slug
                 $string_id = $wpdb->get_var($wpdb->prepare("SELECT id\r\r\n\t\t\t\t\t\t\t\t\t\t\tFROM {$wpdb->prefix}icl_strings\r\r\n\t\t\t\t\t\t\t\t\t\t\tWHERE name = %s AND value = %s", 'URL slug: ' . $slug, $slug));
                 if ($string_id) {
                     // migrate it to URL slug: post_type
                     $st_update['name'] = 'URL slug: ' . $type;
                     $wpdb->update($wpdb->prefix . 'icl_strings', $st_update, array('id' => $string_id));
                 }
             }
         }
         $slug_settings['string_name_migrated'] = true;
         $this->sitepress->set_setting('posts_slug_translation', $slug_settings, true);
     }
 }
开发者ID:studiopengpeng,项目名称:ASCOMETAL,代码行数:23,代码来源:slug-translation.php


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