{"id":6605540,"date":"2015-10-01T21:04:08","date_gmt":"2015-10-01T21:04:08","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/update-all-posts-using-iframe\/"},"modified":"2016-08-30T18:38:47","modified_gmt":"2016-08-30T18:38:47","slug":"update-all-posts-using-iframe","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/update-all-posts-using-iframe\/","title":{"rendered":"Update all posts using Iframe"},"content":{"rendered":"<p>Hello I&#8217;m a hard time on stage is as follows:<br \/>\nneed to update all registered posts (more than 200,000) to change the permanent link for each post, I thought of<br \/>\ncreate a plugin and it found the following code:<\/p>\n<pre><code>$posts_to_update = get_posts(&#039;cat=x&amp;showposts=1000&#039;);\/\/Retrieve the posts you are targetting\nforeach ( $posts_to_update as $update_this_post ):\n    $update_this_post-&gt;post_title = &#039;Post Prefix: &#039;.$update_this_post-&gt;post_title;\/\/The post field you are updating.\n    wp_update_post( $update_this_post );\nendforeach;<\/code><\/pre>\n<p>The problem is that I need to open each post it runs a javascript that takes a information to insert the link.<br \/>\nthe only thing to do is: Open the post in an Iframe for example, and click the update button,<br \/>\nI am using &lt;iframe&gt; but I can not do a repeat loop that carry each post and<br \/>\nautomatically actualize in PHP. I&#8217;ve been researching and saw something in javascript and ajax but as I am starting not know these languages<br \/>\nsomeone could give me an idea or an example of how to do this ???<\/p>\n","protected":false},"template":"","class_list":["post-6605540","topic","type-topic","status-publish","hentry","topic-tag-iframe","topic-tag-update-posts"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6605540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6605540\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6605540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}