Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#55322 closed defect (bug) (invalid)

The Class WP-Post List Table(Method - Column_Default) Contains Irrelevant Keyword 'return'

Reported by: cu121 Owned by:
Priority: normal Milestone:
Component: Posts, Post Types Version: 3.5
Severity: normal Keywords:
Cc: Focuses: administration

Description

The Class WP-Post-List-Table has a method 'Column_Default' which contains a 'return' statement that prevents hooks from being fired like(hooks:- manage_pages_custom_column, manage_posts_custom_column, manage_{$post->post_type}_posts_custom_column). The return statement is on line number 1302, File-Name:- class-wp-posts-list-table.php.

Change History (5)

#1 @SergeyBiryukov
4 years ago

  • Component AdministrationPosts, Post Types
  • Version 5.9.13.5

Hi there, welcome back to WordPress Trac! Thanks for the report.

For reference, the return statement was technically added in [32740] / #29881, but it replaced an earlier break statement added in [21788] / #21240, so WordPress 3.5 appears to be the earliest affected version here.

#2 @joyously
4 years ago

The return isn't irrelevant.
That if statement handles only taxonomy columns, and it runs the appropriate filter.
The actions further down are for custom columns, which the taxonomy column is not, so they should not be run in that case.

#3 @cu121
4 years ago

I see I was checking for taxonomy basically. I guess this ticket can be closed.
Thank You For The Explaination

#4 @costdev
4 years ago

  • Keywords dev-feedback needs-patch removed
  • Milestone Awaiting Review
  • Resolutioninvalid
  • Status newclosed

Thanks for opening this ticket @cu121!

As @joyously explained:

  • When the column is categories, post_tags, or starts with taxonomy-:
    • Handle the taxonomy and return.
  • Otherwise:
    • Run an appropriate action hook depending on whether the post type is hierarchical (yes = Pages hook, no = Posts hook).
    • Finally, run the action hook for the specific post type.

I'll close this ticket as invalid, as the method returns at an appropriate time.

Thanks to all for their insight on this.

Version 0, edited 4 years ago by costdev (next)

#5 @cu121
4 years ago

@costdev thank you so much for the explanation :)

Note: See TracTickets for help on using tickets.