Ticket #13960: ljimporter.diff
| File ljimporter.diff, 1.0 KB (added by nacin, 3 years ago) |
|---|
-
livejournal-importer.php
10 10 License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 11 11 */ 12 12 13 add_action( 'wp_ajax_lj-importer', 'livejournal_import_ajax_handler' ); 14 15 function livejournal_import_ajax_handler() { 16 check_ajax_referer( 'lj-api-import' ); 17 if ( !current_user_can( 'publish_posts' ) ) 18 die('-1'); 19 if ( empty( $_POST['step'] ) ) 20 die( '-1' ); 21 define('WP_IMPORTING', true); 22 include( ABSPATH . 'wp-admin/import/livejournal.php' ); 23 $result = $lj_api_import->{ 'step' . ( (int) $_POST['step'] ) }(); 24 if ( is_wp_error( $result ) ) 25 echo $result->get_error_message(); 26 die; 27 } 28 13 29 if ( !defined('WP_LOAD_IMPORTERS') ) 14 30 return; 15 31 … … 1070 1086 do_action( 'import_end' ); 1071 1087 } 1072 1088 1073 function LJ_API_Import() {1074 $this->__construct();1075 }1076 1077 function __construct() {1078 // Nothing1079 }1080 1089 } 1081 1090 1082 1091 $lj_api_import = new LJ_API_Import();
