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

WordPress Trac noreply at wordpress.org
Wed Dec 7 12:44:16 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):

 Yeah, maybe this should be changed into a task instead of a feature
 request. Should I create a separate ticket for that?

 Meanwhile I've found some more oddities that should be cleaned up.

 This one (in a deprecated function) is missing a parameter in the database
 because it's not documented.
 https://developer.wordpress.org/reference/hooks/the_content_rss/

 These have differing parameter name in the DocBlock
 ||= hook =||= function =||
 ||[https://developer.wordpress.org/reference/hooks/the_comments/
 the_comments]||[https://developer.wordpress.org/reference/classes/wp_comment_query/get_comments/
 WP_Comment_Query::get_comments]||
 ||[https://developer.wordpress.org/reference/hooks/the_sites/
 the_sites]||[https://developer.wordpress.org/reference/classes/wp_site_query/get_sites/
 WP_Site_Query::get_sites]||
 ||[https://developer.wordpress.org/reference/hooks/posts_join/
 posts_join]||[https://developer.wordpress.org/reference/classes/wp_query/get_posts/
 WP_Query::get_posts]||
 ||[https://developer.wordpress.org/reference/hooks/the_networks/
 the_networks]||[https://developer.wordpress.org/reference/classes/wp_network_query/get_networks/
 WP_Network_Query::get_networks]||

 These have missing parameters in the DocBlock
 ||= hook =||= function =||
 ||[https://developer.wordpress.org/reference/hooks/get_avatar/
 get_avatar]||[https://developer.wordpress.org/reference/functions/get_avatar/
 get_avatar]||
 ||[https://developer.wordpress.org/reference/hooks/show_post_locked_dialog/
 show_post_locked_dialog]||[https://developer.wordpress.org/reference/functions/_admin_notice_post_locked/
 _admin_notice_post_locked]||
 ||[https://developer.wordpress.org/reference/hooks/fallback_intermediate_image_sizes/
 fallback_intermediate_image_sizes]||[https://developer.wordpress.org/reference/functions/wp_generate_attachment_metadata/
 wp_generate_attachment_metadata]||

 These have Concatenated dynamic hooks
 ||= hook =||= function =||
 ||[https://developer.wordpress.org/reference/hooks/the_author_field/
 the_author_{$field}]||[https://developer.wordpress.org/reference/functions/the_author_meta/
 the_author_meta]||
 ||[https://developer.wordpress.org/reference/hooks/get_the_author_field/
 get_the_author_{$field}]||[https://developer.wordpress.org/reference/functions/get_the_author_meta/
 get_the_author_meta]||
 ||[https://developer.wordpress.org/reference/hooks/customize_save_this-
 id_database/
 customize_save_{$this->id_data[‘base’]}]||[https://developer.wordpress.org/reference/classes/wp_customize_setting/save/
 WP_Customize_Setting::save]||
 ||[https://developer.wordpress.org/reference/hooks/field/
 {$field}]||[https://developer.wordpress.org/reference/functions/sanitize_bookmark_field/
 sanitize_bookmark_field]||
 ||[https://developer.wordpress.org/reference/hooks/field/
 {$field}]||[https://developer.wordpress.org/reference/functions/sanitize_user_field/
 sanitize_user_field]||
 ||[https://developer.wordpress.org/reference/hooks/field/
 {$field}]||[https://developer.wordpress.org/reference/functions/sanitize_post_field/
 sanitize_post_field]||
 ||[https://developer.wordpress.org/reference/hooks/default_option_option/
 default_option_{$option}]||[https://developer.wordpress.org/reference/functions/update_option/
 update_option]||
 ||[https://developer.wordpress.org/reference/hooks/default_option_option/
 default_option_{$option}]||[https://developer.wordpress.org/reference/functions/add_option/
 add_option]||
 ||[https://developer.wordpress.org/reference/hooks/wp_admin_css/
 wp_admin_css]||[https://developer.wordpress.org/reference/functions/wp_admin_css/
 wp_admin_css]||
 ||[https://developer.wordpress.org/reference/hooks/uninstall_file/
 uninstall_{$file}]||[https://developer.wordpress.org/reference/functions/uninstall_plugin/
 uninstall_plugin]||
 ||[https://developer.wordpress.org/reference/hooks/type_send_to_editor_url/
 {$type}_send_to_editor_url]||[https://developer.wordpress.org/reference/functions/wp_ajax_send_link_to_editor/
 wp_ajax_send_link_to_editor]||
 ||[https://developer.wordpress.org/reference/hooks/option/
 {$option}]||[https://developer.wordpress.org/reference/classes/wp_screen/render_per_page_options/
 WP_Screen::render_per_page_options]||
 ||[https://developer.wordpress.org/reference/hooks/option/
 {$option}]||[https://developer.wordpress.org/reference/classes/wp_list_table/get_items_per_page/
 WP_List_Table::get_items_per_page]||

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


More information about the wp-trac mailing list