WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#36893 new defect (bug)

Columns filter from taxonomy edit screen (edit-tags.php) gets applied in term edit screen (term.php)

Reported by: szaqal21 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.5
Component: Taxonomy Keywords:
Focuses: administration Cc:

Description

I've did a simple test:

<?php
function test($columns)
{
        echo 'Test output';
        
        return $columns;
}

add_filter('manage_edit-category_columns', 'test');

which resulted:

<div id="screen-meta" class="metabox-prefs">
<div id="contextual-help-wrap" class="hidden no-sidebar" aria-label="Zakładka pomocy kontekstowej" tabindex="-1">
Test output
</div>

so this filter is working in term.php. Another thing is that, adding custom columns in edit-terms.php screen forces Screen options to show in term.php.

edit-tags.php http://s32.postimg.org/igwy86u2t/image.jpg

term.php http://s32.postimg.org/7ddc2l8sl/image.jpg

Change History (2)

#1 @boonebgorges
2 years ago

  • Focuses administration added
  • Version set to 4.5

adding custom columns in edit-terms.php screen forces Screen options to show in term.php.

Hi @szaqal21 - This is happening because edit-tags.php and term.php have the same screen ID. When you add columns to the screen (in this case, edit-category, or whatever the taxonomy is), they're displayed on both of these pages.

The behavior appears to date from [36874]. See #34988.

I don't think it's intended behavior. Screen Options shouldn't show up if the only thing it's going to show is checkboxes for a list table that doesn't exist. I don't know whether the right solution is to give term.php a different screen ID, or to do some sort of trick on term.php to ignore or unset any custom columns added via filters like manage_edit-category_columns. @swissspidy - what do you think?

#2 @swissspidy
2 years ago

We added this behaviour for BC purposes after we got some reports of breakage. The original issue was the same as in this ticket: screen options being displayed where they do not belong to. Apparently we fixed it for the default columns but not newly added ones.

A different screen ID would be ideal, though we should do that early in the cycle.

Note: See TracTickets for help on using tickets.