WordPress.org

Make WordPress Core

Opened 10 years ago

Closed 5 years ago

#12914 closed enhancement (invalid)

Update the Right Now box when publishing via QuickDraft

Reported by: nacin Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Administration Keywords: has-patch
Focuses: ui Cc:

Description

When you publish a new post via QuickPress, it'd be cool for the Right Now box to then ++ the number of published posts.

Quick proof of concept patch attached.

Attachments (1)

12914.diff (1.4 KB) - added by nacin 10 years ago.

Download all attachments as: .zip

Change History (8)

@nacin
10 years ago

#1 @nacin
10 years ago

Other thoughts:

  1. Updating the tags count would be cool too, but it'd require some more tricks and re-engineering.
  1. The selector I used in the POC patch for the actual '# Posts' link is janky. Additionally, someone without edit_posts wouldn't have a link there, so we would need to account for that. (But, someone without edit_posts wouldn't have QuickPress by default either...)

#2 @filosofo
10 years ago

There's already inline JavaScript in the markup printed by that widget. Why not add some more and have it update the post count with the actual number as determined by number_format_i18n()?

And may as well give those count wrappers some ids instead of a particular response message. Then it's really simple:

var pCount = document.getElementById('post-count-link');
if ( pCount ) 
   pCount.innerHTML = '<?php echo esc_js( number_format_i18n( wp_count_posts( 'post' ) ) ); ?>';

#3 @nacin
10 years ago

There's already inline JavaScript in the markup printed by that widget. Why not add some more and have it update the post count with the actual number as determined by number_format_i18n()?

Sounds like a good idea to me. And yeah, we'd need to supply an ID. Hence why I insulted my selector. (Patch was just a quick POC.)

#4 @nacin
10 years ago

  • Keywords has-patch needs-refresh added
  • Milestone changed from Awaiting Triage to 3.1
  • Priority changed from normal to lowest
  • Severity changed from normal to trivial

Patch here, but it needs an update. Also if QuickPress is changed in the 3.1 cycle then we will need to take that/this into account.

#5 @jane
10 years ago

  • Milestone changed from 3.1 to Future Release
  • Version set to 3.0

Punting as we are entering beta. Can reconsider with 3.2 and updated patch.

#6 @sabreuse
8 years ago

  • Component changed from UI to Administration
  • Keywords ui-focus added

#7 @chriscct7
5 years ago

  • Keywords needs-refresh removed
  • Milestone Future Release deleted
  • Priority changed from lowest to normal
  • Resolution set to invalid
  • Severity changed from trivial to normal
  • Status changed from new to closed
  • Summary changed from Update the Right Now box when publishing via QuickPress to Update the Right Now box when publishing via QuickDraft

This is now QuickDraft. As such the RightNow only counts published posts not draft ones. Therefore it works as intended now. Closing as invalid

Note: See TracTickets for help on using tickets.