interrupt
Forum Replies Created
-
Forum: Plugins
In reply to: Delete similar postsHey, maybe Gabismo is like me and is aggregating multiple local newspaper RSS sources. They may or may not include articles from reuters and/or other larger news corps, and FeedWP is coming up with duplicates quite regularly. As for Deleting posts and doing it cleanly, how about breaking into one of the various codebases/trunks and searching for wp_delete_post() and the like. If you see a thing you want to do and WordPress already does it(e.g. in the admin panel), then there is code already written for it, so track it down, start with the HTML page where you see the thing happening. I’m too ‘lazy’ to do this for anyone but myself.
Duplicate posts can be systematicaly destroyed by doing fun things like [in robotron voice] CREATE TEMPORARY TABLE dupetable AS (SELECT * FROM mypostsTable )… DELETE * FROM mypostsTable WHERE GOD SQL DEEMS myUser WORTHY OF noMoreDupes… or something like that anyway
the delete function may not be optimized for speed but I use it for thousands of posts at a time and I wrote a plugin that can cut down 12,000-15,000 posts, about 500 processed before the exaggeratedly large timeout that I set on my dev server for that task. Averaging about 60-90 duplicates out of those thousands. /* what? */ NOt sUre if the wp_delete_post() takes care of the attatchments but it will kill the post2cat entries nicely. I am sure you could delete from the attatchments table where the id is nonexistent with out too big of a paralel SQL stain on your pants.
fyi:
I racked up all these rss articles over four months and had to cut them down for relevance to a certain search criteria. I had the duplicate search and destroy working but then I made the rest of my SQL a little cleaner (I think), then the project lost priority and I didn’t finish the dupe part.
I would be happy to help more but as HandySolo has said that Kaf brought up, why do YOU want to delete duplicate posts today????Forum: Themes and Templates
In reply to: Duplicate posts?Cheers! I definitely agree, and I’ll bet if anyone who could help ever answered, the problem would just get worse!
Forum: Plugins
In reply to: creating categories in pluginsSo, the clock defeated my search for scope purity. What do you mean, what do I mean? I ended up checking for and creating categories on the options page instead of having it happen inside the Feedwordpress updating cycle. It’s not too bad a solution.
If anyone is interested in what my ramblings have been about, just send me an email or somesuch other communicaation, I would be happy to help if I can.Forum: Plugins
In reply to: creating categories in pluginsFeedwordpress uses $wpdb->query to do most ofits work
and category visibility uses that to create a table..
I guess the realm of categories inplugins is a mystery?? should I include some file in order to use wp_create/insert_category? which file?
-lost in the wordpress bushForum: Plugins
In reply to: publish_post definitive infoIn the source code for the function wp_insert_post (wp-includes/functions-post.php), one can see the place where filters are applied at line 26 – line 33, could these be consolidated into one application of a hook that passes the array of all post data ?
Forum: Plugins
In reply to: publish_post definitive infoedit_post is not *directly* relevant to filtering posts as they are being published. edit_post acts on display of post data to be edited. The key is ‘on display,’ this means that the data is not changed in the database but changed on its way out.
calling update_post after a post has been published seems like a waste of database writing cycles.
Does the wordpress team plan on adding an array-passing hook into the core?Forum: Plugins
In reply to: publish_post definitive infotidbits I am picking up: (: let me know if the info is wrong ??
publish_post passes the id of a post before it is actually published.
With this id, one can use
get_post($id)
to get the post data array and look at it, change it and trigger things because of what is in its elements.
When one grabs this info and changes it, where does one put that modified data?
The function for updating the post data is
update_post($post_array)
These two functions used together is what one needs for filtering post content.
If you are using FeedWordPress, then syndicated_post will pass the array directly in the same form as get_post($id). This hook will pass the array for every news feed post.
Forum: Plugins
In reply to: accessing post data with hooksyes! it happened to me too, now I figured it out!
Forum: Plugins
In reply to: accessing post data with hooksso, Now I am in that situation, can you explain the way to do this?