Skip to:

Opened 11 years ago

Closed 4 days ago

#4835 closed defect (bug) (maybelater)

Latest Post in Blogs Directory

Reported by: unsalkorkmaz's profile unsalkorkmaz Owned by:
Milestone: Priority: lowest
Severity: trivial Version: 1.7
Component: Blogs Keywords: needs-patch good-first-bug


Latest post for blogs directory:

$paged_blogs[$i]->latest_post = $wpdb->get_row( "SELECT ID, post_content, post_title, post_excerpt, guid FROM {$blog_prefix}posts WHERE post_status = 'publish' AND post_type = 'post' AND id != 1 ORDER BY id DESC LIMIT 1" );

Hardcoding post_type = 'post' is just wrong. Basically we cant show custom post types in there. Why not use {$blog_prefix}bp_activity table?

Attachments (1)

4835.patch (1.0 KB) - added by rahulsprajapati 8 years ago.

Download all attachments as: .zip

Change History (7)

#1 @unsalkorkmaz
11 years ago

Or.. just remove post_type = 'post' because post_status = 'publish' is enough for eliminating attachments because their post_status is inherit.

Update: nvm this one. nav menu items are coming too.

Last edited 11 years ago by unsalkorkmaz (previous) (diff)

#2 @boonebgorges
11 years ago

  • Component changed from Core to Blogs
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to lowest
  • Severity changed from major to trivial

This is a good enhancement request. For the moment, you can filter 'bp_get_blog_latest_post' and provide whatever value you want.

#3 @slaFFik
8 years ago

  • Keywords good-first-bug added

#4 @tw2113
7 years ago

I think there's potential here to amend the query to take multiple post types. Perhaps make do a post_type IN ( '...' ) spot, and have default to just 'post'. The filter would pass an array that has just 'post' by default, and implode it into the SQL.

#5 @tw2113
7 years ago

Alternative idea, perhaps we could use the $type parameter to specify a post type. It's presently no used for anything.

#6 @espellcaste
4 days ago

  • Milestone Awaiting Contributions deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.