Skip to content

Commit 604d177

Browse files
committed
Fix test
1 parent 9953e1e commit 604d177

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎features/import.feature‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,18 @@ Feature: Import content.
437437
And a wp-content/mu-plugins/custom-importer.php file:
438438
"""
439439
<?php
440+
if ( ! defined( 'WP_LOAD_IMPORTERS' ) ) {
441+
return;
442+
}
443+
444+
if ( ! class_exists( 'WP_Importer' ) ) {
445+
require_once ABSPATH . 'wp-admin/includes/class-wp-importer.php';
446+
}
447+
448+
if ( ! class_exists( 'WP_IMPORT' ) ) {
449+
require_once WP_PLUGIN_DIR . '/wordpress-importer/class-wp-import.php';
450+
}
451+
440452
class My_Custom_WP_Import extends WP_Import {}
441453
"""
442454

‎src/Import_Command.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ public function __invoke( $args, $assoc_args ) {
6363

6464
$importer_class = $assoc_args['importer'];
6565
if ( 'WP_Import' !== $importer_class ) {
66-
if ( ! preg_match( '/^[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff\\\\]*$/', $importer_class ) ) {
67-
WP_CLI::error( "Importer class '$importer_class' is not a valid class name." );
68-
}
6966
if ( ! class_exists( $importer_class ) ) {
7067
WP_CLI::error( "Importer class '$importer_class' does not exist." );
7168
}

0 commit comments

Comments
 (0)