#59136 closed defect (bug) (worksforme)
Hard limit of 3 posts enforced on Dashboard Recent Drafts
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 6.3 |
Component: | Administration | Keywords: | has-patch |
Focuses: | Cc: |
Description
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 // 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!
Attachments (2)
Change History (6)
This ticket was mentioned in PR #5030 on WordPress/wordpress-develop by @sukanta7660.
11 months ago
#1
- Keywords has-patch added
@
11 months ago
i have increased default 3 draft limit to 5 so now on dashboard of admin it will show 5 drafts
@mayuripatel commented on PR #5030:
11 months ago
#3
Hello ,
i have applied patch and attached my diff file named 59136.diff on this ticket : https://core.trac.wordpress.org/attachment/ticket/59136/59136.diff , kindly check and review
Hello ,