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


PHP WP_Import::backfill_parents方法代码示例

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


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

示例1: 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

示例2: backfill_parents

 public function backfill_parents()
 {
     $this->updateStats(__("Fixing orphans", 'Pixelentity Theme/Plugin'));
     parent::backfill_parents();
 }
开发者ID:JeffreyBue,项目名称:jb,代码行数:5,代码来源:PeThemeImporter.php


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