The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Bulk update all generated posts
Common problem here has been clients changing their mind when it comes to how a generated post should look (changing post content/styling and wanting it retrospectively applied).
It's not a massive concern if you only have a few entries (edit/save each entry!), but if your site has 1000s of posts generated from forms, you've got quite a task on your hands.
Or not, as I found out, after a few hours in the code base, I came up with this....
<?php
require("wp-load.php");
$entries = FrmEntry::getAll();
foreach ($entries as $entry) {
// echo $entry->id." ".$entry->post_id." </br>";
$post = get_post($entry->post_id, ARRAY_A);
unset($post['post_content']);
FrmProPost::insert_post( $entry->id, $post, true, 3 );
}
?>
....save it somewhere on your site as "whatever-you-want.php" and visit via a browser. (then sensibly, delete it afterwards). Et. voila, all posts restyled as per your new Post HTML.
Cheers,
Gary
FlatCoder, http://www.flatcoder.co.uk
March 24, 2015 at 4:34 pm
(replace the "3" on insert_post with the ID of your form)
March 24, 2015 at 9:31 pm
Thank you for your gift ;). I'll point users this way when they ask this question.
June 17, 2015 at 12:03 pm
Will this ever be built into Formidable? I have the same problem. Many, many, generated posts and the client wants one change to the format. Can't go in and "update" each entry.
June 17, 2015 at 9:53 pm
@mossifer, this isn't currently planned since views cover this by default. The content on the edit post doesn't change, but it changes when you view the post. Can you please start your own topic if you have questions about this?
June 24, 2016 at 10:45 am
flatcoder,
I would love to get this working for my site, however, the script stops at the last line. I get the following php error: "Call to a member function insert_post() on a non-object in..."
Any idea on how to troubleshoot this?
Thanks for any help you can give.
Discussion closed.