Permalink
Browse files

fix example URL, additional sanity check when updating dates

  • Loading branch information...
1 parent 270baa7 commit 66967b97729b6a32d9d8a23cf69585ef3c287db1 @alexkingorg alexkingorg committed Mar 24, 2013
Showing with 11 additions and 9 deletions.
  1. +1 −1 README.txt
  2. +10 −8 threads.php
View
@@ -15,7 +15,7 @@ If you have ongoing themes you write about on your site, you can use Threads to
Another good usage of Threads is on a news site to track posts related to a single ongoing story. For example, a tech blog might create a thread to group stories about a product launch event. Several months later, stories about sales figures for the product might be added to the thread. By placing all of these posts in a thread, there is a useful visual way of browsing all of the posts.
-The timeline display of a thread is both responsive and retina (HiDPI) friendly. See an <a href="https://alexking.org/blog/thread/content">example here</a>.
+The timeline display of a thread is both responsive and retina (HiDPI) friendly. See an <a href="http://alexking.org/blog/thread/content">example here</a>.
Developers, please contribute on <a href="https://github.com/crowdfavorite/wp-threads">GitHub</a>.
View
@@ -273,14 +273,16 @@ function cfth_update_thread_date($post_id, $post) {
// update each thread date with current date
foreach ($threads as $thread) {
$_post = cftpb_get_post($thread->term_id, 'threads');
- $now = current_time('mysql');
- if ($now > $_post->post_date) {
- $data = array(
- 'ID' => $_post->ID,
- 'post_date' => $now,
- 'post_date_gmt' => current_time('mysql', 1),
- );
- wp_update_post($data);
+ if ($_post) {
+ $now = current_time('mysql');
+ if ($now > $_post->post_date) {
+ $data = array(
+ 'ID' => $_post->ID,
+ 'post_date' => $now,
+ 'post_date_gmt' => current_time('mysql', 1),
+ );
+ wp_update_post($data);
+ }
}
}
}

0 comments on commit 66967b9

Please sign in to comment.