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
pmxi_before_xml_import.php
22 lines
| 1 | <?php |
| 2 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 | function pmxi_pmxi_before_xml_import( $import_id ) { |
| 4 | delete_option('wp_all_import_taxonomies_hierarchy_' . $import_id); |
| 5 | |
| 6 | // Remove some costly unnecessary actions during import. |
| 7 | remove_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10 ); |
| 8 | remove_action( 'transition_post_status', '_update_posts_count_on_transition_post_status', 10 ); |
| 9 | remove_action( 'post_updated', 'wp_save_post_revision', 10 ); |
| 10 | |
| 11 | // Invalidate hashes if functions file has been changed. |
| 12 | $functions_hash = wp_all_import_generate_functions_hash(); |
| 13 | if ($functions_hash) { |
| 14 | $current_hash = get_option('_wp_all_import_functions_hash_' . $import_id, false); |
| 15 | if ($functions_hash !== $current_hash) { |
| 16 | global $wpdb; |
| 17 | // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery,WordPress.DB.DirectDatabaseQuery.NoCaching |
| 18 | $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->prefix}pmxi_hash WHERE import_id = %d", (int) $import_id ) ); |
| 19 | update_option('_wp_all_import_functions_hash_' . $import_id, $functions_hash, false); |
| 20 | } |
| 21 | } |
| 22 | } |