[wp-trac] [WordPress Trac] #59136: Hard limit of 3 posts enforced on Dashboard Recent Drafts

WordPress Trac noreply at wordpress.org
Thu Aug 17 22:29:20 UTC 2023


#59136: Hard limit of 3 posts enforced on Dashboard Recent Drafts
----------------------------+-----------------------------
 Reporter:  jmarlin         |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Administration  |    Version:  6.3
 Severity:  minor           |   Keywords:
  Focuses:                  |
----------------------------+-----------------------------
 The number of posts in the Recent Drafts area of the Dashboard has a hard
 limit of 3. It's possible this was intentional, but it looks like some
 debugging that was left in place to me. If not, I'm not sure what the
 purpose of this limit would be as it could have also been achieved by
 modifying the default query parameters. I discovered this when trying to
 employ the associated filter like so:
 {{{#!php
 <?php
 // Increase number of drafts listed on dashboard
 add_filter('dashboard_recent_drafts_query_args', function ($args) {
         $args['posts_per_page'] = 20;
         return $args;
 });
 }}}

 The posts_per_page parameter has no effect in this case because of the
 following line in wp-admin/includes/dashboard.php
 https://github.com/WordPress/WordPress/blob/6.3-branch/wp-
 admin/includes/dashboard.php#L659

 If a max of 3 rows is desirable, I would recommend removing the
 array_slice line and simply modifying the default query here:
 https://github.com/WordPress/WordPress/blob/6.3-branch/wp-
 admin/includes/dashboard.php#L623

 Then users who want it can modify this query to increase the number of
 rows listed here. My use case is running a larger WP site with many
 authors. Authors may have many drafts in play at once, so it's useful to
 see more at a glance.

 Thanks!

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


More information about the wp-trac mailing list