[wp-trac] [WordPress Trac] #38462: Unit test to detect identical hooks with differing parameters

WordPress Trac noreply at wordpress.org
Sat Dec 3 21:12:17 UTC 2016


#38462: Unit test to detect identical hooks with differing parameters
------------------------------+------------------------------
 Reporter:  johnbillion       |       Owner:
     Type:  feature request   |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Plugins           |     Version:
 Severity:  normal            |  Resolution:
 Keywords:  needs-unit-tests  |     Focuses:
------------------------------+------------------------------

Comment (by keesiemeijer):

 To parse all php files is very expensive and should be avoided in unit
 tests. I've compiled a list (from the 4.6.1 parsed data) of hooks that are
 triggered in multiple places with differing parameters.

 ||= hook =||= function =||
 ||[https://developer.wordpress.org/reference/hooks/comment_text/
 comment_text]||[https://developer.wordpress.org/reference/functions/check_comment/
 check_comment]||
 ||[https://developer.wordpress.org/reference/hooks/list_cats/
 list_cats]||[https://developer.wordpress.org/reference/classes/walker_categorydropdown/start_el/
 Walker_CategoryDropdown::start_el]||
 ||[https://developer.wordpress.org/reference/hooks/the_category/
 the_category]||[https://developer.wordpress.org/reference/functions/wp_popular_terms_checklist/
 wp_popular_terms_checklist]||
 ||[https://developer.wordpress.org/reference/hooks/the_category/
 the_category]||[https://developer.wordpress.org/reference/functions/wp_link_category_checklist/
 wp_link_category_checklist]||
 ||[https://developer.wordpress.org/reference/hooks/the_content/
 the_content]||[https://developer.wordpress.org/reference/functions/do_trackbacks/
 do_trackbacks]||
 ||[https://developer.wordpress.org/reference/hooks/wp_update_nav_menu/
 wp_update_nav_menu]||[https://developer.wordpress.org/reference/functions/wp_nav_menu_update_menu_items/
 wp_nav_menu_update_menu_items]||
 ||[https://developer.wordpress.org/reference/hooks/deleted_user/
 deleted_user]||[https://developer.wordpress.org/reference/functions/wpmu_delete_user/
 wpmu_delete_user]||
 ||[https://developer.wordpress.org/reference/hooks/quick_edit_custom_box/
 quick_edit_custom_box]||[https://developer.wordpress.org/reference/classes/wp_terms_list_table/inline_edit/
 WP_Terms_List_Table::inline_edit]||
 ||[https://developer.wordpress.org/reference/hooks/restrict_manage_posts/
 restrict_manage_posts]||[https://developer.wordpress.org/reference/classes/wp_media_list_table/extra_tablenav/
 WP_Media_List_Table::extra_tablenav]||
 ||[https://developer.wordpress.org/reference/hooks/theme_action_links/
 theme_action_links]||[https://developer.wordpress.org/reference/classes/wp_themes_list_table/display_rows/
 WP_Themes_List_Table::display_rows]||

 For now we should update these hooks with the right parameters. We could
 have the docs parser store these hooks when parsing and correct them after
 upgrading WP.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38462#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list