3 * NOTE: you're supposed to load this file directly in your browser,
4 * ie http://site.com/wp-content/plugins/ozh-plc-bridge/generate-short-urls-for-all-posts.php
7 // Load the WordPress Environment
8 require('../../../wp-blog-header.php');
10 <h1>Ozh's PLC - WP - Twitter Bridge</h1>
11 <h2>This file generates a short link for all your blog posts (from older to latest)</h2>
14 add_filter('posts_orderby', create_function('', 'return "post_date ASC";') );
16 $archive_query = new WP_Query('showposts=99999');
18 while ($archive_query->have_posts()) : $archive_query->the_post();
19 delete_post_meta($archive_query->post->ID, 'yourls_shorturl'); // remove any previously stored short url
20 update_post_meta($archive_query->post->ID, 'yourls_tweeted', 1); // make as if all existing posts had already been tweeted
21 echo '<li>'.wp_ozh_yourls_geturl($archive_query->post->ID) .' = ' . $archive_query->post->post_title . "</li>\n";
26 <h3>Done. You can now delete this file !</h3>