Make WordPress Core

Opened 9 years ago

Closed 8 years ago

#33414 closed enhancement (fixed)

Add pending count to HTML title on pending comments page

Reported by: peterwilsoncc's profile peterwilsoncc Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch commit
Focuses: javascript, administration Cc:

Description

On the comments page in the dashboard, add the pending comments count to the HTML title similar to Gmail's new mail count, the Twitter notifications page amongst others.

The count would update as new comments come in should an admin have the page open.

Attachments (6)

33414.diff (969 bytes) - added by Kau-Boy 9 years ago.
33414.2.diff (4.8 KB) - added by wonderboymusic 9 years ago.
33414.3.diff (4.1 KB) - added by wonderboymusic 9 years ago.
33414.4.diff (3.2 KB) - added by wonderboymusic 9 years ago.
33414.5.diff (3.6 KB) - added by wonderboymusic 9 years ago.
33414.6.diff (2.0 KB) - added by ocean90 8 years ago.

Download all attachments as: .zip

Change History (21)

#1 follow-up: @rachelbaker
9 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to low

@peterwilsoncc This would be a nice small change that would delight moderators for site that receive frequent comments. Would you be able to take a stab at a patch to help move this ticket along?

#2 in reply to: ↑ 1 @peterwilsoncc
9 years ago

  • Owner set to peterwilsoncc
  • Status changed from new to assigned

Replying to rachelbaker:

@peterwilsoncc Would you be able to take a stab at a patch to help move this ticket along?

Sure, will do.

#3 @Kau-Boy
9 years ago

I wrote a little patch that will add the number to the title. It will only do it in HTML, not yet in JS (working on it).

This patch was provided by the #wcnkpg Contributor Day.

@Kau-Boy
9 years ago

#4 @wonderboymusic
9 years ago

  • Keywords has-patch added; needs-patch removed
  • Milestone changed from Future Release to 4.4
  • Owner changed from peterwilsoncc to wonderboymusic

#5 @wonderboymusic
9 years ago

33414.2.diff adds the JS to dynamically update the title with proper l10n

#6 @wonderboymusic
9 years ago

In 33806:

get_comment_count() currently increments awaiting_moderation when comments are in the trash. This occurs because case 0: will match any value passed to switch that is a string that isn't specified in the list of cases. This is terrifying.

  • Cases for 0 and 1 should be '1' and '0'
  • Add unit tests for get_comment_count(). Currently, there are none.

See #33414.

#7 @afercia
9 years ago

@wonderboymusic thanks very much for this :) see ticket:19903#comment:10. Also, I'd suggest to have a look at #32362 for 4.4 :)

#8 @Kau-Boy
9 years ago

Wow @wonderboymusic that looks like a pretty good solution. I haven't been able to finish my JS patch yesterday, but your look better anyways :)

#9 @wonderboymusic
9 years ago

33414.4.diff updates the patch to use wp_count_comments(). It returns comments awaiting moderation on a property called moderated? Why is this code so weird?

#10 @wonderboymusic
9 years ago

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

In 33821:

Comments: dynamically update the document title text of the Comments List Table page when dynamically updating the number of comments awaiting moderation.

Fixes #33414.

#11 @wonderboymusic
9 years ago

In 33982:

After [33821], when dynamically updating the document title text of the Comments List Table page, operate only on the fragment that contains the comment count. This prevents us from including other numbers that may be present in the other title parts (site title, etc).

See #33414.

#12 @ocean90
8 years ago

  • Keywords needs-patch added; has-patch removed
  • Priority changed from low to normal
  • Resolution fixed deleted
  • Status changed from closed to reopened

@ocean90
8 years ago

#13 @ocean90
8 years ago

  • Keywords has-patch added; needs-patch removed

@wonderboymusic Please take a look at 33414.6.diff.

#14 @wonderboymusic
8 years ago

  • Keywords commit added

looks good, please commit with vigor

#15 @ocean90
8 years ago

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

In 35615:

Comments: Dynamically update the document title text for all languages, not only English.

See [33821].
Fixes #33414.

Note: See TracTickets for help on using tickets.