Add wp_import_existing_post filter from Trac #33721
See https://core.trac.wordpress.org/ticket/33721
Looks good! This does cause extra sets on the $this->exists array though, any thoughts on the performance of that with lots of posts?
I'm not familiar enough with the new codebase to speak to performance, but this patch has been applied to the existing WordPress Importer plugin on WordPress.com and we're using it successfully there.
Specifically, if I call post_exists twice with the same data, the second one will set the same key on the array again. The array we're talking about is potentially massive, as it's every GUID => ID on the site, so writing unnecessarily to that may cause terrible performance.
(In the old importer, the array is only the posts imported so far.)
Also, in keeping with the new naming scheme, this should be wxr_importer.post_exists instead.
this should be wxr_importer.post_exists instead.
Why are you using . in your filter names?
The wp_import_existing_post name is specifically for compatibility with the existing WordPress Importer plugin form which this patch is supposed to be committed.
Why are you using . in your filter names?
Because it looks nice. :)
The wp_import_existing_post name is specifically for compatibility with the existing WordPress Importer plugin form which this patch is supposed to be committed.
It's not actually merged into the original Importer though, right? For new filters, I'd like to stick to the new style prefixes.
@rmccue it has now been merged into the original Importer 😄
https://core.trac.wordpress.org/ticket/33721#comment:12
Ready to go in my opinion.
Worth noting that it has been added to the original importer for version 0.6.2 which was released, but then the release was canceled again. So we could probably use the new style prefix for it here.