Opened 8 years ago
Last modified 6 years ago
#37518 new defect (bug)
New term.php is showing warning for rearranged columns using manage_{$screen->id}_columns filter
Reported by: | wzislam | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.5 |
Component: | Taxonomy | Keywords: | |
Focuses: | ui, administration | Cc: |
Description
Main Issue:
Declared custom column and sorted them using unset()
for my Custom Taxonomy for CPT:
<?php function mytax_icon_column( $columns ) { unset( $columns['cb'] ); unset( $columns['name'] ); $new_columns = array(); $new_columns['cb'] = $columns['cb']; $new_columns['name'] = $columns['name']; $new_columns['icon'] = 'Icon'; return array_merge( $new_columns, $columns ); } add_filter( 'manage_edit-mytax_columns', 'mytax_icon_column' );
and in the Term edit page (/term.php?taxonomy=mytax&tag_ID=224&post_type=cpt&wp_http_referer=%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3Dmytax%26post_type%3Dcpt
) it's displaying
Notice: Undefined index: cb in /home/path/public_html/path/wp-content/plugins/myplugin/plugin-file.php on line 240 Notice: Undefined index: name in /home/path/public_html/path/wp-content/plugins/myplugin/plugin-file.php on line 241
But it's not showing any warning message in earlier version (i.e. 4.5.2) where term's using edit-tags.php
.
Secondary Issue:
When I edit a term, under the Screen Options there are checkboxes denoting columns. But where are the columns? The checkboxes has no effect on this particular screen. They are good fit for the Term listing page only.
Can we sort these out?
Attachments (1)
Change History (5)
#2
@
8 years ago
and in the Term edit page (
/term.php?taxonomy=mytax&tag_ID=224&post_type=cpt&wp_http_referer=%2Fwp-admin%2Fedit-tags.php%3Ftaxonomy%3Dmytax%26post_type%3Dcpt
) it's displaying
Notice: Undefined index: cb in /home/path/public_html/path/wp-content/plugins/myplugin/plugin-file.php on line 240 Notice: Undefined index: name in /home/path/public_html/path/wp-content/plugins/myplugin/plugin-file.php on line 241
The warning is correct, you're trying to use the array items you've just unset.
When I edit a term, under the Screen Options there are checkboxes denoting columns. But where are the columns? The checkboxes has no effect on this particular screen. They are good fit for the Term listing page only.
It's already fixed in #34988, can't reproduce on a clean 4.5.3 install. Make sure all the files are properly updated.
Screen Options showing "Columns" checkboxes without any column in this UI