WordPress.org

Make WordPress Core

Opened 21 months ago

Last modified 5 days ago

#25408 assigned task (blessed)

Ability to specify that a list table column is "primary"

Reported by: helen Owned by: stephdau
Milestone: 4.3 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch needs-testing
Focuses: Cc:

Description

List tables have a "primary" column of sorts; that is, the one with the row actions. We should be able to specify which column is the primary one via API, apply an appropriate class, and display the row actions in cells in that column. Currently, developers customizing the list table columns often need to re-create row actions if they do not use the post name column, or just live with the row actions appearing in a less sensible spot.

This thought stems from three things in particular:

  1. The above customization example.
  2. Old experiments (nearly exactly 2 years ago) in making list tables responsive: http://cl.ly/3F1L0N3z1M0F0Z3t0X3W in #18198.
  3. The assortment of selectors in [25595] that are not particularly robust and not easily reused by developers. We should be able to target something like .has-row-actions instead.

Attachments (25)

25408.diff (46.1 KB) - added by DaveAl 21 months ago.
25408.2.diff (49.5 KB) - added by DaveAl 21 months ago.
25408.3.diff (57.8 KB) - added by jesin 14 months ago.
Modified 25408.2.diff based on WordPress 4.0-alpha
25408.4.diff (65.5 KB) - added by stephdau 6 weeks ago.
25408.5.diff (59.5 KB) - added by stephdau 6 weeks ago.
25408.6.diff (59.9 KB) - added by stephdau 5 weeks ago.
25408.7.diff (60.0 KB) - added by stephdau 5 weeks ago.
25408.8.diff (64.5 KB) - added by stephdau 5 weeks ago.
25408.9.diff (65.1 KB) - added by stephdau 5 weeks ago.
25408.10.diff (64.7 KB) - added by stephdau 5 weeks ago.
25408.11.diff (64.7 KB) - added by stephdau 5 weeks ago.
25408.12.diff (63.7 KB) - added by stephdau 5 weeks ago.
25408.13.diff (65.0 KB) - added by stephdau 5 weeks ago.
25408.14.diff (65.0 KB) - added by stephdau 5 weeks ago.
25408.15.diff (64.4 KB) - added by stephdau 5 weeks ago.
25408.16.diff (64.4 KB) - added by stephdau 5 weeks ago.
25408.17.diff (416 bytes) - added by boonebgorges 5 weeks ago.
25408.18.diff (1.5 KB) - added by stephdau 4 weeks ago.
25408.19.diff (3.1 KB) - added by helen 4 weeks ago.
25408-users-list-table.diff (869 bytes) - added by stephdau 3 weeks ago.
25408-list-table-headers-test.diff (647 bytes) - added by stephdau 3 weeks ago.
25408-missing-array-indexes.diff (811 bytes) - added by georgestephanis 3 weeks ago.
25408-list-table-headers-test.2.diff (646 bytes) - added by stephdau 3 weeks ago.
An alternative to 25408-list-table-headers-test.diff, if we wanted to future-proof things a bit.
25408.20.diff (730 bytes) - added by kovshenin 3 weeks ago.
25408.21.diff (835 bytes) - added by kovshenin 3 weeks ago.

Download all attachments as: .zip

Change History (104)

comment:1 @helen21 months ago

  • Milestone changed from Awaiting Review to 3.7

Putting in 3.7 especially to address point 3 - if not done extremely soon, we should punt it again.

comment:2 @helen21 months ago

  • Type changed from enhancement to task (blessed)

comment:3 @DaveAl21 months ago

EDIT:
Ok, I see I've misread the requirements. In any case, I've rectified that situation and attached a patch. Feedback is appreciated.

I made some mistakes in the first attachment, so please ignore it and use the second one .

