Make WordPress Core

Opened 13 years ago

Closed 12 years ago

#17838 closed enhancement (fixed)

Allow plugins to change update count

Reported by: usermrpapa's profile usermrpapa Owned by: nacin's profile nacin
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.2
Component: Administration Keywords: has-patch
Focuses: Cc:

Description

currently, plugins can easily affect the core updates screen and add additional elements to update for their plugin.

however, the total update count in the admin left side nav menu is hardcoded to only include wp core, theme and plugin available updates. So when you visit the core update screen, the count may not agree with the available updates since plugins can add their own.

a simple filter on the count will allow plugins to have their updates show in the count.

patch attached against R18320

Attachments (7)

update-count-filter.patch (592 bytes) - added by usermrpapa 13 years ago.
update-filter-count2.patch (883 bytes) - added by usermrpapa 13 years ago.
patch refresh for [18468]
update-filter-patch3.patch (790 bytes) - added by usermrpapa 13 years ago.
update-filter-patch-4.patch (490 bytes) - added by usermrpapa 13 years ago.
update-filter-patch-5.patch (492 bytes) - added by usermrpapa 12 years ago.
17838.patch (489 bytes) - added by SergeyBiryukov 12 years ago.
With proper formatting
17838.2.patch (514 bytes) - added by SergeyBiryukov 12 years ago.

Download all attachments as: .zip

Change History (21)

#1 @usermrpapa
13 years ago

  • Version set to 3.2

#2 @usermrpapa
13 years ago

  • Cc steve@… added

#3 @dd32
13 years ago

A common method plugins have been doing, is to simply inject their updates into the global transient, as a result, the counts are correct (Assuming it's a plugin or theme update you're talking about here) and in most cases, it results in less code for the author to write (Since core picks up the update like it's one from WordPress.org and handles it correctly), and a more seemless experience for the user.

#4 @usermrpapa
13 years ago

its plugins for a wp plugin. and themes for a wp plugin. ;)

our plugin supports plugins for it and themes as well. and the plugins and themes (sub plugins and themes??) are not stored/resident in the wp plugins and themes directories...

so we have extended the upgrader classes for our upgrade 'types'. if we put them in the global transients, the wp upgrader fails because of the storage locations. So we have our own upgrade transients.

perhaps I am missing something - if so, please explain further...

I realize its too late in the 3.2 cycle.

#5 @usermrpapa
13 years ago

  • Keywords has-patch added

@usermrpapa
13 years ago

patch refresh for [18468]

#6 @usermrpapa
13 years ago

patch refreshed for [18468] that consolidated update counts...

since the api allows plugins to create new update sections, would be nice to affect the count too...

#7 @nacin
13 years ago

If anything, the entire $count array should be filtered.

#8 @usermrpapa
13 years ago

very fair point... patch updated...

#9 @usermrpapa
13 years ago

refreshed patch for wp 3.4... hoping to get it in this this version so plugins can affect the update counts...

#10 @usermrpapa
13 years ago

any shot at 3.4?

#11 @usermrpapa
12 years ago

trying again for 3.5... updated patch attached...

#12 @usermrpapa
12 years ago

fingers still crossed... ;)

@SergeyBiryukov
12 years ago

With proper formatting

#13 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.5

Perhaps it would make sense to filter the whole returned result (17838.2.patch).

#14 @nacin
12 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In [21874]:

Add a filter to wp_get_update_data. props usermrpapa, SergeyBiryukov. fixes #17838.

Note: See TracTickets for help on using tickets.