Make WordPress Core

Opened 8 years ago

Last modified 3 weeks ago

#43084 accepted defect (bug)

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 7 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 (17)

#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
7 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 weeks ago

#6 @joedolson
5 weeks 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 weeks 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 weeks ago

  • Keywords has-test-info needs-testing added

#9 @noruzzaman
5 weeks 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 weeks 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
4 weeks ago

  • Keywords commit added; needs-testing removed

@SirLouen commented on PR #10516:


3 weeks ago
#12

@westonruter fixed with the admin url as you suggested.

Note: See TracTickets for help on using tickets.