'fb_scheduled_imports', 'posts_per_page' => -1, // @codingStandardsIgnoreLine. ); $scheduled_imports = get_posts( $scheduled_import_args ); // @codingStandardsIgnoreLine. if ( ! empty( $scheduled_imports ) ) { foreach ( $scheduled_imports as $import ) { if ( ! empty( $import->ID ) ) { wp_delete_post( $import->ID, true ); } } } // Remove import History. $ife_import_history_args = array( 'post_type' => 'ife_import_history', 'posts_per_page' => -1, // @codingStandardsIgnoreLine. ); $ife_import_history = get_posts( $ife_import_history_args ); // @codingStandardsIgnoreLine. if ( ! empty( $ife_import_history ) ) { foreach ( $ife_import_history as $history ) { if ( ! empty( $history->ID ) ) { wp_delete_post( $history->ID, true ); } } } }