Make WordPress Core

Opened 7 years ago

Last modified 6 years ago

#43084 new defect (bug)

dashboard confuses published posts count with all posts

Reported by: awardpress's profile awardpress Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 2.7
Component: Posts, Post Types Keywords: has-screenshots
Focuses: ui, 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 7 years ago.
Selection_005.png (4.2 KB) - added by awardpress 7 years ago.
at-a-glance-in-dashboard.JPG (13.2 KB) - added by birgire 7 years ago.
43084.diff (1.3 KB) - added by susiyanti 6 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 6 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 (9)

#1 @awardpress
7 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
7 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
6 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
6 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
6 years ago

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

#4 @birgire
6 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/

Note: See TracTickets for help on using tickets.