From 0ddd681d250a1a9a8b78203eea9ca041e351cf91 Mon Sep 17 00:00:00 2001 From: gordielachance Date: Sat, 17 Sep 2016 15:48:13 +0200 Subject: [PATCH] minor --- bbpress-pencil-unread.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bbpress-pencil-unread.php b/bbpress-pencil-unread.php index 2cbb918..9f586ef 100644 --- a/bbpress-pencil-unread.php +++ b/bbpress-pencil-unread.php @@ -498,6 +498,8 @@ function get_forum_id_for_post($post_id = null){ } function has_user_read_all_forum_topics( $forum_id,$user_id=false ){ + + //check : http://wordpress.stackexchange.com/questions/239603/how-to-speed-up-a-complex-wp-query if(!$user_id) $user_id = get_current_user_id(); if(!$user_id) return true; @@ -532,6 +534,8 @@ function has_user_read_all_forum_topics( $forum_id,$user_id=false ){ if ( $skip_timestamp = $this->get_skip_timestamp($user_id,$forum_id) ){ $skip_time = date_i18n( 'Y-m-d H:i:s', $skip_timestamp ); //mysql format + //TO FIX should we query the 'post_date' field instead of this; which slows down the query ? + //We must be sure it has the same value than '_bbp_last_active_time' postmeta. $topics_args['meta_query'][] = array( 'key' => '_bbp_last_active_time', 'value' => $skip_time,