Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding 'class_exists' check around WP_Import call #24

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified class-command.php
100644 → 100755
Empty file.
Empty file modified class-logger-cli.php
100644 → 100755
Empty file.
Empty file modified class-logger.php
100644 → 100755
Empty file.
Empty file modified class-wxr-importer.php
100644 → 100755
Empty file.
17 changes: 10 additions & 7 deletions plugin.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ function wpimportv2_init() {
* WordPress Importer object for registering the import callback
* @global WP_Import $wp_import
*/
$GLOBALS['wp_import_v2'] = new WP_Import();
register_importer(
'wordpress-v2',
'WordPress (v2)',
__('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'wordpress-importer'),
array( $GLOBALS['wp_import'], 'dispatch' )
);
if(class_exists('WP_Import')){
$GLOBALS['wp_import_v2'] = new WP_Import();
register_importer(
'wordpress-v2',
'WordPress (v2)',
__('Import <strong>posts, pages, comments, custom fields, categories, and tags</strong> from a WordPress export file.', 'wordpress-importer'),
array( $GLOBALS['wp_import'], 'dispatch' )
);
}

}
add_action( 'admin_init', 'wpimportv2_init' );