[wp-trac] [WordPress Trac] #32466: List table: hidden columns return unnecessary empty items
WordPress Trac
noreply at wordpress.org
Fri May 22 17:17:02 UTC 2015
#32466: List table: hidden columns return unnecessary empty items
----------------------------+-----------------------------
Reporter: afercia | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version: 4.2
Severity: normal | Keywords:
Focuses: javascript |
----------------------------+-----------------------------
While investigating on List Tables, noticed the hidden columns (see
`get_hidden_columns()`) returned, for example, this:
[[Image(https://cldup.com/S8aLhJASWc.png)]]
where the serialized array stored in the DB has 4 empty strings (going to
break it in multiple lines for readability):
{{{
`a:8:{
i:0;s:6:"author";
i:1;s:10:"categories";
i:2;s:4:"tags";
i:3;s:8:"comments";
i:4;s:0:"";
i:5;s:0:"";
i:6;s:0:"";
i:7;s:0:"";
}`
}}}
Turns out the current jQuery selector targets also the table headers in
the footer and they don't have an ID. Since we need just the table headers
with an ID, and we can't predict if they will be the ones in the `thead`
or the ones in the `tfoot`, the proposed patch changes the jQuery selector
to target just the ones with an ID.
Stored value with the patch applied:
{{{
`a:4:{i:0;s:6:"author";i:1;s:10:"categories";i:2;s:4:"tags";i:3;s:8:"comments";}`
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/32466>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list