In essence:
I've added two new methods to class WP_List_Table, both intended to be over-ridden, but not abstract:

  1. get_primary_column(): Takes no arguments, returns the name of the desired primary column. Hardcoded much the same way as get_columns, but just one string.
  2. handle_actions( $item, $column_name, $primary ): Takes three arguments: the item - whether post, user, comment, etc. - the current column_name, and the name of the primary column. If the column name matches the primary, then the function returns the actions to be displayed.

I've also modified the various list tables that display row actions to use this new functionality. Some have single_row over-ridden, some don't. Some override the row_actions function, others just directly created and displayed their row actions in the default primary. The latter ones are where I extracted that code to override handle_actions.

The only one I didn't touch was class-wp-links-list-table.php because I don't have the links manager plugin to test it with yet, so I left that one alone.

Here's a list of the files I modified, which will now have the class "has-row-actions" in the primary cells.
class-wp-comments-list-table.php
class-wp-list-table.php
class-wp-media-list-table.php
class-wp-ms-sites-list-table.php
class-wp-ms-themes-list-table.php
class-wp-ms-users-list-table.php
class-wp-plugins-list-table.php
class-wp-posts-list-table.php
class-wp-terms-list-table.php
class-wp-users-list-table.php

Last edited 21 months ago by DaveAl (previous) (diff)

comment:4 @johnbillion21 months ago

  • Keywords needs-patch added
  • Milestone changed from 3.7 to Future Release

@DaveAl21 months ago

@DaveAl21 months ago

comment:5 @DaveAl21 months ago

  • Keywords has-patch needs-testing added; needs-patch removed

comment:6 @helen14 months ago

Related: #28011, #26302.

Putting into 4.0 - this will simplify a lot of things in JS and responsive CSS, make accessibility better, and enhance developer happiness. Will review patch, unless somebody beats me to it.

comment:7 @jesin14 months ago

  • Keywords needs-refresh added; has-patch needs-testing removed

By looking at the patch and the current file I can say that the line numbers have changed a lot since the patch was uploaded. The code in the original files have changed too.

comment:8 @samuelsidler14 months ago

  • Milestone changed from Future Release to 4.0

@jesin14 months ago

Modified 25408.2.diff based on WordPress 4.0-alpha

comment:9 @jesin14 months ago

  • Keywords has-patch needs-testing added; needs-refresh removed

comment:10 @helen11 months ago

  • Type changed from task (blessed) to enhancement

A lot going on in the patch, late for 4.0 (as much as obviously I want this). Patch seems to be heading in a good direction. One thing I'm noticing is setting HTML classes - should append to the set if primary column, rather than if/else, so it's easier to follow. Places where it's echoed inline should probably be set to a variable first for clarity as well.

comment:11 @helen11 months ago

  • Keywords 4.1-early added
  • Milestone changed from 4.0 to Future Release

comment:12 @ircbot11 months ago

This ticket was mentioned in IRC in #wordpress-dev by helen. View the logs.

comment:13 @jeremyfelt4 months ago

In 31674:

Reveal row actions on focus in the network users list table.

In the future, we'll re-factor this selector pile in a way that makes things cleaner. See #25408.

Props afercia.

Fixes #31003.

comment:14 @slackbot7 weeks ago

This ticket was mentioned in Slack in #design by helen. View the logs.

comment:15 @helen7 weeks ago

  • Milestone changed from Future Release to 4.3

In conjunction with #32395.

comment:16 @helen7 weeks ago

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

comment:17 @stephdau6 weeks ago

@helen: Kept running with 25408.3.diff, as discussed on Slack, but it never got to dealing how a primary column is actually selected/changed. The user-level setting of primary column sounds like it should be a screen option paired with the current "Show on screen" one (lists shown/hidden columns when dealing with a list table).

