Skip to content

Commit

Permalink
fix example URL, additional sanity check when updating dates
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkingorg committed Mar 24, 2013
1 parent 270baa7 commit 66967b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.txt
Expand Up @@ -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. 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>. Developers, please contribute on <a href="https://github.com/crowdfavorite/wp-threads">GitHub</a>.


Expand Down
18 changes: 10 additions & 8 deletions threads.php
Expand Up @@ -273,14 +273,16 @@ function cfth_update_thread_date($post_id, $post) {
// update each thread date with current date // update each thread date with current date
foreach ($threads as $thread) { foreach ($threads as $thread) {
$_post = cftpb_get_post($thread->term_id, 'threads'); $_post = cftpb_get_post($thread->term_id, 'threads');
$now = current_time('mysql'); if ($_post) {
if ($now > $_post->post_date) { $now = current_time('mysql');
$data = array( if ($now > $_post->post_date) {
'ID' => $_post->ID, $data = array(
'post_date' => $now, 'ID' => $_post->ID,
'post_date_gmt' => current_time('mysql', 1), 'post_date' => $now,
); 'post_date_gmt' => current_time('mysql', 1),
wp_update_post($data); );
wp_update_post($data);
}
} }
} }
} }
Expand Down

0 comments on commit 66967b9

Please sign in to comment.