Make WordPress Core

Opened 8 years ago

Closed 7 weeks ago

#43084 closed defect (bug) (fixed)

dashboard confuses published posts count with all posts

Reported by: awardpress's profile awardpress Owned by: joedolson's profile joedolson
Milestone: 7.0 Priority: normal
Severity: normal Version: 2.7
Component: Posts, Post Types Keywords: has-screenshots has-patch has-test-info commit
Focuses: ui, accessibility, administration Cc:

Description (last modified by SergeyBiryukov)

the following is a good first bug for new contributors, IMO!
because it's very easy to fix
https://core.trac.wordpress.org/tickets/good-first-bugs

in dashboard, in "at a glance" section there's a misleading link:

  1. its hyper reference uri leads to list of all existing posts

/wp-admin/edit.php?post_type=post
there are currently 26 posts in my blog

  1. its label is "8 posts" where 8 -- is the number of currently published posts

/wp-admin/edit.php?post_status=publish&post_type=post
there are currently 8 published posts in my blog

  1. its icon is the pushpin. and the pushpin usually means sticky posts

/wp-admin/edit.php?post_type=post&show_sticky=1
there are currently 1 sticky post in my blog

thus, as you can see, this link confuses "all posts (26)" with "published posts (8)" AND with "sticky posts (1)"
I know, WordPress uses pushpin icon to indicate any post, so, maybe, I'm wrong about sticky posts.
But I'm definitely not mistaken in that you cannot label the link as "8 posts" and make it refer to the list of 26 posts -- it should be fixed.
Either label should be "26 posts" or it should go to list of published posts.
IMO, the latter choice (lead to published posts).

Attachments (5)

Selection_002.png (3.6 KB) - added by awardpress 8 years ago.
Selection_005.png (4.2 KB) - added by awardpress 8 years ago.
at-a-glance-in-dashboard.JPG (13.2 KB) - added by birgire 8 years ago.
43084.diff (1.3 KB) - added by susiyanti 8 years ago.
Fixed links in dashboard "at a glance" section for Post/Page number lead to 'Published' post/page, and Comment number to 'Approved' comment.
at a glance patch.zip (15.9 KB) - added by benpinales 7 years ago.
This is only to fix the issue involving the number of posts since that was all that was originally mentioned. This will change the number shown in the "at a glance" menu to display the overall amount of posts.

Download all attachments as: .zip

Change History (28)

#1 @awardpress
8 years ago

I'd like to add a little words about pushpin.
I said that pushpin usually indicates sticky posts. I'd like to correct myself: pushpin usually indicates pinned posts, therefore pushpin. but in Wordpress, 'pinned' posts are called 'sticky'.

#2 @birgire
8 years ago

  • Focuses administration added
  • Keywords has-screenshots added
  • Version changed from 4.9.1 to 2.7

@awardpress Welcome to WordPress core trac.

This seems like a valid concern, but let's see what others have to say about this.

Here's the 4.9.1 source of the relevant function: wp_dashboard_right_now(), introduced in [9265].

The screenshot at-a-glance-in-dashboard.JPG above shows that it contains info on pages and comments as well.

It also displays the number of published pages with:

$text = _n( '%s Page', '%s Pages', $num_posts->publish );

and links to edit.php?post_type=page but not edit.php?post_status=publish&post_type=page.

Similarly the number of approved comments is displayed with:

$text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) );

and it links to edit-comments.php but not to edit-comments.php?comment_status=approved.

On the other hand the number of moderated comments links to edit-comments.php?comment_status=moderated.

@susiyanti
8 years ago

Fixed links in dashboard "at a glance" section for Post/Page number lead to 'Published' post/page, and Comment number to 'Approved' comment.

@benpinales
7 years ago

This is only to fix the issue involving the number of posts since that was all that was originally mentioned. This will change the number shown in the "at a glance" menu to display the overall amount of posts.

#3 @SergeyBiryukov
7 years ago

  • Component changed from Administration to Posts, Post Types
  • Description modified (diff)

#4 @birgire
7 years ago

@benpinales Thanks for the patch.

The usual way to patch is to attach the diff file that only contains the relevant code changes.

Hopefully this is helpful:

https://make.wordpress.org/core/handbook/tutorials/trac/submitting-a-patch/

This ticket was mentioned in Slack in #core by sirlouen. View the logs.


5 months ago

#6 @joedolson
5 months ago

  • Focuses accessibility added
  • Milestone changed from Awaiting Review to 7.0
  • Owner set to joedolson
  • Status changed from new to accepted

Marking this as an accessibility issue, because the text label of the link doesn't match the target.

This ticket was mentioned in PR #10516 on WordPress/wordpress-develop by @SirLouen.


5 months ago
#7

  • Keywords has-patch added

This ticked poped in the last bug scrub

