WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 15 months ago

#12914 new enhancement

Update the Right Now box when publishing via QuickPress

Reported by: nacin Owned by:
Milestone: Future Release Priority: lowest
Severity: trivial Version: 3.0
Component: Administration Keywords: has-patch needs-refresh
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 4 years ago.

Download all attachments as: .zip

Change History (7)

nacin4 years ago

comment:1 nacin4 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...)

comment:2 filosofo4 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' ) ) ); ?>';

comment:3 nacin4 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.)

comment:4 nacin4 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.

comment:5 jane3 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.

comment:6 sabreuse15 months ago

  • Component changed from UI to Administration
  • Keywords ui-focus added
Note: See TracTickets for help on using tickets.