This is where things get a bit complex.

  • "Show on screen" is in wp-admin/includes/screen.php
  • That's JS-enabled so that what the user selects is rendered live
  • Assuming the selection of the primary column would be a drop-down (preferred because of interactions below) or series of radio (meh, considering we list columns as checkboxes above) underneath that list of displayed columns
  • We have to select the default in initial page load
  • Then, if a user hides a column, it should be taken away from the primary columns list, live, and said list revert to its default (some special columns can't be hidden).
  • Should be added back, live, if unhidden.
  • In an ideal world, user shouldn't have to "apply" primary column change, it should be live too

What's your (and others') perspective on this?

comment:18 @stephdau6 weeks ago

Result of chat session with Helen regarding previous comment:

  • no UI, just programmatic column selection (ie: via filter)
  • 1 generic filter, with context passed via arguments
  • at least for "round 1"

That makes my day. Going with that.

@stephdau6 weeks ago

comment:19 @stephdau6 weeks ago

Here we go: 25408.4.diff:

  • was rebuilt from scratch based on the previous patches, brings the code in line with trunk (4.3-alpha, r32551)
  • builds upon the previous work: refactoring and based on ticket feedback
  • adds a list_table_primary_column filter in WP_List_Table::get_primary_column_name(), so developers can change the default column via the related API, with $default (returnable) and $context (screen id) as arguments (as requested).
Last edited 6 weeks ago by stephdau (previous) (diff)

comment:20 @stephdau6 weeks ago

Noticing my IDE removed some of the whitespace around parenthesis and such (when I cut and pasted)... Will fix in a future patch. Code works the same, for testing.

@stephdau6 weeks ago

comment:21 @stephdau6 weeks ago

25408.5.diff:

  • sets the plugin column as being the default again (my mistake in prev patch)
  • cleans up some whitespace issues in the previous patch (IDE auto-reformat on paste)

comment:22 follow-up: @afercia5 weeks ago

Tested a bit the patch, thanks very much @stephdau :) Noticed a few things worth considering:

  • small typo: for Posts/Pages the default primary column is set to "author"
  • wouldn't be better to use $this->screen->id as dynamic portion of the hook name?
  • doing the above, would we really need to pass $this->screen->id as additional variable?
  • in /network/users.php the "Sites" column needs some special treatment, it needs the "has-row-actions" CSS class (links not revealed on focus see #31003 for reference)
  • is it worth it to apply all this new stuff to Link Manager too?
  • consider to update the selector in common.js

@stephdau5 weeks ago

comment:23 in reply to: ↑ 22 ; follow-up: @stephdau5 weeks ago

Replying to afercia:

Tested a bit the patch, thanks very much @stephdau :)

Thank YOU, for the testing. :)
Added new patch: 25408.6.diff. See further info below below.

Noticed a few things worth considering:

  • small typo: for Posts/Pages the default primary column is set to "author"

Fixed in new patch, thanks. Guess that was set to my last test. :)

  • wouldn't be better to use $this->screen->id as dynamic portion of the hook name?
  • doing the above, would we really need to pass $this->screen->id as additional variable?

Personally, as a dev, I'd like both a generic with context as arg (as per prev patch), or one as you describe (context via dynamic hook name). I see value in both. Passing it as an arg is what @helen and I had decided for this round, but I'm not attached to either. See WP_List_Table::get_primary_column_name() in new patch for an example of both, from which we can decide.

  • in /network/users.php the "Sites" column needs some special treatment, it needs the "has-row-actions" CSS class (links not revealed on focus see #31003 for reference)

I can do that, but I don't understand what you mean. See https://cloudup.com/c5p3yXllT7K

  • 1st screenshot is with username as primary, edit/view show on kb focus of blog url)
  • 2nd screenshot is with blogs as primary, edit/view also show next to url, then edit link (only action for user) shows underneath the blogs list.
  • is it worth it to apply all this new stuff to Link Manager too?

Can do, so long as we're cool with the logic. I'd assume yes. Original patches I started from didn't address it, not sure why.

  • consider to update the selector in common.js

I'm not sure what that really means per se. :) Could you apply the patch, make your change, add it to the patch, and submit it, so I can see?

