WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#9621 closed enhancement (wontfix)

Clean up filter links for admin pages

Reported by: scribu Owned by: scribu
Milestone: Priority: normal
Severity: normal Version: 2.7.1
Component: Administration Keywords: needs-patch early
Focuses: Cc:

Description

Currently, several admin pages have filter links at the top, so they should all use a single function to generate them consistently.

Attachments (1)

clean_up_filter_links.patch (10.1 KB) - added by scribu 5 years ago.
Backwards compatible patch for edit.php and edit-pages.php

Download all attachments as: .zip

Change History (14)

comment:1 Denis-de-Bernardy5 years ago

there also are filters in the plugins and users screens.

comment:2 scribu5 years ago

Yes, I know. I plan to write a patch for the rest of the admin pages just as soon as this one gets commited.

comment:3 Denis-de-Bernardy5 years ago

  • Keywords tested commit added

the current patch works, then. :-)

comment:4 follow-up: azaozz5 years ago

That's a good idea but renaming the filter post_stati (which is available in 2.7) will break all plugins that are using it. The links for each page are a bit different and it seems this patch would make them harder to translate in some cases.

comment:5 in reply to: ↑ 4 scribu5 years ago

Replying to azaozz:

That's a good idea but renaming the filter post_stati (which is available in 2.7) will break all plugins that are using it.

I've added that filter back and it should be backwards compatible.

The links for each page are a bit different and it seems this patch would make them harder to translate in some cases.

They all have (or should have) the same markup, even if the numbers are calculated differently.

These numbers are already translated when they are passed to the parsing function (wp_filter_links). This is better because you don't end up with markup in the l10n strings.

scribu5 years ago

Backwards compatible patch for edit.php and edit-pages.php

comment:6 Denis-de-Bernardy5 years ago

  • Keywords early added

this can wait for 2.9

comment:7 Denis-de-Bernardy5 years ago

  • Milestone changed from 2.8 to 2.9

comment:8 Denis-de-Bernardy5 years ago

patch still applies clean

comment:9 westi5 years ago

  • Keywords needs-patch added; has-patch tested commit removed
  • Has this been tested with a translation applied as you appear to be removing a load of translation strings.
  • Please don't add a plain db query into the page but use (and create is necessary) an api function to get the data back from the database and cache it as required. You may be able to easily extend wp_count_posts to provide what you want here.

comment:10 azaozz5 years ago

Not sure if we should be consolidating these in a single "monster" function that tries to do all for everything. These links are quite different on some pages.

It's not only harder to maintain as it is more complex, but will need to add to it every time we change something somewhere making it even more complex. Also instead of reducing code, it actually adds more.

comment:11 Denis-de-Bernardy5 years ago

sounds like a big wontfix then.

comment:12 azaozz5 years ago

Well, it's just an opinion. Think we should avoid this type of consolidation unless there's a clear advantage that out-weights the disadvantages by a lot.

comment:13 scribu4 years ago

  • Milestone 2.9 deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.