當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WP_Import::process_terms方法代碼示例

本文整理匯總了PHP中WP_Import::process_terms方法的典型用法代碼示例。如果您正苦於以下問題:PHP WP_Import::process_terms方法的具體用法?PHP WP_Import::process_terms怎麽用?PHP WP_Import::process_terms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WP_Import的用法示例。


在下文中一共展示了WP_Import::process_terms方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

 function process_terms()
 {
     $term_translations = array();
     // store this for future usage as parent function unsets $this->terms
     foreach ($this->terms as $term) {
         if ('post_translations' == $term['term_taxonomy']) {
             $this->post_translations[] = $term;
         }
         if ('term_translations' == $term['term_taxonomy']) {
             $term_translations[] = $term;
         }
     }
     parent::process_terms();
     global $polylang;
     $polylang->model->clean_languages_cache();
     // to update the languages list if needed
     if (($options = get_option('polylang')) && empty($options['default_lang']) && ($languages = $polylang->model->get_languages_list())) {
         // assign the default language if importer created the first language
         $default_lang = reset($languages);
         $options['default_lang'] = $default_lang->slug;
         update_option('polylang', $options);
     }
     $this->remap_terms_relations($term_translations);
     $this->remap_translations($term_translations, $this->processed_terms);
 }
開發者ID:santikrass,項目名稱:apache,代碼行數:25,代碼來源:wp-import.php

示例2: array

 /**
  * overrides WP_Import::process_terms to remap terms translations
  *
  * @since 1.2
  */
 function process_terms()
 {
     $term_translations = array();
     // store this for future usage as parent function unsets $this->terms
     foreach ($this->terms as $term) {
         if ('post_translations' == $term['term_taxonomy']) {
             $this->post_translations[] = $term;
         }
         if ('term_translations' == $term['term_taxonomy']) {
             $term_translations[] = $term;
         }
     }
     parent::process_terms();
     // update the languages list if needed
     // first reset the core terms cache as WordPress Importer calls wp_suspend_cache_invalidation( true );
     wp_cache_set('last_changed', microtime(), 'terms');
     PLL()->model->clean_languages_cache();
     if (($options = get_option('polylang')) && empty($options['default_lang']) && ($languages = PLL()->model->get_languages_list())) {
         // assign the default language if importer created the first language
         $default_lang = reset($languages);
         $options['default_lang'] = $default_lang->slug;
         update_option('polylang', $options);
     }
     $this->remap_terms_relations($term_translations);
     $this->remap_translations($term_translations, $this->processed_terms);
 }
開發者ID:spielhoelle,項目名稱:amnesty,代碼行數:31,代碼來源:wp-import.php

示例3: process_terms

 /**
  * Add an action at the process_term
  * 
  * @see WP_Import::process_terms()
  */
 public function process_terms()
 {
     parent::process_terms();
     do_action('bunyad_import_process_terms', $this);
 }
開發者ID:silverbux,項目名稱:smartmag-magazine-wordpress,代碼行數:10,代碼來源:wp-import.php

示例4: wpImportContents

 public function wpImportContents($file)
 {
     $wp_import = new WP_Import();
     $wp_import->fetch_attachments = false;
     // doesn matter
     // load data from saved option
     $wp_import->post_orphans = get_option('_cri_post_orphans', array());
     $wp_import->processed_posts = get_option('_cri_processed_posts', array());
     $wp_import->url_remap = get_option('_cri_url_remap', array());
     // the odd filter
     add_filter('import_post_meta_key', array($wp_import, 'is_valid_meta_key'));
     add_filter('http_request_timeout', array(&$wp_import, 'bump_request_timeout'));
     // start buffer
     ob_start();
     // parse file and gather data
     $wp_import->import_start($file);
     // map author
     $wp_import->get_author_mapping();
     wp_suspend_cache_invalidation(true);
     $wp_import->process_categories();
     $wp_import->process_tags();
     $wp_import->process_terms();
     $wp_import->process_posts();
     wp_suspend_cache_invalidation(false);
     // update incorrect/missing information in the DB
     $wp_import->backfill_parents();
     $wp_import->backfill_attachment_urls();
     $wp_import->remap_featured_images();
     // end has output, so buffer it out
     $wp_import->import_end();
     // ignore the output, call in buffer
     do_action('radium_after_content_import');
     ob_end_clean();
     // delete all attachment related stats
     foreach (array('_cri_post_orphans', '_cri_processed_posts', '_cri_url_remap') as $op) {
         delete_option($op);
     }
     return true;
 }
開發者ID:AlchemyMomentum,項目名稱:public_html,代碼行數:39,代碼來源:radium-importer.php

示例5: process_terms

 public function process_terms()
 {
     $this->updateStats(__("Importing terms", 'Pixelentity Theme/Plugin'));
     parent::process_terms();
 }
開發者ID:JeffreyBue,項目名稱:jb,代碼行數:5,代碼來源:PeThemeImporter.php


注:本文中的WP_Import::process_terms方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。