1

The wordpress admin tables used on pages like www.example.com/wp-admin/edit.php uses a class class-wp-list-table.php

In this class there are two functions that hide specific table columns with {display: none;} that can be seen at the following links:

wordPress/wp-admin/includes/class-wp-list-table.php

wordPress/wp-admin/includes/class-wp-list-table.php

Recently, I had been trying to improve the wordpress tables, working on a plugin addming fixed table headers and live filtering. I was using Jquery FilterTable which works awesome, along with a sticky header script.

Most sticky table header scripts clone the existing header when it reaches the top of the screen and fix it, while hiding the old one with css display:none or visibility:hidden. Everything can be seen here

Jquery Filter Table uses display: none as well to do it's live filtering by hiding the results not found in the users search.

For some reason these styles interfere with the class-wp-list-table when updating pages/posts. It causes display: none to become permanent. I thought it was a caching issue at first, however I disabled all my plugins and cleared my cache. I even went as far as reinstalling wordpress. I did first notice this after installing codepress-admin-columns but have deleted the plugin and it hasn't fixed anything.

display : none; was embedded inline on several of the table headers and their relating columns

It seems like wordpress stores the values of all the table columns html, not just the values.

I know that it caches the tables for pagination, but I'm not really sure how this all occurs.

I'm wondering why this happened, but more importantly how can I fix the tables as it seems like they're stored/cached somewhere in the database? I've deactivated every plugin, Reset to the twenty-fourteen, ran the allow_repair script, and cleared all orphans/transients. I've cleared my server cache as well as my computers browser cache.

Image showing missing columns:

Image showing missing columns

Image showing display:none added to title

Display none also added to td columns

enter image description here

3 Answers 3

1

This is a bug with the wordpress AJAX trying to update manageedit-pagecolumnshidden on the admin table pages when columns are hidden. It completly breaks the entire admin tables when the table headers are visually hidden. Thanks to Michael Ecklund's clue I was able to figure it out.

I created the Ticket here:

https://core.trac.wordpress.org/ticket/29030

And a video of the issue can be seen here:

https://www.youtube.com/watch?v=lZKjUpFx_yc&feature=youtu.be

0

Visible columns in tables can be disabled via "Screen options" in interface (upper right of the admin). With plugins disabled that's likely what you are seeing.

3
  • This could have to do with with screen options, but not that their disabled... For one the title is missing. And it's not available in screen options. All of the columns appear to be gone and are not avaiable to check in the screen options. Check the pictures I added. Commented Jun 19, 2014 at 4:30
  • Rarst I was able to fix the issue with unset filter on the "hidden" columns and then disabling the filter function. Not sure why it fixed it, but it seems like wordpress didn't realize the columns were not "unset" and the only way to make it realize they weren't was to actually unset them and then set theme again by deactivating the filter. Does that even make sense? Commented Jul 17, 2014 at 23:28
  • 1
    Could have also been hidden by means of user meta. So even though you removed your code which was hiding those columns; The columns could have still been hidden for that particular user. Specifically this user meta key: manageedit-pagecolumnshidden Commented Jul 21, 2014 at 16:08
0

Whatever caused the issue I noticed that the columns that I had previously had unset were the only one that were showing up after deactivating everything.

To fix the issue I unset the missing columns with the following filter:

function remove_all_pages_columns_to_fix_hidden($columns) {
  unset($columns['cb']); // Remove checkbox column
  unset($columns['title']); // Remove title column
  return $columns;
}
add_filter('manage_pages_columns', 'remove_all_pages_columns_to_fix_hidden');

Then I went to to the edit page and updated the page. I'm pretty sure this issue has to do with how the WP_List_Table & admin-ajax.php work together.

Edit:

Thank you @Michael Ecklund for pointing out manageedit-pagecolumnshidden

columnshidden shows up in wp_ajax_hidden_columns() & get_hidden_columns()....

The admin-ajax client-side functionality here appears to be here in common.js which checks for the hidden table headers

The problem with the way this all works is that it does a pretty poor job of separating presentation from behavior logic.

For example if at any time or reason thead { display: none; } or .column-title { display: none; } or #cb { display: none; } or anything similar, the entire table will break for that user. WP_List_Table should not depend on something lik that not happening. In my case I was trying to make a sticky table header script, but I could see a lot of wordpress beginers, that don't know how to properly remove them, try to use css display: none; which would destroy their editing tables as soon as they update columnshidden. The manageedit-{$post_type}column should not rely on the visibility of and only the actual checked input fields.

Edit 2: While the issue itself is a bit different, I think this might be very similar to some other issues like these:

WP List Table custom quick edit box - post meta data missing and columns change on submit

Custom admin column disappearing when using Quick Edit

Wordpress admin WP_table_list show incorrectly

https://core.trac.wordpress.org/ticket/21016

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.