add_attachment.php
1 month ago
admin_head.php
1 month ago
admin_init.php
1 month ago
admin_menu.php
1 month ago
admin_notices.php
1 month ago
attachment_updated.php
1 month ago
delete_post.php
1 month ago
pmxi_after_xml_import.php
1 month ago
pmxi_before_xml_import.php
1 month ago
pmxi_extend_options_custom_fields.php
1 month ago
wp_ajax_auto_detect_cf.php
1 month ago
wp_ajax_auto_detect_sf.php
1 month ago
wp_ajax_delete_import.php
1 month ago
wp_ajax_dismiss_notifications.php
1 month ago
wp_ajax_import_failed.php
1 month ago
wp_ajax_test_images.php
1 month ago
wp_ajax_wpai_dismiss_review_modal.php
1 month ago
wp_ajax_wpai_send_feedback.php
1 month ago
wpmu_new_blog.php
1 month ago
wp_ajax_import_failed.php
29 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 | function pmxi_wp_ajax_import_failed(){ |
| 4 | |
| 5 | if ( ! check_ajax_referer( 'wp_all_import_secure', 'security', false )){ |
| 6 | exit( json_encode(array('result' => false, 'msg' => __('Security check', 'wp-all-import'))) ); |
| 7 | } |
| 8 | |
| 9 | if ( ! current_user_can( PMXI_Plugin::$capabilities ) ){ |
| 10 | exit( json_encode(array('result' => false, 'msg' => __('Security check', 'wp-all-import'))) ); |
| 11 | } |
| 12 | |
| 13 | $result = false; |
| 14 | if (!empty($_POST['id'])) { |
| 15 | $import = new PMXI_Import_record(); |
| 16 | $import->getbyId(intval($_POST['id'])); |
| 17 | if ( ! $import->isEmpty()) { |
| 18 | $import->set(array( |
| 19 | 'executing' => 0, |
| 20 | 'last_activity' => gmdate('Y-m-d H:i:s'), |
| 21 | 'failed' => 1, |
| 22 | 'failed_on' => gmdate('Y-m-d H:i:s') |
| 23 | ))->save(); |
| 24 | $result = true; |
| 25 | do_action('pmxi_import_failed', intval($_POST['id'])); |
| 26 | } |
| 27 | } |
| 28 | exit( json_encode( array('result' => $result))); |
| 29 | } |