Permalink
Browse files

Merge remote-tracking branch 'origin/master'

  • Loading branch information...
ryanmark committed Oct 30, 2012
2 parents dc99f98 + bad8544 commit fcdcabb36da83214f8501633f573b752a137668e
Showing with 8 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +2 −2 wp-scripts/cron.php
  3. +5 −5 wp-scripts/setup_permalinks.php
View
@@ -0,0 +1 @@
+*.pyc
View
@@ -51,15 +51,15 @@ function do_cron() {
# Lifted from wp-cron.php because it can't handle multiple blogs
if ( false === $crons = _get_cron_array() ) {
print("no crons.\n");
- continue;
+ return;
}
$keys = array_keys( $crons );
$local_time = time();
if ( isset($keys[0]) && $keys[0] > $local_time ) {
print("not yet time.\n");
- continue;
+ return;
}
foreach ($crons as $timestamp => $cronhooks) {
@@ -8,13 +8,13 @@
foreach ( $results as $blog ) {
switch_to_blog($blog['blog_id']);
- $wp_rewrite = new \WP_Rewrite();
- $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%postname%/');
- $wp_rewrite->flush_rules();
- print "Set new permalink structure for " . get_bloginfo('name') . "\n";
-
update_option('category_base', '/category');
update_option('tag_base', '/tag');
+ $GLOBALS['wp_rewrite']->set_permalink_structure('/%year%/%monthnum%/%postname%/');
+ flush_rewrite_rules();
+
+ print "Set new permalink structure for " . get_bloginfo('name') . "\n";
+
restore_current_blog();
}

0 comments on commit fcdcabb

Please sign in to comment.