PluginProbe
Forumax – AI Powered Advanced Community Forum Plugin / 2.5.1
Forumax – AI Powered Advanced Community Forum Plugin v2.5.1
2.5.1 2.5.0 2.4.4 2.4.3 2.4.2 2.4.1 2.4.0 trunk 1.0.8 1.1.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 All 31 releases
← All changes | widgets/Forumax_Recent_Replies.php +6 -1 2.4.0 → 2.5.1 View file →
@@ -42,8 +42,9 @@
42 42 * @param array $instance Instance
43 43 */
44 44 public function widget($args = array(), $instance = array())
45 45 {
46 + wp_enqueue_style('bbpc-forum');
46 47
47 48 // Get widget settings
48 49 $settings = $this->parse_settings($instance);
49 50
@@ -61,9 +62,10 @@
61 62 'posts_per_page' => (int) $settings['max_shown'],
62 63 'ignore_sticky_posts' => true,
63 64 'no_found_rows' => true,
64 65 'update_post_term_cache' => false,
65 - 'update_post_meta_cache' => false
66 + // The loop reads each reply's topic/author meta; load it in one query.
67 + 'update_post_meta_cache' => true
66 68 ));
67 69
68 70 // Bail if no replies are found
69 71 if (!$widget_query->have_posts()) {
@@ -68,8 +70,11 @@
68 70 // Bail if no replies are found
69 71 if (!$widget_query->have_posts()) {
70 72 return;
71 73 }
74 +
75 + // Parent topics are used for titles and links; fetch them together.
76 + _prime_post_caches(array_unique(wp_list_pluck($widget_query->posts, 'post_parent')), false, true);
72 77
73 78 echo $args['before_widget'];
74 79
75 80 if (!empty($settings['title'])) {