CoreFiles by mySites.guru
import.php47 lines, 1,123 bytes, from wordpress-2.5.zip
Raw History Compare with 2.3.3
md5
3f612897f603c04799658cc4a9a5bc7c
sha1
79f4a4f67a6815c3ca9f76feb9a638e2a87897d7
sha256
7c6b73f6b54d82bc20d59e275c6f3b47c12160d24160efc3df3e49adb4e359a1
<?php

function get_importers() {
	global $wp_importers;
	if ( is_array($wp_importers) )
		uasort($wp_importers, create_function('$a, $b', 'return strcmp($a[0], $b[0]);'));
	return $wp_importers;
}

function register_importer( $id, $name, $description, $callback ) {
	global $wp_importers;
	if ( is_wp_error( $callback ) )
		return $callback;
	$wp_importers[$id] = array ( $name, $description, $callback );
}

function wp_import_cleanup( $id ) {
	wp_delete_attachment( $id );
}

function wp_import_handle_upload() {
	$overrides = array( 'test_form' => false, 'test_type' => false );
	$_FILES['import']['name'] .= '.import';
	$file = wp_handle_upload( $_FILES['import'], $overrides );

	if ( isset( $file['error'] ) )
		return $file;

	$url = $file['url'];
	$type = $file['type'];
	$file = addslashes( $file['file'] );
	$filename = basename( $file );

	// Construct the object array
	$object = array( 'post_title' => $filename,
		'post_content' => $url,
		'post_mime_type' => $type,
		'guid' => $url
	);

	// Save the data
	$id = wp_insert_attachment( $object, $file );

	return array( 'file' => $file, 'id' => $id );
}

?>

The same content is in 16 releases, WordPress 2.5-RC1 to 2.6.5. See them all, or every version of this file.