admin_head.php
4 years ago
admin_init.php
4 years ago
admin_menu.php
4 years ago
admin_notices.php
4 years ago
init.php
4 years ago
pmxe_after_export.php
4 years ago
pmxe_before_export.php
4 years ago
pmxe_exported_post.php
4 years ago
wp_ajax_dismiss_export_warnings.php
4 years ago
wp_ajax_dismiss_warnings.php
4 years ago
wp_ajax_generate_zapier_api_key.php
4 years ago
wp_ajax_redirect_after_addon_installed.php
4 years ago
wp_ajax_save_scheduling.php
4 years ago
wp_ajax_scheduling_dialog_content.php
4 years ago
wp_ajax_wpae_available_rules.php
4 years ago
wp_ajax_wpae_filtering.php
4 years ago
wp_ajax_wpae_filtering_count.php
4 years ago
wp_ajax_wpae_preview.php
4 years ago
wp_ajax_wpae_upgrade_notice.php
4 years ago
wp_ajax_wpallexport.php
4 years ago
wp_loaded.php
4 years ago
wpmu_new_blog.php
4 years ago
pmxe_before_export.php
42 lines
| 1 | <?php |
| 2 | |
| 3 | function pmxe_pmxe_before_export($export_id) |
| 4 | { |
| 5 | $export = new PMXE_Export_Record(); |
| 6 | $export->getById($export_id); |
| 7 | |
| 8 | if ( ! $export->isEmpty() ) |
| 9 | { |
| 10 | if ( ! $export->options['export_only_new_stuff'] ) |
| 11 | { |
| 12 | $postList = new PMXE_Post_List(); |
| 13 | $missingPosts = $postList->getBy(array('export_id' => $export_id, 'iteration !=' => --$export->iteration)); |
| 14 | $missing_ids = array(); |
| 15 | if ( ! $missingPosts->isEmpty() ): |
| 16 | |
| 17 | foreach ($missingPosts as $missingPost) |
| 18 | { |
| 19 | $missing_ids[] = $missingPost['post_id']; |
| 20 | } |
| 21 | |
| 22 | endif; |
| 23 | |
| 24 | if ( ! empty($missing_ids)) |
| 25 | { |
| 26 | global $wpdb; |
| 27 | // Delete records form pmxe_posts |
| 28 | $sql = "DELETE FROM " . PMXE_Plugin::getInstance()->getTablePrefix() . "posts WHERE post_id IN (" . implode(',', $missing_ids) . ") AND export_id = %d"; |
| 29 | $wpdb->query( |
| 30 | $wpdb->prepare($sql, $export->id) |
| 31 | ); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | if ( empty($export->parent_id) ) |
| 36 | { |
| 37 | delete_option( 'wp_all_export_queue_' . $export->id ); |
| 38 | } |
| 39 | |
| 40 | delete_option( 'wp_all_export_acf_flexible_' . $export->id ); |
| 41 | } |
| 42 | } |