The comments between joe and myself were basically:

  1. Should we make consistent what we see and what we actually received? In this case we should be linking to the published, as the OP suggests
  2. Also Joe commented, that we already have a link to all posts in the nav bar, so this could add a different value
  3. I wanted to add, that knowing exactly where the link was pointing could be an improvement in the copy (adding "Published")

With these 3 elements here is the patch

Note: The comments have already the right link, so we are not touching this.

#8 @SirLouen
5 months ago

  • Keywords has-test-info needs-testing added

#9 @noruzzaman
5 months ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/10516

Environment

  • WordPress: 7.0-alpha-20251113.160841
  • PHP: 7.4.31-dev
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.40.1)
  • Browser: Chrome 142.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.3
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Actual Results

  1. ✅Issue resolved with patch.
    • "At a Glance" now correctly links to /edit.php?post_status=publish&post_type=post.
    • Label and link match the published posts count.

Screenshots

https://i.ibb.co.com/2YMLMM06/Screenshot-2.png

#10 @huzaifaalmesbah
5 months ago

Test Report

Description

Patch tested: https://github.com/WordPress/wordpress-develop/pull/10516.diff

Environment

  • WordPress: 7.0-alpha-61215-src
  • PHP: 8.4.12
  • Server: nginx/1.29.1
  • Database: mysqli (Server: 9.4.0 / Client: mysqlnd 8.4.12)
  • Browser: Chrome 142.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.3
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Actual Results

  1. ✅ Issue resolved with patch.

Screenshots

Before Apply Patch After Apply Patch ✅
https://i.ibb.co.com/84t726y2/Huzaifa-20251114093313.png https://i.ibb.co.com/TBf1GTMd/Huzaifa-20251114093240.png

#11 @SirLouen
5 months ago

  • Keywords commit added; needs-testing removed

@SirLouen commented on PR #10516:


5 months ago
#12

@westonruter fixed with the admin url as you suggested.

#13 @joedolson
3 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 61555:

Posts, Post Types: Clarify "at a glance" Dashboard links.

"At a glance" links in the dashboard were labeled with the count of published posts, but linked to the All posts view. Change the links so that they target only the published posts list and update link text to clarify.

Props awardpress, birgire, benpinales, susiyanti, sergeybiryukov, sirlouen, noruzzaman, huzaifaalmesbah, westonruter, nikunj8866, joedolson.
Fixes #43084.

This ticket was mentioned in PR #11127 on WordPress/wordpress-develop by @ocean90.


7 weeks ago
#14

Before:
https://github.com/user-attachments/assets/7f2595af-733b-4c32-b6f6-766129532676

After:
https://github.com/user-attachments/assets/20cb2605-2956-4431-a4a8-183dc97401f4

Trac ticket: https://core.trac.wordpress.org/ticket/43084

## Use of AI Tools

None.

@krokodok commented on PR #11127:


7 weeks ago
#15

Can confirm that this works!

#16 @ocean90
7 weeks ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

After [61555], the icons for the right now widget are using the default icons. Attached pull request fixes this.

@stefan.velthuys commented on PR #11127:


7 weeks ago
#17

Can also confirm that the correct icons are displayed again.

@hubeRsen commented on PR #11127:


7 weeks ago
#18

Can confirm that the correct icons are displayed. 👍🏼

@karinchristen commented on PR #11127:


7 weeks ago
#19

The correct icons are now displayed.

This ticket was mentioned in Slack in #core-test by r1k0. View the logs.


7 weeks ago

#21 @ozgursar
7 weeks ago

Patch Testing Report

Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11127

Environment

  • WordPress: 7.0-beta2-61752-src
  • PHP: 8.2.29
  • Server: nginx/1.29.4
  • Database: mysqli (Server: 8.4.7 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 145.0.0.0
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Steps taken

  1. View At a Glance in the Dashboard
  2. Published Posts' icon is circle (css content \f159) and Published Pages'
  3. Apply patch
  4. Published posts' icon is pin (css content \f109) and Published pages' icon is files (css content \f105)
  5. ✅ Patch is solving the problem

Expected result

We are expecting to see correct icon next to published posts and pages.

Screenshots/Screencast with results

Before
https://i.imgur.com/hGFN9dh.png

After
https://i.imgur.com/35IsHM9.png

#22 @joedolson
7 weeks ago

  • Status changed from reopened to accepted

#23 @joedolson
7 weeks ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 61799:

Posts, Post Types: Restore post type icons in At a Glance.

Following [61555], the post type icons were missing from the At a Glance dashboard widget. Restore the post type class omitted from the previous commit.

Props ocean90, krokodok, karinchristen, hubersen, stefanvelthuys, ozgursar, sabernhardt, joedolson.
Fixes #43084.

Note: See TracTickets for help on using tickets.