Thanks.

comment:24 in reply to: ↑ 23 @afercia5 weeks ago

Replying to stephdau:

Personally, as a dev, I'd like both a generic with context as arg (as per prev patch), or one as you describe (context via dynamic hook name). I see value in both. Passing it as an arg is what @helen and I had decided for this round, but I'm not attached to either.

I'm not attached to either too :) just a bit concerned about consistency with other similar hooks noticing that they all have a dynamic hook name.

  • in /network/users.php the "Sites" column needs some special treatment, it needs the "has-row-actions" CSS class (links not revealed on focus see #31003 for reference)

I can do that, but I don't understand what you mean.

One of the side goals of this ticket would be replacing in common.js that "terrible selectors pile" as @helen named it :) with just one CSS selector. See:
https://core.trac.wordpress.org/browser/tags/4.2/src/wp-admin/js/common.js#L481
should use as selector just ".has-row-actions". Once you do that, the edit/view links in the "Sites" column won't show on keyboard focus because that column is not the primary one and doesn't have a ".has-row-actions" class.

  • consider to update the selector in common.js

I'm not sure what that really means per se.

See above :)

@stephdau5 weeks ago

comment:25 @stephdau5 weeks ago

In 25408.7.diff, I've replaced if ( $primary === $column_name ) { by if ( $primary === $column_name || 'blogs' === $column_name ) { (see L170-173 in src/wp-admin/includes/class-wp-ms-users-list-table.php in patch), which will always apply has-row-actions to the blogs/sites column.

The same update also bring the patch in line with the latest trunk.

comment:26 @stephdau5 weeks ago

@helen: can you give us your opinion on the filter (context as argument, or context in dynamic hook name?)? See WP_List_Table::get_primary_column_name() in patch.

Links list table: one of the comments above states "The only one I didn't touch was class-wp-links-list-table.php because I don't have the links manager plugin to test it with yet, so I left that one alone.", so now I know why it wasn't previously handled. Will add to future patch.

Last edited 5 weeks ago by stephdau (previous) (diff)

@stephdau5 weeks ago

comment:27 @stephdau5 weeks ago

25408.8.diff adds the same logic to src/wp-admin/includes/class-wp-links-list-table.php.

