Make WordPress Core

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's profile 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)

Screenshot_1.png (31.6 KB) - added by wzislam 8 years ago.
Screen Options showing "Columns" checkboxes without any column in this UI

Download all attachments as: .zip

Change History (5)

@wzislam
8 years ago

Screen Options showing "Columns" checkboxes without any column in this UI

#1 @ocean90
8 years ago

  • Focuses administration added
  • Version changed from trunk to 4.5

#2 @SergeyBiryukov
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.

Last edited 8 years ago by SergeyBiryukov (previous) (diff)

#3 @ocean90
8 years ago

Sounds like a duplicate of #36893.

#4 @wzislam
8 years ago

But the warning never appeared in 3.5, it's showing while using the term.php, and I'm adding the columns again... so ultimately they exists, na?

Last edited 8 years ago by wzislam (previous) (diff)
Note: See TracTickets for help on using tickets.