[wp-trac] [WordPress Trac] #43174: Gutenberg uses deprecated recent posts

WordPress Trac noreply at wordpress.org
Mon Jan 29 10:35:05 UTC 2018


#43174: Gutenberg uses deprecated recent posts
--------------------------------+-----------------------------
 Reporter:  LewisCowles         |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  General             |    Version:  trunk
 Severity:  normal              |   Keywords:
  Focuses:  ui, administration  |
--------------------------------+-----------------------------
 Looking to use some work from latest posts widget in Gutenberg. It seems
 that it's pulling from a deprecated function which branches from the
 normal side-bar widget version (called recent posts, but recent / latest
 are mostly synonymous).

 https://github.com/WordPress/gutenberg/blob/213c64bb495946deffa3b6fe260f95b87de5774a/blocks/library
 /latest-posts/index.php#L16

 https://github.com/WordPress/wordpress-
 develop/blob/bd6f3f617a7170bedd7492cafd730b1831905f57/src/wp-
 includes/post.php#L3091

 There is no filter for args (or anything else) in either the gutenberg
 decorator nor the `wp_get_recent_posts` method. I think this hints at
 inconsistency that could be problematic for new users.

 It's been problematic for me when testing more control via tags in
 featured / curated content using post tags.

 https://github.com/WordPress/wordpress-
 develop/blob/8f95800d52c1736d651ae6e259f90ad4a0db2c3f/src/wp-
 includes/widgets/class-wp-widget-recent-posts.php#L70 seems quite concise
 and seems to be able to drop-in fix the `wp_get_recent_posts` method with
 a change to the filter and `WP_Query` directly instead of via `get_posts`.

 Happy to take up fixing.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/43174>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list