WordPress.org

Make WordPress Core

Changeset 18640


Ignore:
Timestamp:
09/05/11 19:18:36 (3 years ago)
Author:
duck_
Message:

Pull out old import remnant from when importers were shipped in core. Fixes #15844.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin.php

    r17749 r18640  
    184184    } 
    185185 
    186     // Allow plugins to define importers as well 
    187     if ( !isset($wp_importers) || !isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2])) { 
    188         if (! file_exists(ABSPATH . "wp-admin/import/$importer.php")) { 
    189             wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ); 
    190             exit; 
    191         } 
    192         include(ABSPATH . "wp-admin/import/$importer.php"); 
     186    if ( ! isset($wp_importers[$importer]) || ! is_callable($wp_importers[$importer][2]) ) { 
     187        wp_redirect( admin_url( 'import.php?invalid=' . $importer ) ); 
     188        exit; 
    193189    } 
    194190 
     
    212208 
    213209    // Make sure rules are flushed 
    214     global $wp_rewrite; 
    215     $wp_rewrite->flush_rules(false); 
     210    flush_rewrite_rules(false); 
    216211 
    217212    exit(); 
  • trunk/wp-admin/import.php

    r18577 r18640  
    5959<?php 
    6060 
    61 // Load all importers so that they can register. 
    62 $import_loc = 'wp-admin/import'; 
    63 $import_root = ABSPATH . $import_loc; 
    64  
    65 if ( file_exists( $import_root ) ) { 
    66     $imports_dir = opendir($import_root); 
    67     if ($imports_dir) { 
    68         while (($file = readdir($imports_dir)) !== false) { 
    69             if ($file[0] == '.') { 
    70                 continue; 
    71             } elseif (substr($file, -4) == '.php') { 
    72                 require_once($import_root . '/' . $file); 
    73             } 
    74         } 
    75     } 
    76     closedir( $imports_dir ); 
    77 } 
    78  
    7961$importers = get_importers(); 
    8062 
    8163// If a popular importer is not registered, create a dummy registration that links to the plugin installer. 
    8264foreach ( $popular_importers as $pop_importer => $pop_data ) { 
    83     if ( isset($importers[$pop_importer] ) ) 
     65    if ( isset( $importers[$pop_importer] ) ) 
    8466        continue; 
    8567    if ( isset( $pop_data[3] ) && isset( $importers[ $pop_data[3] ] ) ) 
     
    8971} 
    9072 
    91 if (empty ($importers)) { 
     73if ( empty($importers) ) { 
    9274    echo '<p>'.__('No importers are available.').'</p>'; // TODO: make more helpful 
    9375} else { 
Note: See TracChangeset for help on using the changeset viewer.