Left:

  • decide how we want the filter(s) to exist in WP_List_Table::get_primary_column_name().
  • dealing with wp-admin/js/common.js if we want to do that here (I wouldn't,since it has its own ticket).

@stephdau5 weeks ago

@stephdau5 weeks ago

comment:28 @stephdau5 weeks ago

25408.10.diff implements most of what @helen and I discussed on Slack:

  • also adds column-primary when applying has-row-actions, except for the blogs column in WP_MS_Users_List_Table, which needs the latter at all times, but not the former.
  • only implements a statically-named filter in WP_List_Table::get_primary_column_name(), with context as argument. Dynamically-named filters are needlessly difficult to document/use, and we don't really implement new ones.

One thing I did not do is renaming *::handle_row_actions() to *::row_actions() because they are both implemented in the parent class, are different enough (args, etc), and both are valuable as is. Opened to renaming it, just not to that.

Also switched WP_Comments_List_Table::handle_row_actions() to return and not echo, for consistency.

Last edited 5 weeks ago by stephdau (previous) (diff)

@stephdau5 weeks ago

comment:29 @stephdau5 weeks ago

25408.11.diff updates the previously faulty logic for the column-primary assignment in WP_MS_Users_List_Table.

comment:30 @slackbot5 weeks ago

This ticket was mentioned in Slack in #design by stephdau. View the logs.

@stephdau5 weeks ago

comment:31 @stephdau5 weeks ago

25408.12.diff merges in and fixes conflicts with r32630. Should be all set.

@stephdau5 weeks ago

@stephdau5 weeks ago

@stephdau5 weeks ago

@stephdau5 weeks ago

comment:32 @afercia5 weeks ago

Related: #31654 and #32170

comment:33 @helen5 weeks ago

In 32644:

List tables: introduce the concept of a "primary" column.

This becomes the column that contains the row actions, and allows for a more flexibility, particularly with custom post types and list tables. To (re)define the primary column, use the list_table_primary_column filter, which receives the column name and the screen ID as arguments.

props stephdau, DaveAl, jesin.
see #25408.

comment:34 follow-up: @helen5 weeks ago

Leaving this open until the dust settles a bit, but woohoo!

comment:35 @helen5 weeks ago

In 32645:

After [32644], sanity for a pile of selectors.

see #25408.

comment:36 in reply to: ↑ 34 @afercia5 weeks ago

Replying to helen:

woohoo!

I couldn't have said it better myself :) thanks very much stephdau, DaveAl, jesin, helen.

comment:37 @helen5 weeks ago

afercia noted that this drops some special classes for the media image/icon column, but I'd like to get rid of that as a separate column anyway, see #29993 and #32254. Leaving a note here so that if we don't drop that column (which would make #32395 more difficult, so it's unlikely we won't do it), we add those classes back.

@boonebgorges5 weeks ago

comment:38 follow-up: @boonebgorges5 weeks ago

Looks like we missed WP_Post_Comments_List_Table - maybe because of the way it overrides get_column_info(). See 25408.17.diff.

comment:39 in reply to: ↑ 38 @stephdau5 weeks ago

Replying to boonebgorges:

Looks like we missed WP_Post_Comments_List_Table

I totally did.

maybe because of the way it overrides get_column_info(). See 25408.17.diff.

Nope, because I wasn't expecting a 2nd class being defined in the same file, and I never even saw it... Totally my bad. Most excellent catch!

cc @helen for quick commit (.17).

comment:40 @helen5 weeks ago

In 32651:

Define a primary column for WP_Post_Comments_List_Table.

props boonebgorges.
see #25408.

comment:41 @afercia5 weeks ago

Just noticed the Network Themes table cell with row-actions misses the has-row-actions column-primary CSS classes. Maybe would need same treatment given to the Plugins table, see
$extra_class = ' has-row-actions column-primary'; etc.

comment:42 @ocean905 weeks ago

If you click/focus one of the actions links in the Plugins table all other actions links will be hidden, see https://cloudup.com/cFt-2oOJHrt.

comment:43 @helen5 weeks ago

Themes/plugins list tables, both single and multisite, could probably lose the has-row-actions part (there's JS that's likely what's causing @ocean90's issue), and I don't know if the primary column for those should really be allowed to be redefined. Thoughts?

comment:44 @DrewAPicture4 weeks ago

In 32660:

Add missing return descriptions and fix formatting of inline documentation introduced in [32644].

See #25408. See #32246.

comment:45 @DrewAPicture4 weeks ago

In 32661:

Fix formatting and add a missing return description for inline documentation introduced in [32644] for WP_Links_List_Table.

See #25408. See #32246.

comment:46 @DrewAPicture4 weeks ago

In 32662:

Fix formatting and add missing return descriptions for inline documenation introduced in [32644] for WP_List_Table.

Also fixes an error introduced in [32661] for WP_Links_List_Table.

See #25408. See #32246.

comment:47 @DrewAPicture4 weeks ago

In 32663:

Fix formatting and add a missing return description for inline documentation introduced in [32644] for WP_Media_List_Table.

See #25408. See #32246.

comment:48 @DrewAPicture4 weeks ago

In 32664:

Fix formatting and add missing return descriptions for inline documentation introduced in [32644] for WP_MS_Sites_List_Table.

See #25408. See #32246.

comment:49 @DrewAPicture4 weeks ago

In 32665:

Fix syntax and add a missing return description for inline documentation introduced in [32644] for WP_MS_Themes_List_Table.

See #25408. See #32246.

comment:50 @DrewAPicture4 weeks ago

In 32666:

Fix formatting and add missing return descriptions for inline documentation introduced in [32644] for WP_MS_Users_List_Table.

See #25408. See #32246.

comment:51 @DrewAPicture4 weeks ago

In 32667:

Fix formatting and add a missing return description for inline documentation introduced in [32644] for WP_Plugins_List_Table.

See #25408. See #32246.

comment:52 @DrewAPicture4 weeks ago

In 32668:

Fix syntax and add missing return descriptions for inline documentation introduced in [32644] for WP_Posts_List_Table.

See #25408. See #32246.

comment:53 @DrewAPicture4 weeks ago

In 32669:

Fix syntax and add missing return descriptions for inline documentation introduced in [32644] for WP_Terms_List_Table.

See #25408. See #32246.

comment:54 @DrewAPicture4 weeks ago

In 32670:

Fix syntax and add a missing return description for inline documentation introduced in [32644] for WP_Users_List_Table.

See #25408. See #32246.

comment:55 @stephdau4 weeks ago

WP_List_Table::get_primary_column_name() is the method with the filter.
Extending classes usually implement ::get_default_primary_column_name(), which the above uses, so their value is filtered.
For extending classes where we do not want the column to be alterable, they should simply implement ::get_primary_column_name() instead.

25408.18.diff implements the above proposed solution for:

  • plugin list table (used for both single and multisite)
  • multisite themes list (single doesn't implement listtables per se).

@stephdau4 weeks ago

@helen4 weeks ago

comment:56 @helen4 weeks ago

In 32686:

List tables: tighten up primary column handling for plugins and multisite themes.

These shouldn't be able to have their primary column reassigned by default. Also removes the has-row-actions class as these list tables always have row actions visible and the JS for visual toggling conflicts. The column-primary class remains.

props stephdau.
see #25408.

comment:57 @slackbot4 weeks ago

This ticket was mentioned in Slack in #core by helen. View the logs.

comment:58 follow-ups: @obenland4 weeks ago

  • Keywords 4.1-early removed

Custom row attributes like here are no longer working, after [32644].

comment:59 in reply to: ↑ 58 @jeherve4 weeks ago

Replying to obenland:

Custom row attributes like here are no longer working, after [32644].

[32644] also seems to create notices with plugins like Jetpack, that build on top of WP_List_Table:

Notice: Undefined offset: 3 in /wp-admin/includes/class-wp-list-table.php on line 1120

I'll keep an eye on this ticket to see if we have to make any changes on our end.

comment:60 @afercia3 weeks ago

Just realized the latest comments in the Dashboard screen have row-actions but they're not revealed on focus. Previously, they were targeted with .dashboard-comment-wrap now removed in r32645. They would need the has-row-actions class (removing "td" in the jQuery selector) or to be targeted with a specific selector.

comment:61 in reply to: ↑ 58 @stephdau3 weeks ago

Replying to obenland:

Custom row attributes like here are no longer working, after [32644].

I think that is the only one that was missed. See 25408-users-list-table.diff

The only other one I recall is in the posts list, where the title column-title column also needs page-title assigned.

Last edited 3 weeks ago by stephdau (previous) (diff)

comment:62 follow-up: @georgestephanis3 weeks ago

Re @jeherve's remark above, yeah --

The changed line in WP_List_Table::single_row_columns from

list( $columns, $hidden ) = $this->get_column_info();

to

list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();

is causing a notice (not an error) if get_column_info() doesn't return four indexes in the array.

I suspect it's the initial failout clause in get_column_info() that is causing it --

if ( isset( $this->_column_headers ) )
	return $this->_column_headers;

I'd suggest that for backcompat, if $this->_column_headers doesn't contain four array items, we add on a fourth with a value of $this->get_primary_column_name()

Unless there's objections, I'll try to get a patch inbound.

@stephdau3 weeks ago

An alternative to 25408-list-table-headers-test.diff, if we wanted to future-proof things a bit.

comment:64 @georgestephanis3 weeks ago

I've not tested but it should do what I was thinking.

25408-list-table-headers-test.diff has problems, as it will fail out and ignore the custom ones, so any plugins that don't update to expect the new stuff will suddenly have their columns borked.

comment:65 @stephdau3 weeks ago

George's solution is friendlier to devs who don't keep up with things than mine, go with that.

comment:66 @helen3 weeks ago

In 32717:

List tables:

  • Avoid notices in custom list tables that manually set $_column_headers. Any plugins using this for a specific purpose should update.
  • Restore a special class name in the users list table.

props georgestephanis, stephdau.
see #25408.

@kovshenin3 weeks ago

comment:67 follow-up: @kovshenin3 weeks ago

I think r32717 will break column headers for all plugins that explicitly set $_column_headers, because up until r32644 only three items were expected from get_column_info(), but now we check for at least four and skip the explicitly set headers entirely if that's not the case.

25408.20.diff makes sure the function passes an array of at least four items, with null as primary. Too many arrays? You bet.

comment:68 in reply to: ↑ 67 ; follow-up: @ocean903 weeks ago

Replying to kovshenin:

25408.20.diff makes sure the function passes an array of at least four items, with null as primary. Too many arrays? You bet.

array_replace() is PHP 5.3+ and can't be used.

@kovshenin3 weeks ago

comment:69 in reply to: ↑ 68 @kovshenin3 weeks ago

Added 25408.21.diff, revised for php 3.0.18 compatibility.

comment:70 @helen3 weeks ago

In 32721:

List tables: Consolidate <td> output for posts.

see #25408.

comment:71 @helen3 weeks ago

In 32722:

List tables: Better primary column back-compat.

Why are people manually setting $_column_headers other than because somebody else told them to? Maybe time will tell.

props kovshenin.
see #25408.

comment:72 @mordauk3 weeks ago

The latest few commits appear to have completely broken custom list tables for me. The table doesn't render at all.
http://i.imgur.com/CNOD6Kk.png

comment:73 @mordauk3 weeks ago

It's failing because of count( $this->_column_headers ) >= 4.

There are only three header items in this particular list table:

$columns = $this->get_columns();

$hidden = array();

$sortable = $this->get_sortable_columns();

$this->_column_headers = array( $columns, $hidden, $sortable );

If $this->_column_headers = array( $columns, $hidden, $sortable ); is changed to $this->_column_headers = array( $columns, $hidden, $sortable, array() );, the table shows properly.

Seems the primary column isn't properly getting set.

comment:74 @mordauk3 weeks ago

Further note: it still fails even when not manually setting $this->_column_headers

comment:75 @helen3 weeks ago

In 32723:

List tables:

Since the primary column is not going to be alterable for plugins and MS themes, we don't need to check in on it.

see #25408.

comment:76 @slackbot3 weeks ago

This ticket was mentioned in Slack in #core by afercia. View the logs.

comment:77 @afercia6 days ago

Just noticed a very minor, few pixel, difference in the post table rows height compared to 4.2. The "title" cell used to have a post-title CSS class, was:

$attributes = 'class="post-title page-title column-title"' . $style;

now post-title is gone and in /wp-admin/css/edit.css the following selector doesn't apply anymore:

td.post-title strong,
td.plugin-title strong {
	display: block;
	margin-bottom: .2em;
	font-size: 14px;
}

I'd say either re-apply the rule with an updated selector or remove td.post-title strong from the CSS.

comment:78 @slackbot6 days ago

This ticket was mentioned in Slack in #core by obenland. View the logs.

comment:79 @helen5 days ago

  • Type changed from enhancement to task (blessed)

Still tweaking based on fall-out, including stuff discovered in work on #32395, so marking this as a task.

Note: See TracTickets for help on using tickets.